Skip to content

KVM: x86: Quirk "MWAIT never faults" behavior

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: x86: Add a quirk for KVM's "MONITOR/MWAIT are NOPs!" behaviorDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/include/uapi/asm/kvm.h +1 more+33 -100 replies
2/5KVM: selftests: Add x86-64 support for exception fixuptools/testing/selftests/kvm/include/x86_64/processor.h tools/testing/selftests/kvm/lib/x86_64/processor.c tools/testing/selftests/kvm/x86_64/kvm_pv_test.c+109 -640 replies
3/5KVM: selftests: Mostly fix comically broken Hyper-V Features testtools/testing/selftests/kvm/x86_64/hyperv_features.c+83 -630 replies
4/5KVM: selftests: Use exception fixup for #UD/#GP Hyper-V MSR/hcall teststools/testing/selftests/kvm/x86_64/hyperv_features.c+33 -840 replies
5/5KVM: selftests: Add MONITOR/MWAIT quirk testtools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/x86_64/monitor_mwait_test.c+129 -02 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/5] KVM: x86: Quirk "MWAIT never faults" behavior

Add a quirk to let userspace opt into correctly emulating MONITOR/MWAIT when they are disabled in CPUID instead of unconditionally treating them as NOPs.

The selftest changes are based on the CPUID overhaul[*], the KVM patch should apply cleanly on kvm/queue, commit 55371f1d0c01 ("...").

Note! Patch 3 is a fix for a bug in the Hyper-V Features test that I encountered when verifying the exception fixup works as expected. The "bug", which is in reality a rather large set of bugs, basically turns the test into a giant nop. The patch really should be "backported" all the way across the selftests overhaul, but I don't care enough about Hyper-V to spend yet more time on selftests at this point.

[*] https://lore.kernel.org/all/[email protected]

Sean Christopherson (5):
KVM: x86: Add a quirk for KVM's "MONITOR/MWAIT are NOPs!" behavior
KVM: selftests: Add x86-64 support for exception fixup
KVM: selftests: Mostly fix comically broken Hyper-V Features test
KVM: selftests: Use exception fixup for #UD/#GP Hyper-V MSR/hcall
tests
KVM: selftests: Add MONITOR/MWAIT quirk test

 Documentation/virt/kvm/api.rst                |  13 +
 arch/x86/include/asm/kvm_host.h               |   3 +-
 arch/x86/include/uapi/asm/kvm.h               |   1 +
 arch/x86/kvm/x86.c                            |  26 +-
 tools/testing/selftests/kvm/.gitignore        |   1 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../selftests/kvm/include/x86_64/processor.h  |  74 ++++++
 .../selftests/kvm/lib/x86_64/processor.c      |  17 ++
 .../selftests/kvm/x86_64/hyperv_features.c    | 239 ++++++++----------
 .../selftests/kvm/x86_64/kvm_pv_test.c        |  82 ++----
 .../selftests/kvm/x86_64/monitor_mwait_test.c | 127 ++++++++++
 11 files changed, 375 insertions(+), 209 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/monitor_mwait_test.c

base-commit: 081ad4bbae8d503c79fae45f463766d28b2f3241

Signature · 1 line
2.36.1.255.ge46751e96f-goog