From 2bc21ea4def0455b065cd132306417a9d3ed99a9 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Sun, 6 Sep 2020 10:55:35 -0700 Subject: [PATCH] x86: print more detail on non-present pagefaults The CPU sets the relevant bits on who tried to do what if the page wasn't present, print them. Signed-off-by: Andrew Boie --- arch/x86/core/fatal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/core/fatal.c b/arch/x86/core/fatal.c index 2d3c1068977..e650293cb8c 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -308,9 +308,10 @@ static void dump_page_fault(z_arch_esf_t *esf) if ((err & RSVD) != 0) { LOG_ERR("Reserved bits set in page tables"); - } else if ((err & PRESENT) == 0) { - LOG_ERR("Linear address not present in page tables"); } else { + if ((err & PRESENT) == 0) { + LOG_ERR("Linear address not present in page tables"); + } LOG_ERR("Access violation: %s thread not allowed to %s", (err & US) != 0U ? "user" : "supervisor", (err & ID) != 0U ? "execute" : ((err & WR) != 0U ?