-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Move rimage toml config files to SOF repository #7270
Comments
@mwasko @marcinszkudlinski fyi - obvious effort reduction here to keep toml manifest configs alongside FW code. |
Wait: the static properties still exist AFAIK. So shouldn't rimage be able to read from more than one .toml file / from both places? Would simply concatenating the files in the order given be enough? This would mean moving fewer files / less content and not breaking backwards compatibility, probably easier git bisect etc. PS: I think zephyrproject-rtos/zephyr#54700 should go first. Working on it. EDIT: done. EDIT: this seems highly relevant: |
@marc-hb wrote:
But why should rimage (the tool) repo host even the static details? I agree we could split, but I'm not sure if there is any benefit to hosting in multiple repos. These are essentially the platforms we maintain in SOF repository. I.e. shouldn't rimage repo be more like a repo for gcc/clang in that it provides a tool that takes X in and spews Y out, but the input data X is hosted in other repos. |
After taking a look at thesofproject/sof-docs#451 I wonder why we're even building the extended manifest using C code in 2023? https://github.com/thesofproject/rimage/issues?q=crash AFAIK the extended manifest is merely concatenated to the "main" EDIT: C re-implementation of elfutils submitted in |
I was just about closing my issue with crashing. Last changes in rimage improved significantly stability of that tool. @marc-hb I know that @aborisovich is huge advocate changing language of that tool but currently @softwarecki invest huge amount of work to make that tool a bit more bugfree. Soooo If you want to discuss future of that tool Andrey is right person ;) |
@pjdobrowolski not exactly, I'm not a person responsible for such strategical decisions. After @softwarecki fixes the tool stopped crashing on Windows and looks much more stable. |
@marc-hb lets keep on topic. Verification of hashing/signing is faster in C and hence that's why rimage is in C today. |
@lgirdwood I think @marc-hb was referring to the extended manifest created from toml files. It isn't signed, unlike the module manifest. So it can be generated by another tool and inserted at the beginning of the file. For the toml files, I see the following problems with them:
My idea to solve these problems is to move the information from the toml files to the source code of the modules. While leaving in them only some basic description of the platform and its address space. |
I was a bit vague but yes: the firmware manifest and the extended manifest are two very different problems and they seem to have a very simple and very clear line between them. The former has a limited scope and it is already implemented fully AFAIK whereas the extended manifest seems to be just getting started and currently "exploding" = why this PR was filed. I haven't seen signing performance being an issue which means existing libraries in any other, high level and popular language could be re-used to avoid parsing, pushing bits and managing memory "by hand". https://alexgaynor.net/2019/aug/12/introduction-to-memory-unsafety-for-vps-of-engineering/
These longer term ideas should probably be discussed in a new issue to keep this shorter-term PR "on topic". There is a convenient |
Moving rimage from one programing language to another is simple in theory. We had that discussion already last year and this year and it is not a "weekend" job. |
This patch copies rimage/config to sof/config, and use toml files in sof/config for signing. Firmware manifest configuration files should stay with SOF instead of rimage tool. Deletion of rimage/config will be done later. Link: thesofproject#7270 Signed-off-by: Chao Song <[email protected]>
@softwarecki Ack - can we have an ELF section which can be looked up and the meta data can be parsed. i.e. the metadata is an array of objects all with a type and size header (allows it to be easily extended when required). |
Note on tjhe Zephyr dependency we realized yesterday with @nashif . Zephyr depends on rimage and the static platform bits of toml files, to create bootable flash images. If we move the toml files, this creates an awkward dependency from Zephyr to SOF repo (i.e. to run low-level driver unit tests on hardware targets, Zephyr needs to depend on the high-level app code repository). One option is to duplicate the static bits (these don't change after all) of platform description in Zephyr repository (i.e. have subsets of the tomls files there), but ideally we should be able to share this configuration data and host the platform-specific bits e.g. in Zephyr (where the low-level code and drivers are anyways) from the audio application bits (audio modules, their properties and performance descriptions which are inherently linked to code in sof/src/audio). |
I think you mean this revert
Thanks @softwarecki for trying :-) |
The deleted "install" target copied only the rimage executable and left the config files behind. This gave the wrong impression that the executable is useful without config files. "Installing" also gave the wrong impression that rimage versions are somewhat stable and relatively independent of SOF versions: they're not. In fact there is no such thing as an rimage "version": everyone should always use the exact rimage _git commit_ from the west manifest or git submodule. There are no rimage "releases" and no semantic versioning or anything like it, rimage is effectively part of the SOF source and build and run directly from its build directory by practically every SOF developer and SOF CI thanks to sof/src/arch/xtensa/CMakeLists.txt#ExternalProject_Add(rimage_ep ... sof/scripts/xtensa-build-zephyr.py#def build_rimage() sof/zephyr/CMakeLists.txt#set(RIMAGE_CONFIG_PATH ... etc. Providing an "install" target greatly increases the chances of different people and CIs using different rimage versions which is the last thing we want considering the many significant rimage changes happening right now, examples: - zephyrproject-rtos/zephyr#56099 - zephyrproject-rtos/zephyr#54700 - thesofproject/sof#7270 - thesofproject/sof#7304 - thesofproject/sof#7320 - thesofproject#155 While it's useful for multiple files (e.g.: config files), a CMake target was always overkill to copy a single file. Someone or some script who really wants to copy the rimage binary to some other place that the build directory for some (discouraged) reason _can still do so_ with a much more basic, simpler and more transparent file copy command. Finally, the default "bin" DESTINATION required root access which is otherwise totally unncessary to build SOF. Signed-off-by: Marc Herbert <[email protected]>
The deleted "install" target copied only the rimage executable and left the config files behind. This gave the wrong impression that the executable is useful without config files. "Installing" also gave the wrong impression that rimage versions are somewhat stable and relatively independent of SOF versions: they're not. In fact there is no such thing as an rimage "version": everyone should always use the exact rimage _git commit_ from the west manifest or git submodule. There are no rimage "releases" and no semantic versioning or anything like it, rimage is effectively part of the SOF source and build and run directly from its build directory by practically every SOF developer and SOF CI thanks to sof/src/arch/xtensa/CMakeLists.txt#ExternalProject_Add(rimage_ep ... sof/scripts/xtensa-build-zephyr.py#def build_rimage() sof/zephyr/CMakeLists.txt#set(RIMAGE_CONFIG_PATH ... etc. Providing an "install" target greatly increases the chances of different people and CIs using different rimage versions which is the last thing we want considering the many significant rimage changes happening right now, examples: - zephyrproject-rtos/zephyr#56099 - zephyrproject-rtos/zephyr#54700 - thesofproject/sof#7270 - thesofproject/sof#7304 - thesofproject/sof#7320 - thesofproject#155 While it's useful for multiple files (e.g.: config files), a CMake target was always overkill to copy a single file. Someone or some script who really wants to copy the rimage binary to some other place that the build directory for some (discouraged) reason _can still do so_ with a much more basic, simpler and more transparent file copy command. Finally, the default "bin" DESTINATION required root access which is otherwise totally unncessary to build SOF. Signed-off-by: Marc Herbert <[email protected]>
The deleted "install" target copied only the rimage executable and left the config files behind. This gave the wrong impression that the executable is useful without config files. "Installing" also gave the wrong impression that rimage versions are somewhat stable and relatively independent of SOF versions: they're not. In fact there is no such thing as an rimage "version": everyone should always use the exact rimage _git commit_ from the west manifest or git submodule. There are no rimage "releases" and no semantic versioning or anything like it, rimage is effectively part of the SOF source and build and run directly from its build directory by practically every SOF developer and SOF CI thanks to sof/src/arch/xtensa/CMakeLists.txt#ExternalProject_Add(rimage_ep ... sof/scripts/xtensa-build-zephyr.py#def build_rimage() sof/zephyr/CMakeLists.txt#set(RIMAGE_CONFIG_PATH ... etc. Providing an "install" target greatly increases the chances of different people and CIs using different rimage versions which is the last thing we want considering the many significant rimage changes happening right now, examples: - zephyrproject-rtos/zephyr#56099 - zephyrproject-rtos/zephyr#54700 - thesofproject/sof#7270 - thesofproject/sof#7304 - thesofproject/sof#7320 - #155 While it's useful for multiple files (e.g.: config files), a CMake target was always overkill to copy a single file. Someone or some script who really wants to copy the rimage binary to some other place that the build directory for some (discouraged) reason _can still do so_ with a much more basic, simpler and more transparent file copy command. Finally, the default "bin" DESTINATION required root access which is otherwise totally unncessary to build SOF. Signed-off-by: Marc Herbert <[email protected]>
Moved to v2.7 to give time to align with Zephyr |
This probably needs some rimage work to allow rimage to process toml input from multiple separate files. This then allows to have base platform descriptions in rimage repository (or in Zephyr upstream), and move the algo-specific toml sections to SOF git. |
@kv2019i @lgirdwood @alex-cri , @aiChaoSONG will move the algo-specific toml sections to SOF git next month, good to move to v2.8? |
Ack, let's move to v2.8, I don't think we have bandwidth for this. |
@kv2019i Do we want a simple toml move(this is quick) or we also want to split platform config and algorithm config? |
@aiChaoSONG I think the consensus now is we want to split the platform and algorithm configs, and that is likely to need more work (support of combinting multilple toml files with some inclusion mechanism, and deciding where to put the platform files). I agree the simple move was already covered by your original PR and could be quicker. But if we now do the split implementation, we need more runway for that. |
@kv2019i ok, so v2.8 we need to do the topology and tooling split too. |
Or much simpler; single repo for rimage and SOF: |
This patch copies zephyr RTOS base SOF image toml files from rimage repo to SOF repo. Link: thesofproject#7270 Signed-off-by: Chao Song <[email protected]>
This patch splits toml configs to platform related configs and module related configs. Link: thesofproject#7270 Signed-off-by: Chao Song <[email protected]>
This patch copies zephyr RTOS base SOF image toml files from rimage repo to SOF repo. Files are copied from rimage main branch, commit ID: 7bc2958 Config: Add DCblock to TGL, TGL-H, MTL, and LNL Link: thesofproject#7270 Signed-off-by: Chao Song <[email protected]>
This patch splits toml configs to platform related configs and module related configs. Link: thesofproject#7270 Signed-off-by: Chao Song <[email protected]>
Since my comment on August, discussion has spread out even more, so marking this as "unclear" for the moment. |
Fix intel_adsp_generic.rst following the merge of the rimage git repository back into the sof git repository: - thesofproject/sof#7270 Signed-off-by: Marc Herbert <[email protected]>
Small zephyr doc update submitted, please review: |
Fix intel_adsp_generic.rst following the merge of the rimage git repository back into the sof git repository: - thesofproject/sof#7270 Signed-off-by: Marc Herbert <[email protected]>
Fix intel_adsp_generic.rst following the merge of the rimage git repository back into the sof git repository: - thesofproject/sof#7270 (cherry picked from commit 22f7516) Original-Signed-off-by: Marc Herbert <[email protected]> GitOrigin-RevId: 22f7516 Change-Id: I79792b8c093f3d95dcbba6365f3edff40e49273c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5109850 Tested-by: Fabio Baltieri <[email protected]> Reviewed-by: Fabio Baltieri <[email protected]> Commit-Queue: Fabio Baltieri <[email protected]> Tested-by: ChromeOS Prod (Robot) <[email protected]>
Fix intel_adsp_generic.rst following the merge of the rimage git repository back into the sof git repository: - thesofproject/sof#7270 Signed-off-by: Marc Herbert <[email protected]>
Is your feature request related to a problem? Please describe.
The toml files in sof/rimage/config/*.toml have recently started covered properties of SOF modules that are no longer static properties of a platform, but rather are describiting attributes that can change when code is changed in SOF main.
This highly problematic if a code to optimize a module's performance is merged to SOF main, a matching update is needed to rimage toml files (for all affected platforms), plus a separate sof/west.yml update to bring that in to SOF builds (with Zephyr where west is used).
Describe the solution you'd like
Rimage repository should only host the tool, not the actual platform-specific content.
Describe alternatives you've considered
Moving only IPC4 specific data is one option, but due to design of rimage, this seems rather complex and in the end the easier solution would be to move all of toml config files.
Additional context
https://github.com/thesofproject/rimage/pulls?q=is%3Apr+is%3Aclosed+sort%3Aupdated-desc
The text was updated successfully, but these errors were encountered: