Skip to content

KVM: VMX: Fix and test for emulation + exception

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 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: VMX: Reject KVM_RUN if emulation is required with pending exceptionarch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/svm.c +2 more+37 -50 replies
2/2KVM: selftests: Add a test to force emulation with a pending exceptiontools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/x86_64/vmx_exception_with_invalid_guest_state.c+141 -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/2] KVM: VMX: Fix and test for emulation + exception

Fix an issue that allows userspace to trigger a WARN by rejecting KVM_RUN if userspace attempts to run a vCPU that require emulation in KVM and has a pending exception, which is not supported in KVM.

No small part of me thinks this is a waste of code and that we'd be better off just deleting the WARN. But it's also not hard to fix and there are still folks out there that run on Core2...

Intentionally didn't tag for stable. I highly doubt this actually fixes anything for anyone, the goal is purely to prevent userspace from triggering the WARN.

Sean Christopherson (2):
KVM: VMX: Reject KVM_RUN if emulation is required with pending
exception
KVM: selftests: Add a test to force emulation with a pending exception

 arch/x86/include/asm/kvm-x86-ops.h            |   1 +
 arch/x86/include/asm/kvm_host.h               |   1 +
 arch/x86/kvm/svm/svm.c                        |   6 +
 arch/x86/kvm/vmx/vmx.c                        |  22 ++-
 arch/x86/kvm/x86.c                            |  12 +-
 tools/testing/selftests/kvm/.gitignore        |   1 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../vmx_exception_with_invalid_guest_state.c  | 139 ++++++++++++++++++
 8 files changed, 178 insertions(+), 5 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/vmx_exception_with_invalid_guest_state.c
Signature · 1 line
2.34.1.448.ga2b2bfdf31-goog