Skip to content

KVM: x86: Fix Intel PT Host/Guest mode when host tracing also

Adrian Hunter kvm linux-kselftest linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: x86: Fix Intel PT IA32_RTIT_CTL MSR validationarch/x86/kvm/vmx/vmx.c+2 -10 replies
2/3KVM: x86: Fix Intel PT Host/Guest mode when host tracing alsoarch/x86/events/intel/pt.c arch/x86/events/intel/pt.h arch/x86/include/asm/intel_pt.h +2 more+147 -220 replies
3/3KVM: selftests: Add guest Intel PT testtools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/x86_64/intel_pt.c+383 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] KVM: x86: Fix Intel PT Host/Guest mode when host tracing also

Hi

There is a long-standing problem whereby running Intel PT on host and guest in Host/Guest mode, causes VM-Entry failure.

The motivation for this patch set is to provide a fix for stable kernels prior to the advent of the "Mediated Passthrough vPMU" patch set:

	https://lore.kernel.org/kvm/[email protected]/

which would render a large part of the fix unnecessary but likely not be suitable for backport to stable due to its size and complexity.

Ideally, this patch set would be applied before "Mediated Passthrough vPMU"

Note that the fix does not conflict with "Mediated Passthrough vPMU", it is just that "Mediated Passthrough vPMU" will make the code to stop and restart Intel PT unnecessary.

Adrian Hunter (3):
KVM: x86: Fix Intel PT IA32_RTIT_CTL MSR validation
KVM: x86: Fix Intel PT Host/Guest mode when host tracing also
KVM: selftests: Add guest Intel PT test

 arch/x86/events/intel/pt.c                         | 131 ++++++-
 arch/x86/events/intel/pt.h                         |  10 +
 arch/x86/include/asm/intel_pt.h                    |   4 +
 arch/x86/kvm/vmx/vmx.c                             |  26 +-
 arch/x86/kvm/vmx/vmx.h                             |   1 -
 tools/testing/selftests/kvm/Makefile               |   1 +
 .../selftests/kvm/include/x86_64/processor.h       |   1 +
 tools/testing/selftests/kvm/x86_64/intel_pt.c      | 381 +++++++++++++++++++++
 8 files changed, 532 insertions(+), 23 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/intel_pt.c

base-commit: d45aab436cf06544abeeffc607110f559a3af3b4

Regards
Adrian