arch/x86: get rid of KERN_CONT in show_fault_oops()
PATCH v2 1/1 arch/x86: get rid of KERN_CONT in show_fault_oops()
From: Dmitry Vyukov <[email protected]>
KERN_CONT leads to split lines in kernel output
and complicates useful changes to printk like
printing context before each line.
Only acceptable use of continuations is basically
boot-time testing.
Get rid of it.
---
Changes since v1:
- use pr_alert() instead of printk(KERN_ALERT)
--- arch/x86/mm/fault.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
arch/x86/mm/fault.c +3 -7
@@ -671,13 +671,9 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (smep_warning,from_kuid (&init_user_ns,current_uid ())); } -printk (KERN_ALERT "BUG: unable to handle kernel " ); -if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); -else -printk (KERN_CONT "paging request" ); - -printk (KERN_CONT " at %px\n" , (void *) address); +pr_alert ("BUG: unable to handle kernel %s at %px\n" , + (address <PAGE_SIZE ?"NULL pointer dereference" : +"paging request" ), (void *) address);dump_pagetable (address); }
Signature · 1 line
2.18.0.rc2.346.g013aa6912e-goog
arch/x86/mm/fault.c
Quoted 22 lines · Dmitry Vyukov
From: Dmitry Vyukov <[email protected]>
KERN_CONTleads to split lines in kernel output
and complicates useful changes to printk like
printing context before each line.Only acceptable use of continuations is basically
boot-time testing.Get rid of it.
Signed-off-by Dmitry Vyukov <[email protected]>---
Changes since v1:
- usepr_alert()instead ofprintk(KERN_ALERT)--- arch/x86/mm/fault.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)arch/x86/mm/fault.c +0
-0
[]
Quoted 4 lines
arch/x86/mm/fault.c +0
-0@@ -671,13 +671,9 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (smep_warning,from_kuid (&init_user_ns,current_uid ())); }
arch/x86/mm/fault.c show_fault_oops(struct pt_regs *regs, unsigned long error_code, · line 676
Quoted 10 lines
arch/x86/mm/fault.c +3
-7-printk (KERN_ALERT "BUG: unable to handle kernel " ); -if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); -else -printk (KERN_CONT "paging request" ); - -printk (KERN_CONT " at %px\n" , (void *) address); +pr_alert ("BUG: unable to handle kernel %s at %px\n" , + (address <PAGE_SIZE ?"NULL pointer dereference" : +"paging request" ), (void *) address);
Perhaps remove the used-once KERN_CRIT uses ofnx_warning and smep_warning strings and maybe the
unnecessary parentheses and spaces used here too.
Quoted 28 lines · Joe Perches
arch/x86/mm/fault.c
Quoted 22 lines · Dmitry Vyukov
From: Dmitry Vyukov <[email protected]>
KERN_CONTleads to split lines in kernel output
and complicates useful changes to printk like
printing context before each line.Only acceptable use of continuations is basically
boot-time testing.Get rid of it.
Signed-off-by Dmitry Vyukov <[email protected]>---
Changes since v1:
- usepr_alert()instead ofprintk(KERN_ALERT)--- arch/x86/mm/fault.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)arch/x86/mm/fault.c +0
-0[]
Quoted 4 lines
arch/x86/mm/fault.c +0
-0@@ -671,13 +671,9 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (smep_warning,from_kuid (&init_user_ns,current_uid ())); }
Quoted 14 lines
arch/x86/mm/fault.c show_fault_oops(struct pt_regs *regs, unsigned long error_code, · line 676
Quoted 10 lines
arch/x86/mm/fault.c +3
-7-printk (KERN_ALERT "BUG: unable to handle kernel " ); -if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); -else -printk (KERN_CONT "paging request" ); - -printk (KERN_CONT " at %px\n" , (void *) address); +pr_alert ("BUG: unable to handle kernel %s at %px\n" , + (address <PAGE_SIZE ?"NULL pointer dereference" : +"paging request" ), (void *) address);Perhaps remove the used-once
KERN_CRITuses ofnx_warningandsmep_warningstrings and maybe the
unnecessary parentheses and spaces used here too.
Mailed v3 with both changes.
Andy actually already pointed to parentheses in v1 but I forgot about it in v2.
Quoted 6 lines · Dmitry Vyukov
From: Dmitry Vyukov <[email protected]>
KERN_CONTleads to split lines in kernel output
and complicates useful changes to printk like
printing context before each line.
Quoted 6 lines
Only acceptable use of continuations is basically
boot-time testing.Get rid of it.
Signed-off-by Dmitry Vyukov <[email protected]>
FWIW, looks good to me
-ss
tip-bot for Dmitry Vyukov
merge bot[tip:x86/urgent] x86/mm: Get rid of KERN_CONT in show_fault_oops()
In reply to Dmitry Vyukovx86/mm: Get rid of KERN_CONT in show_fault_oops()
Commit-ID: 4188f063e3694ccbf2a2044cf17cc325f91e458f Gitweb: https://git.kernel.org/tip/4188f063e3694ccbf2a2044cf17cc325f91e458f Author: Dmitry Vyukov <[email protected]> AuthorDate: Mon, 25 Jun 2018 14:38:08 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 26 Jun 2018 09:00:25 +0200
x86/mm: Get rid of KERN_CONT in show_fault_oops()
KERN_CONT leads to split lines in kernel output
and complicates useful changes to printk like
printing context before each line.
Only acceptable use of continuations is basically
boot-time testing.
Get rid of it.
--- arch/x86/mm/fault.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
arch/x86/mm/fault.c +3 -7
@@ -671,13 +671,9 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code,printk (smep_warning,from_kuid (&init_user_ns,current_uid ())); } -printk (KERN_ALERT "BUG: unable to handle kernel " ); -if (address <PAGE_SIZE ) -printk (KERN_CONT "NULL pointer dereference" ); -else -printk (KERN_CONT "paging request" ); - -printk (KERN_CONT " at %px\n" , (void *) address); +pr_alert ("BUG: unable to handle kernel %s at %px\n" , + address <PAGE_SIZE ?"NULL pointer dereference" :"paging request" , + (void *)address);dump_pagetable (address); }