diff --git a/tests/arch/x86/pagetables/src/main.c b/tests/arch/x86/pagetables/src/main.c index 3ca9f04f6a1..0c848a2458d 100644 --- a/tests/arch/x86/pagetables/src/main.c +++ b/tests/arch/x86/pagetables/src/main.c @@ -101,7 +101,8 @@ void test_ram_perms(void) expected = MMU_P | MMU_XD; } #endif /* CONFIG_X86_64 */ -#if !defined(CONFIG_X86_KPTI) && !defined(CONFIG_X86_COMMON_PAGE_TABLE) +#if !defined(CONFIG_X86_KPTI) && !defined(CONFIG_X86_COMMON_PAGE_TABLE) && \ + defined(CONFIG_USERSPACE) } else if (IN_REGION(_app_smem, pos)) { /* If KPTI is not enabled, then the default memory * domain affects our page tables even though we are @@ -155,11 +156,13 @@ void z_impl_dump_my_ptables(void) z_x86_dump_page_tables(z_x86_thread_page_tables_get(cur)); } +#ifdef CONFIG_USERSPACE void z_vrfy_dump_my_ptables(void) { z_impl_dump_my_ptables(); } #include +#endif /* CONFIG_USERSPACE */ /** * Dump kernel's page tables to console