Commit 36090bf4 authored by Jim Mattson's avatar Jim Mattson Committed by Paolo Bonzini

kvm: nVMX: Fix fault vector for VMX operation at CPL > 0

The fault that should be raised for a privilege level violation is #GP
rather than #UD.

Fixes: 727ba748 ("kvm: nVMX: Enforce cpl=0 for VMX instructions")
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent b9b33da2
...@@ -8096,7 +8096,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu) ...@@ -8096,7 +8096,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
/* CPL=0 must be checked manually. */ /* CPL=0 must be checked manually. */
if (vmx_get_cpl(vcpu)) { if (vmx_get_cpl(vcpu)) {
kvm_queue_exception(vcpu, UD_VECTOR); kvm_inject_gp(vcpu, 0);
return 1; return 1;
} }
...@@ -8160,7 +8160,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu) ...@@ -8160,7 +8160,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
static int nested_vmx_check_permission(struct kvm_vcpu *vcpu) static int nested_vmx_check_permission(struct kvm_vcpu *vcpu)
{ {
if (vmx_get_cpl(vcpu)) { if (vmx_get_cpl(vcpu)) {
kvm_queue_exception(vcpu, UD_VECTOR); kvm_inject_gp(vcpu, 0);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment