diff mbox series

riscv: use KERN_INFO in do_trap

Message ID mvmh6ic1y75.fsf@suse.de (mailing list archive)
State Superseded
Headers show
Series riscv: use KERN_INFO in do_trap | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Andreas Schwab Feb. 13, 2024, 9:59 a.m. UTC
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(-)

Comments

Conor Dooley Feb. 14, 2024, 9:19 a.m. UTC | #1
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);
Andreas Schwab Feb. 14, 2024, 10:10 a.m. UTC | #2
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.
Conor Dooley Feb. 14, 2024, 10:34 a.m. UTC | #3
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.
diff mbox series

Patch

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