-
Notifications
You must be signed in to change notification settings - Fork 369
[userspace LL] IPC part of #10945 #11137
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
Merged
+110
−96
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1490,6 +1490,7 @@ __cold static int ipc4_delete_module_instance(struct ipc4_message_request *ipc4) | |
| __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, | ||
| struct ipc_msg *reply) | ||
| { | ||
| const struct ipc4_module_init_instance *mi; | ||
| uint32_t type; | ||
| int ret; | ||
|
|
||
|
|
@@ -1500,24 +1501,21 @@ __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, | |
|
|
||
| switch (type) { | ||
| case SOF_IPC4_MOD_INIT_INSTANCE: | ||
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| { | ||
| BUILD_ASSERT(sizeof(struct comp_driver) + sizeof(struct tr_ctx) <= | ||
| sizeof(((struct ipc_user *)0)->init_drv_data), | ||
| "ipc_user.init_drv_data too small for driver copy"); | ||
|
|
||
| /* User-space init: kernel does driver lookup only (requires | ||
| * access to IMR manifest and driver list in kernel memory). | ||
| * Component creation (drv->ops.create) runs in user thread | ||
| * so untrusted module code does not execute in kernel context. | ||
| * Cross-core creation stays fully in kernel. | ||
| */ | ||
| const struct ipc4_module_init_instance *mi = | ||
| (const struct ipc4_module_init_instance *)ipc4; | ||
| mi = (const struct ipc4_module_init_instance *)ipc4; | ||
|
|
||
| if (!cpu_is_me(mi->extension.r.core_id)) { | ||
| ret = ipc4_init_module_instance(ipc4); | ||
| } else { | ||
| if (cpu_is_me(mi->extension.r.core_id) && !mi->extension.r.proc_domain && | ||
| IS_ENABLED(CONFIG_SOF_USERSPACE_LL)) { | ||
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
| BUILD_ASSERT(sizeof(struct comp_driver) + sizeof(struct tr_ctx) <= | ||
| sizeof(((struct ipc_user *)0)->init_drv_data), | ||
| "ipc_user.init_drv_data too small for driver copy"); | ||
|
|
||
| /* User-space init: kernel does driver lookup only (requires | ||
| * access to IMR manifest and driver list in kernel memory). | ||
| * Component creation (drv->ops.create) runs in user thread | ||
| * so untrusted module code does not execute in kernel context. | ||
| * Cross-core creation stays fully in kernel. | ||
| */ | ||
| struct ipc *ipc = ipc_get(); | ||
| uint32_t comp_id = IPC4_COMP_ID(mi->primary.r.module_id, | ||
| mi->primary.r.instance_id); | ||
|
|
@@ -1550,11 +1548,15 @@ __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, | |
|
|
||
| pdata->init_drv = drv; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not changed by this commit. Might need to revisit in the future. |
||
| ret = ipc_user_forward_cmd(ipc4->primary.dat, ipc4->extension.dat); | ||
| } | ||
| } | ||
| #else | ||
| ret = ipc4_init_module_instance(ipc4); | ||
| #endif | ||
| } else { | ||
| /* | ||
| * DP module creation starts running in kernel mode and | ||
| * switches to userspace later via a scheduler_dp_thread_ipc() | ||
| * call in module_init(). | ||
| */ | ||
| ret = ipc4_init_module_instance(ipc4); | ||
| } | ||
| break; | ||
| case SOF_IPC4_MOD_CONFIG_GET: | ||
| #ifdef CONFIG_SOF_USERSPACE_LL | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.