Skip to content
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: use the new inspection API (continued) #9831

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pillo79
Copy link

@pillo79 pillo79 commented Feb 13, 2025

As a newly added SOF developer, had to close #9823 and open a new PR to take advantage of automatic CI runs (and therefore stop nagging @lyakh all day! 😁)
Still WIP as I try to figure out the issues identified in CI.


This PR tries to improve SOF by minimizing its dependency on LLEXT internals.
Instead of relying on direct field access, the code in llext_manager.c is refactored to use a set of new, stable LLEXT APIs that expose the same information. These code changes should have no measurable effects in the rest of SOF.

Note

@pillo79 pillo79 changed the title Pr llext inspect api llext: use the new inspection API (continued) Feb 13, 2025
@pillo79 pillo79 force-pushed the pr-llext-inspect-api branch from 2606529 to 4c8d65c Compare February 13, 2025 10:04
@pillo79 pillo79 force-pushed the pr-llext-inspect-api branch 2 times, most recently from 54691e3 to 21dcc83 Compare February 13, 2025 15:51
llext_manager_load_module() and llext_manager_link() are only interested
in the llext_loader part of the llext_buf_loader structure. This patch
refactors the code to pass the llext_loader directly, making the code
more readable.

No functional change is intended.

Signed-off-by: Luca Burelli <[email protected]>
For inspection API to work, it is imperative to keep the LLEXT loader
object available. This patch adds the llext_buf_loader to module_data
structure and allocates it the first time the module is loaded.

Signed-off-by: Luca Burelli <[email protected]>
The function llext_unload was modifying a stack variable and not the
actual private member holding the reference. This could have lead to a
double free or invalid access to a freed llext structure.

Signed-off-by: Luca Burelli <[email protected]>
This updates the Zephyr revision to include the LLEXT inspection API.

Signed-off-by: Luca Burelli <[email protected]>
This patch converts the llext_manager to use the new LLEXT inspection
API. The new API allows to get information about sections and regions
without the need to access the internal structures of the LLEXT loader,
decoupling SOF and LLEXT code and making it easier to maintain.

Signed-off-by: Luca Burelli <[email protected]>
Add debugging code for comparing memory copy operations between previous
and current situations.

Signed-off-by: Luca Burelli <[email protected]>
@pillo79 pillo79 force-pushed the pr-llext-inspect-api branch from 21dcc83 to e625dcb Compare February 14, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant