x86/alternatives: Teach text_poke_bp() to emulate RET
Future patches will need to poke a RET instruction, provide the infrastructure required for this. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20200818135804.982214828@infradead.org
This commit is contained in:

committed by
Ingo Molnar

parent
f03c412915
commit
c43a43e439
@@ -1103,6 +1103,10 @@ noinstr int poke_int3_handler(struct pt_regs *regs)
|
||||
*/
|
||||
goto out_put;
|
||||
|
||||
case RET_INSN_OPCODE:
|
||||
int3_emulate_ret(regs);
|
||||
break;
|
||||
|
||||
case CALL_INSN_OPCODE:
|
||||
int3_emulate_call(regs, (long)ip + tp->rel32);
|
||||
break;
|
||||
@@ -1277,6 +1281,7 @@ static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,
|
||||
|
||||
switch (tp->opcode) {
|
||||
case INT3_INSN_OPCODE:
|
||||
case RET_INSN_OPCODE:
|
||||
break;
|
||||
|
||||
case CALL_INSN_OPCODE:
|
||||
|
Reference in New Issue
Block a user