From 77554a09bbc1cd4efe37125fc0cea9ceddd1f00d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 27 Jan 2023 14:02:39 -0800 Subject: [PATCH] tests/x86/pagetables: Check pinned memory flags Add another clause in the test_ram_perms code to verify that any pinned regions have the correct flags. Signed-off-by: Keith Packard --- tests/arch/x86/pagetables/src/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/arch/x86/pagetables/src/main.c b/tests/arch/x86/pagetables/src/main.c index 1649680515f..aa3fde1fd9f 100644 --- a/tests/arch/x86/pagetables/src/main.c +++ b/tests/arch/x86/pagetables/src/main.c @@ -111,6 +111,11 @@ ZTEST(x86_pagetables, test_ram_perms) } else if (IN_REGION(__gcov_bss, pos)) { expected = MMU_P | MMU_RW | MMU_US | MMU_XD; #endif +#if defined(CONFIG_LINKER_USE_PINNED_SECTION) && \ + !defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) + } else if (IN_REGION(_app_smem_pinned, pos)) { + expected = MMU_P | MMU_RW | MMU_US | MMU_XD; +#endif #if !defined(CONFIG_X86_KPTI) && !defined(CONFIG_X86_COMMON_PAGE_TABLE) && \ defined(CONFIG_USERSPACE) } else if (IN_REGION(_app_smem, pos)) {