Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_LLEXT_EXPERIMENTAL=y

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Collaborator Author

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.

CONFIG_MODULES=y
CONFIG_TIMING_FUNCTIONS=y
CONFIG_WATCHDOG=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ CONFIG_COUNTER=y
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_LLEXT_EXPERIMENTAL=y
CONFIG_MODULES=y
CONFIG_TIMING_FUNCTIONS=y

Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace30_ptl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_L3_HEAP=y
CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_LLEXT_EXPERIMENTAL=y
CONFIG_MODULES=y

# Zephyr / device drivers
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace30_wcl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_L3_HEAP=y
CONFIG_LLEXT=y
CONFIG_LLEXT_STORAGE_WRITABLE=y
CONFIG_LLEXT_EXPERIMENTAL=y
CONFIG_MODULES=y

# Zephyr / device drivers
Expand Down
2 changes: 2 additions & 0 deletions src/include/ipc4/notification.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ enum sof_ipc4_resource_type {
(((SOF_IPC4_NOTIFY_FW_READY) << (SOF_IPC4_GLB_NOTIFY_TYPE_SHIFT)) |\
((SOF_IPC4_GLB_NOTIFICATION) << (SOF_IPC4_GLB_NOTIFY_MSG_TYPE_SHIFT)))

#define SOF_IPC4_FW_READY_LIB_RESTORED BIT(15)

#define SOF_IPC4_NOTIF_HEADER(notif_type) \
((notif_type) << (SOF_IPC4_GLB_NOTIFY_TYPE_SHIFT) | \
((SOF_IPC4_GLB_NOTIFICATION) << (SOF_IPC4_GLB_NOTIFY_MSG_TYPE_SHIFT)))
Expand Down
8 changes: 8 additions & 0 deletions src/include/sof/llext_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ bool comp_is_llext(struct comp_dev *comp);
#define comp_is_llext(comp) false
#endif

#if CONFIG_LLEXT_EXPERIMENTAL && !CONFIG_ADSP_IMR_CONTEXT_SAVE
int llext_manager_store_to_dram(void);
int llext_manager_restore_from_dram(void);
#else
#define llext_manager_store_to_dram() 0
#define llext_manager_restore_from_dram() -ENOSYS
#endif

#endif
12 changes: 12 additions & 0 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

right, need to add that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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
Expand Down
3 changes: 3 additions & 0 deletions src/library_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ if(CONFIG_LIBRARY_MANAGER)

if (CONFIG_MM_DRV AND CONFIG_LLEXT)
add_local_sources(sof llext_manager.c)
if(CONFIG_LLEXT_EXPERIMENTAL AND NOT CONFIG_ADSP_IMR_CONTEXT_SAVE)
add_local_sources_ifdef(CONFIG_L3_HEAP sof llext_manager_dram.c)
endif()
endif()
endif()
Loading
Loading