linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops()
@ 2018-06-25 12:38 Dmitry Vyukov
  2018-06-25 15:03 ` Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dmitry Vyukov @ 2018-06-25 12:38 UTC (permalink / raw)
  To: tglx, mingo, x86, linux-kernel, sergey.senozhatsky.work; +Cc: Dmitry Vyukov

From: Dmitry Vyukov <dvyukov@google.com>

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.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>

---

Changes since v1:
 - use pr_alert() instead of printk(KERN_ALERT)
---
 arch/x86/mm/fault.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 9a84a0d08727..b9ceeaadde48 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -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);
 }
-- 
2.18.0.rc2.346.g013aa6912e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops()
  2018-06-25 12:38 [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops() Dmitry Vyukov
@ 2018-06-25 15:03 ` Joe Perches
  2018-06-26  7:29   ` Dmitry Vyukov
  2018-06-26  1:29 ` Sergey Senozhatsky
  2018-06-26 10:25 ` [tip:x86/urgent] x86/mm: Get " tip-bot for Dmitry Vyukov
  2 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2018-06-25 15:03 UTC (permalink / raw)
  To: Dmitry Vyukov, tglx, mingo, x86, linux-kernel, sergey.senozhatsky.work
  Cc: Dmitry Vyukov

On Mon, 2018-06-25 at 14:38 +0200, Dmitry Vyukov wrote:
> From: Dmitry Vyukov <dvyukov@google.com>
> 
> 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.
> 
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> 
> ---
> 
> Changes since v1:
>  - use pr_alert() instead of printk(KERN_ALERT)
> ---
>  arch/x86/mm/fault.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
[]
> @@ -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);

Perhaps remove the used-once KERN_CRIT uses of
nx_warning and smep_warning strings and maybe the
unnecessary parentheses and spaces used here too.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops()
  2018-06-25 12:38 [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops() Dmitry Vyukov
  2018-06-25 15:03 ` Joe Perches
@ 2018-06-26  1:29 ` Sergey Senozhatsky
  2018-06-26 10:25 ` [tip:x86/urgent] x86/mm: Get " tip-bot for Dmitry Vyukov
  2 siblings, 0 replies; 5+ messages in thread
From: Sergey Senozhatsky @ 2018-06-26  1:29 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: tglx, mingo, x86, linux-kernel, sergey.senozhatsky.work, Dmitry Vyukov

On (06/25/18 14:38), Dmitry Vyukov wrote:
> From: Dmitry Vyukov <dvyukov@google.com>
> 
> 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.
> 
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>

FWIW, looks good to me

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops()
  2018-06-25 15:03 ` Joe Perches
@ 2018-06-26  7:29   ` Dmitry Vyukov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Vyukov @ 2018-06-26  7:29 UTC (permalink / raw)
  To: Joe Perches
  Cc: Dmitry Vyukov, Thomas Gleixner, Ingo Molnar,
	the arch/x86 maintainers, LKML, Sergey Senozhatsky,
	Andy Shevchenko

On Mon, Jun 25, 2018 at 5:03 PM, Joe Perches <joe@perches.com> wrote:
> On Mon, 2018-06-25 at 14:38 +0200, Dmitry Vyukov wrote:
>> From: Dmitry Vyukov <dvyukov@google.com>
>>
>> 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.
>>
>> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
>>
>> ---
>>
>> Changes since v1:
>>  - use pr_alert() instead of printk(KERN_ALERT)
>> ---
>>  arch/x86/mm/fault.c | 10 +++-------
>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> []
>> @@ -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);
>
> Perhaps remove the used-once KERN_CRIT uses of
> nx_warning and smep_warning strings 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:x86/urgent] x86/mm: Get rid of KERN_CONT in show_fault_oops()
  2018-06-25 12:38 [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops() Dmitry Vyukov
  2018-06-25 15:03 ` Joe Perches
  2018-06-26  1:29 ` Sergey Senozhatsky
@ 2018-06-26 10:25 ` tip-bot for Dmitry Vyukov
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Dmitry Vyukov @ 2018-06-26 10:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, linux-kernel, sergey.senozhatsky, brgerst, peterz, hpa,
	luto, dvyukov, mingo, torvalds, jpoimboe, dvlasenk, bp

Commit-ID:  4188f063e3694ccbf2a2044cf17cc325f91e458f
Gitweb:     https://git.kernel.org/tip/4188f063e3694ccbf2a2044cf17cc325f91e458f
Author:     Dmitry Vyukov <dvyukov@google.com>
AuthorDate: Mon, 25 Jun 2018 14:38:08 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180625123808.227417-1-dvyukov@gmail.com
[ Removed unnecessary parentheses and prettified the printk statement. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/mm/fault.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 9a84a0d08727..ee85766e6329 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -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);
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-26 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25 12:38 [PATCH v2] arch/x86: get rid of KERN_CONT in show_fault_oops() Dmitry Vyukov
2018-06-25 15:03 ` Joe Perches
2018-06-26  7:29   ` Dmitry Vyukov
2018-06-26  1:29 ` Sergey Senozhatsky
2018-06-26 10:25 ` [tip:x86/urgent] x86/mm: Get " tip-bot for Dmitry Vyukov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).