-
Notifications
You must be signed in to change notification settings - Fork 308
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
Dependency: add support for loading auxiliary code as LLEXT modules #9399
Draft
lyakh
wants to merge
22
commits into
thesofproject:main
Choose a base branch
from
lyakh:depend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
also needs thesofproject/linux#5156 |
Can this PR be split into smaller PRs ? I suspect we have cosmetic. fixes and the new feature patches here? |
@lgirdwood yes, I'd say - this is just my current state dump, will be split |
Add a Kconfig option that can be used to flip all LLEXT-supporting code to a modular build. Use that global flag for smart-amp-test, mixin-mixout and eq-iir. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Enable CONFIG_LIBRARY_DEFAULT_MODULAR for LNL to build all supporting code as LLEXT modules. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently LLEXT module starting addresses are hard-coded in their respective CMakeLists.txt files. This is very wasteful, since it's unknown in what order modules are loaded, inflexible and not easily extendible to other platforms. Switch to calculating addresses automatically based on a single per-platform Kconfig value. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
LNL modules overlay is missing eq_iir and mixin_mixout entries, add them there. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Build src as a loadable llext module. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To make volume an LLEXT module it should have a single TOML configuration file named volume.toml. This is easy to do, using respective Kconfig options. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When building volume as an LLEXT module, two more symbols are required: __divdi3() and module_set_configuration(), export them. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This makes it possible to build volume as an LLEXT module to be loaded at run-time. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add support for LLEXT building to eq-fir. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move the logging context of eq_iir and mixin_mixout to the base firmware image too. This improves logging entries, dropped due to LLEXT unloading. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add support for LLEXT building to asrc. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When built as an llext module, eq_fir requires several base-firmware provided symbols, export them. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
MOD_INIT_INSTANCE IPCs can be processed on different cores, different cores can use the same modules. Make shared data uncached. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add support for LLEXT building to tdfb. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add a dedicated type for auxiliary LLEXT objects, not implementing the Module Adapter API. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
FIR support code is used by eq-fir and by tdfb. When both of them are built as LLEXT modules, FIR supporting functions can be dynamically loaded too. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
llext_manager_link() doesn't the whole of struct module_data, it only needs a pointer to a pointer to struct llext. Modify it to only receive the scope, that it needs. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The LLEXT context is currently bound to the Module Adapter API which shouldn't be the case because we also need generic LLEXT-based loadable SOF objects. This patch moves the context to struct lib_manager_mod_ctx which is safe, because the library manager is always needed when dynamically loading modules. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Zephyr logging adds function names automatically, no need to also provide them explicitly in format strings. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently lib_manager_module_free() first checks, if an LLEXT module is being freed. If so, it first calls llext_unload() and then - if the use-count is reported as zero, calls llext_manager_free_module(). Simplify this process by just calling llext_manager_free_module() and letting it handle llext_unload() internally. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
LLEXT modules can depend on other LLEXT auxiliary libraries. Zephyr LLEXT core takes core to link them. This commit implements their loading into and unloading from SRAM when the first dependent is added or the last one is removed respectively. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Test zephyrproject-rtos/zephyr#77473 Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the moment LLEXT modules can only be instances of the Module Adapter API. This PR adds ability to load arbitrary code as LLEXT into SOF e.g. to provide functionality by exporting symbols for other LLEXT modules. Requires a yet unmerged Zephyr PR