Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv/for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:

- Fix several bugs in the breakpoint trap handler

- Drop an unnecessary loop around calls to preempt_schedule_irq()

* tag 'riscv/for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
RISC-V: entry: Remove unneeded need_resched() loop
riscv: Correct the handling of unexpected ebreak in do_trap_break()
riscv: avoid sending a SIGTRAP to a user thread trapped in WARN()
riscv: avoid kernel hangs when trapped in BUG()

+8 -9
+1 -2
arch/riscv/kernel/entry.S
··· 273 273 resume_kernel: 274 274 REG_L s0, TASK_TI_PREEMPT_COUNT(tp) 275 275 bnez s0, restore_all 276 - need_resched: 277 276 REG_L s0, TASK_TI_FLAGS(tp) 278 277 andi s0, s0, _TIF_NEED_RESCHED 279 278 beqz s0, restore_all 280 279 call preempt_schedule_irq 281 - j need_resched 280 + j restore_all 282 281 #endif 283 282 284 283 work_pending:
+7 -7
arch/riscv/kernel/traps.c
··· 124 124 125 125 asmlinkage void do_trap_break(struct pt_regs *regs) 126 126 { 127 - #ifdef CONFIG_GENERIC_BUG 128 127 if (!user_mode(regs)) { 129 128 enum bug_trap_type type; 130 129 131 130 type = report_bug(regs->sepc, regs); 132 131 switch (type) { 133 - case BUG_TRAP_TYPE_NONE: 134 - break; 132 + #ifdef CONFIG_GENERIC_BUG 135 133 case BUG_TRAP_TYPE_WARN: 136 134 regs->sepc += get_break_insn_length(regs->sepc); 137 - break; 135 + return; 138 136 case BUG_TRAP_TYPE_BUG: 137 + #endif /* CONFIG_GENERIC_BUG */ 138 + default: 139 139 die(regs, "Kernel BUG"); 140 140 } 141 + } else { 142 + force_sig_fault(SIGTRAP, TRAP_BRKPT, 143 + (void __user *)(regs->sepc)); 141 144 } 142 - #endif /* CONFIG_GENERIC_BUG */ 143 - 144 - force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)(regs->sepc)); 145 145 } 146 146 147 147 #ifdef CONFIG_GENERIC_BUG