-
Notifications
You must be signed in to change notification settings - Fork 73
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
developer-guide: add LLEXT module documentation #493
Conversation
Installation | ||
************ | ||
|
||
As described in :ref:`intel_debug_introduction` the |SOF| Linux kernel driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I missed something that page does not really "describe" anything; it merely gives a /lib/firmware location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb wording updated
************ | ||
|
||
As described in :ref:`intel_debug_introduction` the |SOF| Linux kernel driver | ||
loads SOF modules, using their UUIDs. For SOF internal modules the process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "using their UUIDs" mean? How does the kernel know which modules to load and which not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb Topology specifies UUIDs, the kernel driver also parses the base firmware manifest to see which UUIDs are built-in. For any, that are specified in topology but aren't available in the base firmware, an attempt will be made to load them dynamically. But this is generic SOF architecture information, not LLEXT specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think I found it at _apps-component-overview
, please add a link to that.
Earlier you mentioned that a single LLEXT file can have multiple modules, in that case which UUID is used for its filename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier you mentioned that a single LLEXT file can have multiple modules, in that case which UUID is used for its filename?
@marc-hb none. Filenames are created from a common name: "eq_iir," "mixin_mixout," etc. UUIDs are soft links to those files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "all of them"? As in:
UUID1.bin -> module1and2combined.llext
UUID2.bin -> module1and2combined.llext
A TOML configuration file is needed for building of LLEXT modules too. It is | ||
generated by the C preprocessor at build time from the same components, as would | ||
be used for a monolithic build. A small additional file to bring components | ||
together is needed too, similar to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"A small additional file to bring components together" is not decriptive; very vague. Having an example is great but it's not a substitute for a description.
With that in place, it is also possible to switch between monolithic and modular | ||
builds by specifying the module as "tristate" in its Kconfig and selecting "m" | ||
for modular builds, however, for modules, exclusively built as LLEXT objects, | ||
this might not be necessary. Thus it is possible to implement third party Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "not necessary" you mean "not possible"? As in "exclusively". I think I'm guessing what you mean but this is confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb no, I didn't mean that. I don't know if anybody would want to write modules that they never need to build into the actual SOF image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused sorry. I guess I don't understand what is a "module exclusively built as LLEXT object". Sounds like you select "monolithic" but that is ignored by some modules? Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb no, that isn't what I meant. I just meant, that if you're sure to only build your code as a loadable LLEXT module, it doesn't matter what you do in your Kconfig, you can just hard fix it to always build as a module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have no idea how you "hard fix" the build-as-module and how the Kconfig gets ignored in that case (which is confusing?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marc-hb this is what I currently use to switch to building a loadable module: https://github.com/thesofproject/sof/blob/fdb67ee782808f6d5488a53441cdecd75f458677/zephyr/CMakeLists.txt#L874 If you only ever build your code as such, you don't need that if
, you use that code unconditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/thesofproject/sof/blob/fdb67ee782808f6d5488a53441cdecd75f458677/zephyr/CMakeLists.txt#L874 seems to build a totally distinct .c file depending on whether the user selects "module" or "built-in". This looks... wrong: unexpected and very confusing. Is this what this section tries to allude to?
If something can only be built as a module, IMHO then the build should fail when the user selects "built-in". It should not silently switch to a different .c file :-(
Adapter drivers, that would be built exclusively as loadable modules. | ||
|
||
Note, that a single LLEXT object file can also contain multiple Module Adapter | ||
modules. In that case an array of ``struct sof_module_api_build_info`` objects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is EXPORT_SYMBOL() required between these? Or is that not supported yet?
This "multiple modules inside one module" does not look like a "note", more like a key design aspect. It should be moved near the top of this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is EXPORT_SYMBOL() required between these? Or is that not supported yet?
no, that isn't needed. It's a single ELF image.
************ | ||
|
||
As described in :ref:`intel_debug_introduction` the |SOF| Linux kernel driver | ||
loads SOF modules, using their UUIDs. For SOF internal modules the process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think I found it at _apps-component-overview
, please add a link to that.
Earlier you mentioned that a single LLEXT file can have multiple modules, in that case which UUID is used for its filename?
@marc-hb Are you satisfied with the updates? |
@marc-hb ping |
With that in place, it is also possible to switch between monolithic and modular | ||
builds by specifying the module as "tristate" in its Kconfig and selecting "m" | ||
for modular builds, however, for modules, exclusively built as LLEXT objects, | ||
this might not be necessary. Thus it is possible to implement third party Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/thesofproject/sof/blob/fdb67ee782808f6d5488a53441cdecd75f458677/zephyr/CMakeLists.txt#L874 seems to build a totally distinct .c file depending on whether the user selects "module" or "built-in". This looks... wrong: unexpected and very confusing. Is this what this section tries to allude to?
If something can only be built as a module, IMHO then the build should fail when the user selects "built-in". It should not silently switch to a different .c file :-(
|
||
As specified in | ||
:ref:`Firmware look-up paths per Intel platform <intel_firmware_paths>` | ||
the |SOF| Linux kernel driver loads SOF modules, using their UUIDs. For SOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the |SOF| Linux kernel driver loads SOF modules, using their UUIDs. For SOF | |
the |SOF| Linux kernel driver loads SOF modules with UUIDs specified in the topology. For SOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention briefly that UUIDs.bin are symbolic links and that several of them can point to the same LLEXT file. Again, a link to _apps-component-overview
would probably be good.
As specified in | ||
:ref:`Firmware look-up paths per Intel platform <intel_firmware_paths>` | ||
the |SOF| Linux kernel driver loads SOF modules, using their UUIDs. For SOF | ||
internal modules the process of creation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "internal" mean? Available in https://github.com/thesofproject/sof I'm guessing?
In the context of SOF, "internal" usually means "not open-source".
Suggest: "for modules in the main SOF repo"
As explained above, LLEXT modules in general look very similar to native SOF | ||
code, with the only restriction of having no access to not-exported symbols. If | ||
any such symbols are needed to LLEXT modules, additionally exporting them can be | ||
considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this last sentence sorry, what does "additionally" mean?
I can't decide whether this sentence is merely repeating that modules can only access exported symbols (in which case it should be dropped), or too briefly alluding to some other, more complex development question.
|
||
A TOML configuration file is needed for building of LLEXT modules too. It is | ||
generated by the C preprocessor at build time from the same components, as would | ||
be used for a monolithic build. For this preprocessor run a small header file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a "English comma expert" but I really struggled to parse this sentence (also because run
is both a noun and a verb). I think this is what it means:
be used for a monolithic build. For this preprocessor run a small header file, | |
be used for a monolithic build. For this preprocessor run, a small header file that ... |
Describe LLEXT loadable module support in SOF. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Describe LLEXT loadable module support in SOF.