linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: use KERN_INFO in do_trap
@ 2024-02-13  9:59 Andreas Schwab
  2024-02-14  9:19 ` Conor Dooley
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2024-02-13  9:59 UTC (permalink / raw)
  To: linux-riscv
  Cc: Palmer Dabbelt, Yunhui Cui, Björn Töpel, linux-kernel

Print the instruction dump with info instead of emergency level like the
rest of the output when printing the information for an unhandled signal.

Fixes: b8a03a634129 ("riscv: add userland instruction dump to RISC-V splats")
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 arch/riscv/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index a1b9be3c4332..142f5f5168fb 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -121,7 +121,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
 		print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
 		pr_cont("\n");
 		__show_regs(regs);
-		dump_instr(KERN_EMERG, regs);
+		dump_instr(KERN_INFO, regs);
 	}
 
 	force_sig_fault(signo, code, (void __user *)addr);
-- 
2.43.1


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] riscv: use KERN_INFO in do_trap
  2024-02-13  9:59 [PATCH] riscv: use KERN_INFO in do_trap Andreas Schwab
@ 2024-02-14  9:19 ` Conor Dooley
  2024-02-14 10:10   ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2024-02-14  9:19 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: linux-riscv, Palmer Dabbelt, Yunhui Cui, Björn Töpel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]

On Tue, Feb 13, 2024 at 10:59:58AM +0100, Andreas Schwab wrote:
> Print the instruction dump with info instead of emergency level like the
> rest of the output when printing the information for an unhandled signal.

I'm not entirely sure that this is true, __show_regs() prints with
KERN_DEFAULT, but this certainly is more consistent than it was before.
Dumping at EMERG doesn't make sense to me though, so
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  arch/riscv/kernel/traps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index a1b9be3c4332..142f5f5168fb 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -121,7 +121,7 @@ void do_trap(struct pt_regs *regs, int signo, int code, unsigned long addr)
>  		print_vma_addr(KERN_CONT " in ", instruction_pointer(regs));
>  		pr_cont("\n");
>  		__show_regs(regs);
> -		dump_instr(KERN_EMERG, regs);
> +		dump_instr(KERN_INFO, regs);
>  	}
>  
>  	force_sig_fault(signo, code, (void __user *)addr);


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] riscv: use KERN_INFO in do_trap
  2024-02-14  9:19 ` Conor Dooley
@ 2024-02-14 10:10   ` Andreas Schwab
  2024-02-14 10:34     ` Conor Dooley
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2024-02-14 10:10 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, Palmer Dabbelt, Yunhui Cui, Björn Töpel,
	linux-kernel

On Feb 14 2024, Conor Dooley wrote:

> On Tue, Feb 13, 2024 at 10:59:58AM +0100, Andreas Schwab wrote:
>> Print the instruction dump with info instead of emergency level like the
>> rest of the output when printing the information for an unhandled signal.
>
> I'm not entirely sure that this is true, __show_regs() prints with
> KERN_DEFAULT, but this certainly is more consistent than it was before.

The first line is printed with pr_info.  Perhaps __show_regs should gain
a level argument.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH] riscv: use KERN_INFO in do_trap
  2024-02-14 10:10   ` Andreas Schwab
@ 2024-02-14 10:34     ` Conor Dooley
  0 siblings, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2024-02-14 10:34 UTC (permalink / raw)
  To: Andreas Schwab, Conor Dooley
  Cc: linux-riscv, Palmer Dabbelt, Yunhui Cui, Björn Töpel,
	linux-kernel

On 14/02/2024 10:10, Andreas Schwab wrote:
> On Feb 14 2024, Conor Dooley wrote:
> 
>> On Tue, Feb 13, 2024 at 10:59:58AM +0100, Andreas Schwab wrote:
>>> Print the instruction dump with info instead of emergency level like the
>>> rest of the output when printing the information for an unhandled signal.
>>
>> I'm not entirely sure that this is true, __show_regs() prints with
>> KERN_DEFAULT, but this certainly is more consistent than it was before.
> 
> The first line is printed with pr_info.

Yah, that's what I meant with "more consistent" :)

> Perhaps __show_regs should gain
> a level argument.

I wouldn't be averse. There's 3 users, of which one is show_regs().
I think we could easily add an argument that sets the printk level
to match the other outputs from the non show_regs() callers. I
suppose show_regs() could retain the KERN_DEFAULT behaviour unless
you've got a better idea.


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

end of thread, other threads:[~2024-02-14 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13  9:59 [PATCH] riscv: use KERN_INFO in do_trap Andreas Schwab
2024-02-14  9:19 ` Conor Dooley
2024-02-14 10:10   ` Andreas Schwab
2024-02-14 10:34     ` Conor Dooley

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).