-
Notifications
You must be signed in to change notification settings - Fork 322
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
LLEXT: persistent dependency #9804
Draft
lyakh
wants to merge
19
commits into
thesofproject:main
Choose a base branch
from
lyakh:depend-persist
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.
Draft
+402
−123
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
lyakh
force-pushed
the
depend-persist
branch
2 times, most recently
from
January 31, 2025 09:42
49dbeb1
to
2342b39
Compare
Add a dedicated type for auxiliary LLEXT objects, not implementing the Module Adapter API. Signed-off-by: Guennadi Liakhovetski <[email protected]>
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 <[email protected]>
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_module which is safe, because the library manager is always needed when dynamically loading modules. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Extract localisation and linking of a single LLEXT module into a separate function, it will be re-used for auxiliary modules. Signed-off-by: Guennadi Liakhovetski <[email protected]>
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 <[email protected]>
This reverts commit cf31c9c. We do now need to store BSS information for auxiliary LLEXT management. When instantiating such a module for the second time, we don't have access to Zephyr LLEXT information any more, so we need to use our cached information for .bss allocation. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Auxiliary modules, implemented as LLEXT and used to provide functionality for other modules, don't have TOML configuration, make rimage skip that step for them. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Add comments to two structure fields, whose meaning isn't immediately obvious otherwise. Signed-off-by: Guennadi Liakhovetski <[email protected]>
llext_manager_load_module()'s ebl argument is only used for .bss alignment. Calculate it automatically to eliminate ebl, because it isn't available during following loads. e.g. when reloading dependencies. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Let llext_manager_mod_init() calculate mod_array itself internally, it has all the data for that. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Currently when module's last instance is destroyed, it's freed and its Zephyr context is destroyed too. At the same time the module is kept in DRAM in a linked and relocated state, which means, that next time when we have to use it, we need to tell Zephyr to instantiate it while skipping the linking step. Additionally this makes handling dependencies inconvenient: they are created during the linking step by Zephyr and therefore are lost when the module is released. Then, as described above, they're not recreated when the linking step is skipped during a subsequent load. To fix this problem this commit avoids destroying module's Zephyr context when freeing. This costs around 200 bytes but makes handling of dependencies possible. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Add support for auxiliary modules, exporting symbols to other modules. In such cases Zephyr LLEXT API generates a dependency list, available while the dependent module is loaded. SOF now preserves the minimum module context even while it isn't used, that includes dependency lists, so on a repeated load they're still available. Signed-off-by: Guennadi Liakhovetski <[email protected]>
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 <[email protected]>
Test Zephyr PR zephyrproject-rtos/zephyr#84911 required for this one to work. Signed-off-by: Guennadi Liakhovetski <[email protected]>
This reverts commit dbdfe32. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Modular waves build seems to be broken even with a stub, disable it until it's fixed. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Now that the Linux driver requirement for LLEXT dependencies has been merged, we can test on any ACE architecture. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Fix a typo, making it impossible to build eq_fir without eq_iir as LLEXT. Signed-off-by: Guennadi Liakhovetski <[email protected]>
Modular TDFB needs additional exported symbols from Zephyr and SOF core. Signed-off-by: Guennadi Liakhovetski <[email protected]>
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.
this should replace #9399