Skip to content

Commit 5d6a03e

Browse files
rnavmpe
authored andcommitted
powerpc/hw_breakpoint: Only disable hw breakpoint if cpu supports it
We get the below warning if we try to use kexec on P9: kexec_core: Starting new kernel WARNING: CPU: 0 PID: 1223 at arch/powerpc/kernel/process.c:826 __set_breakpoint+0xb4/0x140 [snip] NIP __set_breakpoint+0xb4/0x140 LR kexec_prepare_cpus_wait+0x58/0x150 Call Trace: 0xc0000000ee70fb20 (unreliable) 0xc0000000ee70fb20 default_machine_kexec+0x234/0x2c0 machine_kexec+0x84/0x90 kernel_kexec+0xd8/0xe0 SyS_reboot+0x214/0x2c0 system_call+0x58/0x6c This happens since we are trying to clear hw breakpoint on POWER9, though we don't have CPU_FTR_DAWR enabled. Guard __set_breakpoint() within hw_breakpoint_disable() with ppc_breakpoint_available() to address this. Fixes: 9654153 ("powerpc: Disable DAWR in the base POWER9 CPU features") Signed-off-by: Naveen N. Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 7a22d63 commit 5d6a03e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/powerpc/include/asm/hw_breakpoint.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ static inline void hw_breakpoint_disable(void)
8080
brk.address = 0;
8181
brk.type = 0;
8282
brk.len = 0;
83-
__set_breakpoint(&brk);
83+
if (ppc_breakpoint_available())
84+
__set_breakpoint(&brk);
8485
}
8586
extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);
8687
int hw_breakpoint_handler(struct die_args *args);

0 commit comments

Comments
 (0)