| Date | Mon, 10 Jun 2019 11:57:52 -0500 | From | Josh Poimboeuf <> | Subject | Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions |
| |
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 <bristot@redhat.com> > Cc: Nadav Amit <namit@vmware.com> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
-- Josh
|