You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests: mem_protect/mem_map: fix mapped code execution test
The mapped code execution test uses the simple k_mem_phys_addr()
to do virtual to physical address translation. And this requires
the virtual address to be inside the kernel permanent mapping
(i.e. between __kernel_ram_start and __kernel_ram_end). With
demand paging, the translation is no longer static and it can be
mapped into any physical address. So a simple memory mapping
in the test would map an incorrect physical address which may
not even contain the said function. It has been working when
demand paging is not enabled is due to the custom sections is
immediately after the text section, so that the simple address
translation still works. But a custom linker script (i.e. board
config) may make that not true anymore.
So fix this by putting transplanted_function() into
snippets-text-sections.ld such that this would appear inside
.text section.
Signed-off-by: Daniel Leung <[email protected]>
0 commit comments