All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip v3 0/2] x86: kprobes: Prohibit kprobes on Xen/KVM emulate prefixes
@ 2019-09-06  1:45 ` Masami Hiramatsu
  0 siblings, 0 replies; 16+ messages in thread
From: Masami Hiramatsu @ 2019-09-06  1:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Josh Poimboeuf, Andrew Cooper, Peter Zijlstra, Randy Dunlap,
	Borislav Petkov, Juergen Gross, Boris Ostrovsky,
	Stefano Stabellini, x86, linux-kernel, xen-devel

Hi,

Here is the 3rd version of patches to handle Xen/KVM emulate
prefix by x86 instruction decoder.

These patches allow x86 instruction decoder to decode
Xen and KVM emulate prefix correctly, and prohibit kprobes to
probe on it.

Josh reported that the objtool can not decode such special
prefixed instructions, and I found that we also have to
prohibit kprobes to probe on such instruction.

This series can be applied on -tip master branch which
has merged Josh's objtool/perf sharing common x86 insn
decoder series.

In the 2nd version, I added KVM emulate prefix support and generalized
the interface. (insn_has_xen_prefix -> insn_has_emulate_prefix)
Also, I added insn.emulate_prefix_size for those prefixes because
that prefix is NOT an x86 instruction prefix, and the next instruction
of those emulate prefixes can have x86 instruction prefix. So we
can not use insn.prefix for it.

In this 3rd version, I just fixed tools/perf/check-headers.sh so
that it can ignore the difference of xen/prefix header path.

Thank you,

---

Masami Hiramatsu (2):
      x86: xen: insn: Decode Xen and KVM emulate-prefix signature
      x86: kprobes: Prohibit probing on instruction which has emulate prefix


 arch/x86/include/asm/insn.h             |    6 +++++
 arch/x86/include/asm/xen/interface.h    |    7 ++++--
 arch/x86/include/asm/xen/prefix.h       |   10 +++++++++
 arch/x86/kernel/kprobes/core.c          |    4 +++
 arch/x86/lib/insn.c                     |   36 +++++++++++++++++++++++++++++++
 tools/arch/x86/include/asm/insn.h       |    6 +++++
 tools/arch/x86/include/asm/xen/prefix.h |   10 +++++++++
 tools/arch/x86/lib/insn.c               |   36 +++++++++++++++++++++++++++++++
 tools/objtool/sync-check.sh             |    3 ++-
 tools/perf/check-headers.sh             |    2 +-
 10 files changed, 116 insertions(+), 4 deletions(-)
 create mode 100644 arch/x86/include/asm/xen/prefix.h
 create mode 100644 tools/arch/x86/include/asm/xen/prefix.h

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-09-06 10:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  1:45 [PATCH -tip v3 0/2] x86: kprobes: Prohibit kprobes on Xen/KVM emulate prefixes Masami Hiramatsu
2019-09-06  1:45 ` [Xen-devel] " Masami Hiramatsu
2019-09-06  1:45 ` [PATCH -tip v3 1/2] x86: xen: insn: Decode Xen and KVM emulate-prefix signature Masami Hiramatsu
2019-09-06  1:45   ` [Xen-devel] " Masami Hiramatsu
2019-09-06  7:34   ` Peter Zijlstra
2019-09-06  7:34     ` [Xen-devel] " Peter Zijlstra
2019-09-06  8:45     ` Masami Hiramatsu
2019-09-06  8:45       ` [Xen-devel] " Masami Hiramatsu
2019-09-06  8:51       ` Masami Hiramatsu
2019-09-06  8:51         ` [Xen-devel] " Masami Hiramatsu
2019-09-06  9:15         ` Peter Zijlstra
2019-09-06  9:15           ` [Xen-devel] " Peter Zijlstra
2019-09-06 10:28     ` Masami Hiramatsu
2019-09-06 10:28       ` [Xen-devel] " Masami Hiramatsu
2019-09-06  1:45 ` [PATCH -tip v3 2/2] x86: kprobes: Prohibit probing on instruction which has emulate prefix Masami Hiramatsu
2019-09-06  1:45   ` [Xen-devel] " Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.