From 35ec07dfe02489e9f8b7039319ed64f020b8c86a Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Wed, 16 Dec 2020 20:08:26 -0800 Subject: [PATCH] tests: x86: pagetables: pass if userspace disabled _app_smem doesn't exist in this case. Signed-off-by: Andrew Boie --- tests/arch/x86/pagetables/src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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