aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiran Alon <liran.alon@oracle.com>2019-09-29 10:50:18 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-10-22 07:31:20 -0400
commit1a8211c7d8717b19c1e9fa41d19fe6a55409765e (patch)
tree7296802a38806515dd867985207503e804c844d0
parentef4059809890f732c69cc1726d3a9a108a832a2f (diff)
KVM: VMX: Remove specialized handling of unexpected exit-reasons
Commit bf653b78f960 ("KVM: vmx: Introduce handle_unexpected_vmexit and handle WAITPKG vmexit") introduced specialized handling of specific exit-reasons that should not be raised by CPU because KVM configures VMCS such that they should never be raised. However, since commit 7396d337cfad ("KVM: x86: Return to userspace with internal error on unexpected exit reason"), VMX & SVM exit handlers were modified to generically handle all unexpected exit-reasons by returning to userspace with internal error. Therefore, there is no need for specialized handling of specific unexpected exit-reasons (This specialized handling also introduced inconsistency for these exit-reasons to silently skip guest instruction instead of return to userspace on internal-error). Fixes: bf653b78f960 ("KVM: vmx: Introduce handle_unexpected_vmexit and handle WAITPKG vmexit") Signed-off-by: Liran Alon <liran.alon@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx/vmx.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e7970a2e8eae..8f01019295a1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5543,14 +5543,6 @@ static int handle_encls(struct kvm_vcpu *vcpu)
5543 return 1; 5543 return 1;
5544} 5544}
5545 5545
5546static int handle_unexpected_vmexit(struct kvm_vcpu *vcpu)
5547{
5548 kvm_skip_emulated_instruction(vcpu);
5549 WARN_ONCE(1, "Unexpected VM-Exit Reason = 0x%x",
5550 vmcs_read32(VM_EXIT_REASON));
5551 return 1;
5552}
5553
5554/* 5546/*
5555 * The exit handlers return 1 if the exit was handled fully and guest execution 5547 * The exit handlers return 1 if the exit was handled fully and guest execution
5556 * may resume. Otherwise they set the kvm_run parameter to indicate what needs 5548 * may resume. Otherwise they set the kvm_run parameter to indicate what needs
@@ -5602,15 +5594,11 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu) = {
5602 [EXIT_REASON_INVVPID] = handle_vmx_instruction, 5594 [EXIT_REASON_INVVPID] = handle_vmx_instruction,
5603 [EXIT_REASON_RDRAND] = handle_invalid_op, 5595 [EXIT_REASON_RDRAND] = handle_invalid_op,
5604 [EXIT_REASON_RDSEED] = handle_invalid_op, 5596 [EXIT_REASON_RDSEED] = handle_invalid_op,
5605 [EXIT_REASON_XSAVES] = handle_unexpected_vmexit,
5606 [EXIT_REASON_XRSTORS] = handle_unexpected_vmexit,
5607 [EXIT_REASON_PML_FULL] = handle_pml_full, 5597 [EXIT_REASON_PML_FULL] = handle_pml_full,
5608 [EXIT_REASON_INVPCID] = handle_invpcid, 5598 [EXIT_REASON_INVPCID] = handle_invpcid,
5609 [EXIT_REASON_VMFUNC] = handle_vmx_instruction, 5599 [EXIT_REASON_VMFUNC] = handle_vmx_instruction,
5610 [EXIT_REASON_PREEMPTION_TIMER] = handle_preemption_timer, 5600 [EXIT_REASON_PREEMPTION_TIMER] = handle_preemption_timer,
5611 [EXIT_REASON_ENCLS] = handle_encls, 5601 [EXIT_REASON_ENCLS] = handle_encls,
5612 [EXIT_REASON_UMWAIT] = handle_unexpected_vmexit,
5613 [EXIT_REASON_TPAUSE] = handle_unexpected_vmexit,
5614}; 5602};
5615 5603
5616static const int kvm_vmx_max_exit_handlers = 5604static const int kvm_vmx_max_exit_handlers =