Skip to content

Commit 4fe875e

Browse files
committed
objtool, kprobes/x86: Sync the latest <asm/insn.h> header with tools/objtool/arch/x86/include/asm/insn.h
The following commit: ee6a735: kprobes/x86: Prohibit probing on exception masking instructions Modified <asm/insn.h>, adding the insn_masking_exception() function. Sync the tooling version of the header to it, to fix this warning: Warning: synced file at 'tools/objtool/arch/x86/include/asm/insn.h' differs from latest kernel version at 'arch/x86/include/asm/insn.h' Cc: Peter Zijlstra <peterz@infradead.org> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Cc: Francis Deslauriers <francis.deslauriers@efficios.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: Yonghong Song <yhs@fb.com> Cc: Borislav Petkov <bp@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: "David S . Miller" <davem@davemloft.net> Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent b1ae32d commit 4fe875e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

  • tools/objtool/arch/x86/include/asm

‎tools/objtool/arch/x86/include/asm/insn.h‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,22 @@ static inline int insn_offset_immediate(struct insn *insn)
208208
return insn_offset_displacement(insn) + insn->displacement.nbytes;
209209
}
210210

211+
#define POP_SS_OPCODE 0x1f
212+
#define MOV_SREG_OPCODE 0x8e
213+
214+
/*
215+
* Intel SDM Vol.3A 6.8.3 states;
216+
* "Any single-step trap that would be delivered following the MOV to SS
217+
* instruction or POP to SS instruction (because EFLAGS.TF is 1) is
218+
* suppressed."
219+
* This function returns true if @insn is MOV SS or POP SS. On these
220+
* instructions, single stepping is suppressed.
221+
*/
222+
static inline int insn_masking_exception(struct insn *insn)
223+
{
224+
return insn->opcode.bytes[0] == POP_SS_OPCODE ||
225+
(insn->opcode.bytes[0] == MOV_SREG_OPCODE &&
226+
X86_MODRM_REG(insn->modrm.bytes[0]) == 2);
227+
}
228+
211229
#endif /* _ASM_X86_INSN_H */

0 commit comments

Comments
 (0)