On Wed, Jun 05, 2019 at 03:08:01PM +0200, Peter Zijlstra wrote: > In preparation for static_call support, teach text_poke_bp() to > emulate instructions, including CALL. > > The current text_poke_bp() takes a @handler argument which is used as > a jump target when the temporary INT3 is hit by a different CPU. > > When patching CALL instructions, this doesn't work because we'd miss > the PUSH of the return address. Instead, teach poke_int3_handler() to > emulate an instruction, typically the instruction we're patching in. > > This fits almost all text_poke_bp() users, except > arch_unoptimize_kprobe() which restores random text, and for that site > we have to build an explicit emulate instruction. > > Cc: Daniel Bristot de Oliveira <bris...@redhat.com> > Cc: Nadav Amit <na...@vmware.com> > Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
Reviewed-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh