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

rimage: manifest: uuid: llext: Get loadable module UUID from uuid-registry and unify module manifest uuid type #9793

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

softwarecki
Copy link
Collaborator

rimage: Change the UUID storage type in the module manifest to a sof-compatible structure to enable retrieval of the UUIDs from the registry.
llext: Obtain the UUIDs of loadable modules from the uuid-registry.

BTW: The MICSEL module had an incorrect byte order in its uuid.

Change the type of the UUID parameter in the ipc4_get_drv function to avoid
unnecessary typecasting.

There are currently two ways to store UUIDs in SOF: as a byte array or
as a sof_uuid structure. The ipc4_get_drv function compares UUIDs using
the memcmp function, so it is not dependent on the type of the argument
passed.

This change is intended to prepare the code for standardizing the UUID
format across the project.

Signed-off-by: Adrian Warecki <[email protected]>
Change the uuid parameter type to void * in the parse_uuid function to make
it independent of the UUID type and avoid unnecessary type casting.

This change is intended to prepare the code for standardizing the UUID
format across the project.

Signed-off-by: Adrian Warecki <[email protected]>
Some identifiers are taken from the module manifest. Since the module
manifest structure (sof_man_module) is marked as packed, the pointer
to the sof_uuid structure may not be properly aligned.

Mark the sof_uuid structure as packed to avoid possible problems with
accessing fields of this structure from unaligned addresses.

Signed-off-by: Adrian Warecki <[email protected]>
Separate the SOF_REG_UUID macro to allow use it to initialize variables
with a value from the register.

Signed-off-by: Adrian Warecki <[email protected]>
Remove the reference to the first element of the array storing the uuid
to prepare the code for changing the uuid type from an array to a struct.

Signed-off-by: Adrian Warecki <[email protected]>
Add a & symbol for getting the address of a variable to prepare the code
for changing the uuid type from an array to a structure.

Signed-off-by: Adrian Warecki <[email protected]>
Change the UUID storage type in the module manifest to a sof-compatible
structure to enable retrieval of the UUIDs from the registry. Obtain the
UUIDs of loadable llext modules from the uuid-registry.

Signed-off-by: Adrian Warecki <[email protected]>
Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good and welcome change! Doing those UUIDs manually is a pain and error-prone! A bit "too late" should I say after I've converted almost all of them, but better late than never! :-) And it still seems to work after this change:

[ 1349.578565] <wrn> ipc: ipc4_get_drv: get_drv(): the provided UUID (b36ee4da-006f-47f9-a06d-fecbe2d8b6ce) can't be found!
[ 1349.583076] <inf> llext: llext_load: Loaded extension DRC

just would be good to rearrange a couple of changes, otherwise no objections!

@@ -998,13 +999,13 @@ const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id)
#endif
}
/* Check already registered components */
drv = ipc4_get_drv(mod->uuid);
drv = ipc4_get_drv(&mod->uuid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently .uuid in struct sof_man_module is an array, so yes, both these expressions generate the same result, and you probably want to change .uuid to a structure, which is why you need this change. But let's do that in that commit where you do it, not here.

@@ -641,7 +641,7 @@ int lib_manager_register_module(const uint32_t component_id)
}

mod = (struct sof_man_module *)((const uint8_t *)desc + SOF_MAN_MODULE_OFFSET(entry_index));
const struct sof_uuid *uid = (struct sof_uuid *)&mod->uuid[0];
const struct sof_uuid *uid = (struct sof_uuid *)&mod->uuid;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could move those two hunks to this commit as "preparation" or move all three changes to where you change to the structure

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.

4 participants