Skip to content

Commit 6a58c34

Browse files
dcpleungcfriedt
authored andcommitted
tests: x86/pagetables: limit permission test under demand paging
When demand paging is enabled and not all generic sections are in physical memory at boot, only tests the permission up to the end of the pinned section. Signed-off-by: Daniel Leung <[email protected]>
1 parent 1203289 commit 6a58c34

File tree

1 file changed

+7
-1
lines changed
  • tests/arch/x86/pagetables/src

1 file changed

+7
-1
lines changed

tests/arch/x86/pagetables/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ void test_ram_perms(void)
8080

8181
pentry_t entry, flags, expected;
8282

83-
for (pos = Z_KERNEL_VIRT_START; pos < Z_KERNEL_VIRT_END;
83+
#ifdef CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
84+
const uint8_t *mem_range_end = Z_KERNEL_VIRT_END;
85+
#else
86+
const uint8_t *mem_range_end = (uint8_t *)lnkr_pinned_end;
87+
#endif /* CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT */
88+
89+
for (pos = Z_KERNEL_VIRT_START; pos < mem_range_end;
8490
pos += CONFIG_MMU_PAGE_SIZE) {
8591
if (pos == NULL) {
8692
/* We have another test specifically for NULL page */

0 commit comments

Comments
 (0)