powerpc/kprobes: Warn if instruction patching failed
When arming and disarming probes, we currently assume that instruction patching can never fail, and don't have a mechanism to surface errors. Add a warning in case instruction patching ever fails. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/18d7b1309f938c08ce07738100932b551bdd3a52.1621416666.git.naveen.n.rao@linux.vnet.ibm.com
This commit is contained in:
Родитель
0566fa760d
Коммит
12b58492e6
|
@ -165,13 +165,13 @@ NOKPROBE_SYMBOL(arch_prepare_kprobe);
|
|||
|
||||
void arch_arm_kprobe(struct kprobe *p)
|
||||
{
|
||||
patch_instruction(p->addr, ppc_inst(BREAKPOINT_INSTRUCTION));
|
||||
WARN_ON_ONCE(patch_instruction(p->addr, ppc_inst(BREAKPOINT_INSTRUCTION)));
|
||||
}
|
||||
NOKPROBE_SYMBOL(arch_arm_kprobe);
|
||||
|
||||
void arch_disarm_kprobe(struct kprobe *p)
|
||||
{
|
||||
patch_instruction(p->addr, ppc_inst(p->opcode));
|
||||
WARN_ON_ONCE(patch_instruction(p->addr, ppc_inst(p->opcode)));
|
||||
}
|
||||
NOKPROBE_SYMBOL(arch_disarm_kprobe);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче