Skip to content

KVM: x86: Fix LVTPC masking on AMD CPUs

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10KVM: x86: Snapshot if a vCPU's vendor model is AMD vs. Intel compatiblearch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c arch/x86/kvm/cpuid.h +2 more+14 -20 replies
2/10KVM: x86/pmu: Do not mask LVTPC when handling a PMI on AMD platformsarch/x86/kvm/lapic.c+2 -10 replies
3/10KVM: x86/pmu: Squash period for checkpointed events based on host HLE/RTMarch/x86/kvm/pmu.c+1 -10 replies
4/10KVM: x86: Apply Intel's TSC_AUX reserved-bit behavior to Intel compat vCPUsarch/x86/kvm/x86.c+4 -40 replies
5/10KVM: x86: Inhibit code #DBs in MOV-SS shadow for all Intel compat vCPUsarch/x86/kvm/x86.c+6 -80 replies
6/10KVM: x86: Use "is Intel compatible" helper to emulate SYSCALL in !64-bitarch/x86/kvm/emulate.c arch/x86/kvm/kvm_emulate.h arch/x86/kvm/x86.c+16 -360 replies
7/10KVM: SVM: Emulate SYSENTER RIP/RSP behavior for all Intel compat vCPUsarch/x86/kvm/cpuid.h arch/x86/kvm/svm/svm.c+7 -150 replies
8/10KVM: x86: Allow SYSENTER in Compatibility Mode for all Intel compat vCPUsarch/x86/kvm/emulate.c+6 -40 replies
9/10KVM: x86: Open code vendor_intel() in string_registers_quirk()arch/x86/kvm/emulate.c+8 -120 replies
10/10KVM: x86: Bury guest_cpuid_is_amd_or_hygon() in cpuid.carch/x86/kvm/cpuid.c arch/x86/kvm/cpuid.h+12 -100 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchJim Mattson
1/10
2/10R-b
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] KVM: x86: Fix LVTPC masking on AMD CPUs

This is kinda sorta v2 of Sandipan's fix for KVM's incorrect setting of the MASK bit when delivering PMIs through the LVTPC.

It's a bit rushed, as I want to get Sandipan's fix applied early next week so that it can make its way to Linus' tree for -rc4. And I didn't want to apply Sandipan's patch as-is, because I'm a little paranoid that the guest CPUID check could be noticeable slow, and it's easy to avoid.

My plan is to grab patches 1-2 for 6.9 asap, and let the rest simmer for much, much longer (they are *very* lightly tested).

As for why this looks wildy different than Sandipan's compat_vendor idea, when I started looking at KVM's various AMD vs. Intel checks, I realized it makes no sense to support an "unknown" vendor. KVM can't do *nothing*, and so practically speaking, an "unknown" vendor vCPU would actually end up with a weird mix of AMD *and* Intel behavior, not AMD *or* Intel behavior.

Sandipan Das (1):
KVM: x86/pmu: Do not mask LVTPC when handling a PMI on AMD platforms

Sean Christopherson (9):
KVM: x86: Snapshot if a vCPU's vendor model is AMD vs. Intel
compatible
KVM: x86/pmu: Squash period for checkpointed events based on host
HLE/RTM
KVM: x86: Apply Intel's TSC_AUX reserved-bit behavior to Intel compat
vCPUs
KVM: x86: Inhibit code #DBs in MOV-SS shadow for all Intel compat
vCPUs
KVM: x86: Use "is Intel compatible" helper to emulate SYSCALL in

    !64-bit

KVM: SVM: Emulate SYSENTER RIP/RSP behavior for all Intel compat vCPUs
KVM: x86: Allow SYSENTER in Compatibility Mode for all Intel compat
vCPUs
KVM: x86: Open code vendor_intel() in string_registers_quirk()
KVM: x86: Bury guest_cpuid_is_amd_or_hygon() in cpuid.c

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/cpuid.c            | 13 ++++++
 arch/x86/kvm/cpuid.h            | 16 ++------
 arch/x86/kvm/emulate.c          | 71 ++++++++++-----------------------
 arch/x86/kvm/kvm_emulate.h      |  1 +
 arch/x86/kvm/lapic.c            |  3 +-
 arch/x86/kvm/mmu/mmu.c          |  2 +-
 arch/x86/kvm/pmu.c              |  2 +-
 arch/x86/kvm/svm/svm.c          | 14 +++----
 arch/x86/kvm/x86.c              | 30 ++++++++------
 10 files changed, 68 insertions(+), 85 deletions(-)

base-commit: 8cb4a9a82b21623dbb4b3051dd30d98356cf95bc

Signature · 1 line
2.44.0.478.gd926399ef9-goog