summaryrefslogtreecommitdiff
path: root/tools/perf/util/intel-pt-decoder/insn.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 03:12:50 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 03:12:50 +0300
commit7a1b4373791ade7e77f6ec9586acdb805331f672 (patch)
treefa72263bf115cd37c057f968227a698d5f697030 /tools/perf/util/intel-pt-decoder/insn.h
parent92400b8c8b42e53abb0fcb4ac75cb85d4177a891 (diff)
parent4e9ae0d3d5bf4e2f1b466ba451bd18f2c5b69845 (diff)
downloadlinux-7a1b4373791ade7e77f6ec9586acdb805331f672.tar.xz
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf tooling fixes from Ingo Molnar: "Leftover perf tooling fixes from the v4.17 cycle: they sync up updated ABI headers with their tooling versions" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf tools intel-pt-decoder: Update insn.h from the kernel sources tools headers: Sync x86 cpufeatures.h with the kernel sources tools headers: Synchronize prctl.h ABI header perf trace beauty prctl: Default header_dir to cwd to work without parms
Diffstat (limited to 'tools/perf/util/intel-pt-decoder/insn.h')
-rw-r--r--tools/perf/util/intel-pt-decoder/insn.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/intel-pt-decoder/insn.h b/tools/perf/util/intel-pt-decoder/insn.h
index e23578c7b1be..2669c9f748e4 100644
--- a/tools/perf/util/intel-pt-decoder/insn.h
+++ b/tools/perf/util/intel-pt-decoder/insn.h
@@ -208,4 +208,22 @@ static inline int insn_offset_immediate(struct insn *insn)
return insn_offset_displacement(insn) + insn->displacement.nbytes;
}
+#define POP_SS_OPCODE 0x1f
+#define MOV_SREG_OPCODE 0x8e
+
+/*
+ * Intel SDM Vol.3A 6.8.3 states;
+ * "Any single-step trap that would be delivered following the MOV to SS
+ * instruction or POP to SS instruction (because EFLAGS.TF is 1) is
+ * suppressed."
+ * This function returns true if @insn is MOV SS or POP SS. On these
+ * instructions, single stepping is suppressed.
+ */
+static inline int insn_masking_exception(struct insn *insn)
+{
+ return insn->opcode.bytes[0] == POP_SS_OPCODE ||
+ (insn->opcode.bytes[0] == MOV_SREG_OPCODE &&
+ X86_MODRM_REG(insn->modrm.bytes[0]) == 2);
+}
+
#endif /* _ASM_X86_INSN_H */