Commit c3b6e0a
committed
lib_manager: Add cache writeback after library loading to IMR
Add dcache_writeback_region() calls after copying library data to IMR
(Isolated Memory Region) to ensure cache coherency in multicore
scenarios.
Without these cache operations, when Core 0 loads a library into IMR via
memcpy_s(), the data remains in Core 0's data cache and is not written
back to main memory. When Core 1 later tries to create a module from
this library, it reads uninitialized or stale data from IMR, causing
either:
- "Unsupported module API version" errors (reading garbage build info)
- Fatal PIF data errors and crashes (accessing corrupted module data)
The fix adds cache writeback operations at two critical points:
1. After copying the manifest (MAN_MAX_SIZE_V1_8 bytes)
2. After copying the entire library (preload_size bytes)
This ensures library data written by Core 0 is flushed from cache to IMR
memory before Core 1 attempts to read it, following the standard cache
coherency protocol for non-coherent Harvard architecture (Xtensa).
Fixes multicore topology crashes on Intel MTL, LNL, PTL, NVL platforms
when loading external libraries with modules instantiated on secondary
cores.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>1 parent 2e1dcfc commit c3b6e0a
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
932 | 935 | | |
933 | 936 | | |
934 | 937 | | |
| |||
937 | 940 | | |
938 | 941 | | |
939 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
940 | 946 | | |
941 | 947 | | |
942 | 948 | | |
| |||
0 commit comments