Thread (2 messages) 2 messages, 2 authors, 2017-09-21

Re: powerpc/kprobes: Update optprobes to use emulate_update_regs()

From: Michael Ellerman <hidden>
Date: 2017-09-21 01:46:43

On Fri, 2017-09-15 at 10:08:21 UTC, "Naveen N. Rao" wrote:
Optprobes depended on an updated regs->nip from analyse_instr() to
identify the location to branch back from the optprobes trampoline.
However, since commit 3cdfcbfd32b9d ("powerpc: Change analyse_instr so
it doesn't modify *regs"), analyse_instr() doesn't update the registers
anymore.  Due to this, we end up branching back from the optprobes
trampoline to the same branch into the trampoline resulting in a loop.

Fix this by calling out to emulate_update_regs() before using the nip.
Additionally, explicitly compare the return value from analyse_instr()
to 1, rather than just checking for !0 so as to guard against any
future changes to analyse_instr() that may result in -1 being returned
in more scenarios.

Fixes: 3cdfcbfd32b9d ("powerpc: Change analyse_instr so it doesn't modify *regs")
Signed-off-by: Naveen N. Rao <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/8afafa6fba7809c0785018b77c95b1

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help