Skip to contentSkip to conversation

arm64: mm: add message to die() in die_kernel_fault()

PATCH In review Yue Hu 2 participants 3 messages Jul 30, 2020 arm64

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

PATCH 1/1 arm64: mm: add message to die() in die_kernel_fault()

From: Yue Hu <[email protected]>

Just to identify the kernel fault more clearly.

---
 arch/arm64/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/fault.c +1 -1
index 8afb238..3a753c7 100644
@@ -289,7 +289,7 @@ static void die_kernel_fault(const char *msg, unsigned long addr,
 	mem_abort_decode(esr);
 
 	show_pte(addr);
-	die("Oops", regs, esr);
+	die("Oops - Page fault", regs, esr);
 	bust_spinlocks(0);
 	do_exit(SIGKILL);
 }
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 14 lines · Yue Hu

From: Yue Hu <[email protected]>

Just to identify the kernel fault more clearly.

---
 arch/arm64/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/fault.c +0 -0
index 8afb238..3a753c7 100644

arch/arm64/mm/fault.c static void die_kernel_fault(const char *msg, unsigned long addr, · line 295

Quoted 8 lines
arch/arm64/mm/fault.c +1 -1
@@ -289,7 +289,7 @@ static void die_kernel_fault(const char *msg, unsigned long addr,
 	mem_abort_decode(esr);
 
 	show_pte(addr);
-	die("Oops", regs, esr);
+	die("Oops - Page fault", regs, esr);
 	bust_spinlocks(0);
 	do_exit(SIGKILL);
 }

Don't we already print enough information prior to die()?

Signature · 1 line
Catalin
author
#2 lore raw
Quoted 17 lines · On Thu, 30 Jul 2020 13:27:23 +0100 Catalin Marinas <[email protected]>…
Quoted 16 lines · Yue Hu

From: Yue Hu <[email protected]>

Just to identify the kernel fault more clearly.

---
 arch/arm64/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/fault.c +0 -0
index 8afb238..3a753c7 100644
@@ -289,7 +289,7 @@ static void die_kernel_fault(const char *msg, unsigned long addr,
 	mem_abort_decode(esr);
 
Quoted 9 lines

arch/arm64/mm/fault.c static void die_kernel_fault(const char *msg, unsigned long addr, · line 295

Quoted 6 lines
arch/arm64/mm/fault.c +1 -1
 	show_pte(addr);
-	die("Oops", regs, esr);
+	die("Oops - Page fault", regs, esr);
 	bust_spinlocks(0);
 	do_exit(SIGKILL);
 }  

Don't we already print enough information prior to die()?

Yes, we have. But "Oops" is a little common. Add specific message is just to avoid to use it repeatedly by other callers just like die("Oops - BUG",,), die("Oops - KASAN",,).

Moreover, die() will call panic() if require, panic() does not know which oops it is. We can let panic() know it for debug expansibility such as store the panic message to reserved memory.