-
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
lib_manager: llext_manager: Add const to variables and function parameters cleanup #8898
Conversation
589c508
to
122e9c4
Compare
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.
Looks pretty good to me. One question inline on some of the interface changes, but nothing really major.
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.
LGTM, only minor updates needed and we are good to go.
122e9c4
to
730fc12
Compare
730fc12
to
82d63a6
Compare
the missing lib_manager_free_module()
instance got fixed, but component_id
still conflicts with the component API IMHO
Added a const modifier to the module manifest variable in the lib_manager_store_library function to prevent it from being accidentally modified. Signed-off-by: Adrian Warecki <[email protected]>
The preload_page_count value from the loadable library manifest is used to determine size of allocated memory buffer. If this value is smaller than the manifest size, it will lead to memory corruption. Signed-off-by: Adrian Warecki <[email protected]>
Removed pointer to a library manifest from the parameters list of the lib_manager_register_module function. Signed-off-by: Adrian Warecki <[email protected]>
Instead of a pointer to a component driver and ipc config, the lib_manager_free_module and llext_manager_free_module functions now gets component id. Signed-off-by: Adrian Warecki <[email protected]>
…nters To prevent unintentional modification of a loadable library manifest, a const modifier has been added to all variables pointing to it. Signed-off-by: Adrian Warecki <[email protected]>
Added a const modifier to the ipc_config parameter passed to functions lib_manager_allocate_module and llext_manager_allocate_module. Signed-off-by: Adrian Warecki <[email protected]>
Removed unused desc parameter from llext_manager_load_module and llext_manager_unload_module functions. Signed-off-by: Adrian Warecki <[email protected]>
82d63a6
to
5950a18
Compare
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.
In principle I like adding const
to pointers in general and to pointer function arguments in particular. But I think this has to be improved:
- I disagree with the "component ID" part
- in one location an existing function should be used instead of open-coding
- let's do that after we revert the
lib_manager_free_module()
as per bc79c69
@softwarecki ok, you're right: the revert only touches modules.c and this PR hardly touches it. Let me remove my "request for change" then, but I still stand by my other two comments. Besides, as of yesterday the QB seems to be broken, which would also fail this PR if you update it #8933 (comment) |
my main objection turned out to be invalid, the revert should still be possible on top of this PR
The DSP panic in https://sof-ci.01.org/sofpr/PR8898/build3297/devicetest/index.html?model=MTLP_SDW_AIOC&testcase=check-playback-10sec is a known fail and tracked in #8908 |
Added a const modifier to the module manifest variable in the lib_manager_store_library function to prevent it from being accidentally modified.
Added verification of preload_page_count from module manifest. The preload_page_count value from the loadable library manifest is used to determine size of allocated memory buffer. If this value is smaller than the manifest size, it will lead to memory corruption.
Removed pointer to a library manifest from the parameters list of the lib_manager_register_module function.
Instead of a pointer to a component driver and ipc config, the lib_manager_free_module and llext_manager_free_module functions now gets component id.
To prevent unintentional modification of a loadable library manifest, a const modifier has been added to all variables pointing to it.
Added a const modifier to the ipc_config parameter passed to functions lib_manager_allocate_module and llext_manager_allocate_module.
Removed unused desc parameter from llext_manager_load_module and llext_manager_unload_module functions.