Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
LLEXT: don't reload upon resume#10028
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ee61ce1f8f3af991783f3c9810d82c369146a4e0f4e5ebed21ebde97File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -67,6 +67,7 @@ | ||
| #if CONFIG_LIBRARY_AUTH_SUPPORT | ||
| #include <sof/auth_api_iface.h> | ||
| #endif | ||
| #include <sof/list.h> | ||
| #define LIB_MANAGER_MAX_LIBS 16 | ||
| #define LIB_MANAGER_LIB_ID_SHIFT 12 | ||
| @@ -125,11 +126,8 @@ struct ext_library { | ||
| struct ipc_lib_msg *lib_notif_pool; | ||
| uint32_t lib_notif_count; | ||
| /* Only needed from SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE to SOF_IPC4_GLB_LOAD_LIBRARY */ | ||
| void *runtime_data; | ||
| #if CONFIG_LIBRARY_AUTH_SUPPORT | ||
lgirdwood marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| struct auth_api_ctx auth_ctx; | ||
| void *auth_buffer; | ||
| #endif | ||
| }; | ||
| /* lib manager context, used by lib_notification */ | ||
| @@ -187,6 +185,7 @@ int lib_manager_register_module(const uint32_t component_id); | ||
| const struct sof_man_fw_desc *lib_manager_get_library_manifest(int module_id); | ||
| struct processing_module; | ||
| struct comp_ipc_config; | ||
| /* | ||
| * \brief Allocate module | ||
| * | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,7 @@ | ||
| #include <sof/lib/mailbox.h> | ||
| #include <sof/lib/memory.h> | ||
| #include <sof/lib/pm_runtime.h> | ||
| #include <sof/llext_manager.h> | ||
| #include <sof/math/numbers.h> | ||
| #include <sof/tlv.h> | ||
| #include <sof/trace/trace.h> | ||
| @@ -1485,6 +1486,17 @@ __cold static int ipc4_module_process_dx(struct ipc4_message_request *ipc4) | ||
| return IPC4_BUSY; | ||
| } | ||
| #if !CONFIG_ADSP_IMR_CONTEXT_SAVE | ||
| ret = llext_manager_store_to_dram(); | ||
Collaborator 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. How does this play with full CONTEXT_SAVE feature? If full SRAM is saved, then this is redundant, right? CollaboratorAuthor 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. right, need to add that Member 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. any update here ? | ||
| if (ret < 0) | ||
| ipc_cmd_err(&ipc_tr, "Error %d saving LLEXT context. Resume might fail.", | ||
| ret); | ||
| #if CONFIG_L3_HEAP | ||
| l3_heap_save(); | ||
| #endif | ||
| #endif | ||
| #if defined(CONFIG_PM) | ||
| ipc_get()->task_mask |= IPC_TASK_POWERDOWN; | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -113,8 +113,12 @@ static int llext_manager_load_data_from_storage(const struct llext_loader *ldr, | ||
| const elf_shdr_t *shdr; | ||
| enum llext_mem s_region = LLEXT_MEM_COUNT; | ||
| size_t s_offset = 0; | ||
| int ret = llext_get_section_info(ldr, ext, i, &shdr, &s_region, &s_offset); | ||
lgirdwood marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| llext_get_section_info(ldr, ext, i, &shdr, &s_region, &s_offset); | ||
| if (ret < 0) { | ||
| tr_err(lib_manager_tr, "no section info: %d", ret); | ||
| continue; | ||
| } | ||
| /* skip sections not in the requested region */ | ||
| if (s_region != region) | ||
| @@ -528,7 +532,7 @@ static int llext_manager_link_single(uint32_t module_id, const struct sof_man_fw | ||
| sizeof(struct llext_buf_loader)); | ||
| if (!mctx->ebl) { | ||
| tr_err(&lib_manager_tr, "loader alloc failed"); | ||
| return 0; | ||
| return -ENOMEM; | ||
| } | ||
| uint8_t *dram_base = (uint8_t *)desc - SOF_MAN_ELF_TEXT_OFFSET; | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
why call it experimental? Perhaps LLEXT_SAVE_RESTORE makes better sense?
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.
@ranj063 we don't, Zephyr does. This option has recently been added to Zephyr to support our partial LLEXT restore, but the way how we added it there isn't perfectly clean. It's hardly usable by other LLEXT users, it's almost SOF-specific, therefore it's been decided to mark it "experimental" until a proper universal solution replaces it.