summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-12-14 13:49:54 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-02-04 11:27:37 +0100
commitbbefd4fc8f590e765b455ef0a4deb6c105fee305 (patch)
treef40df0f620d38cc37fc487133c0bd5095a203155 /arch/x86/kvm/vmx
parentKVM: cleanup DR6/DR7 reserved bits checks (diff)
downloadlinux-bbefd4fc8f590e765b455ef0a4deb6c105fee305.tar.xz
linux-bbefd4fc8f590e765b455ef0a4deb6c105fee305.zip
KVM: x86: move kvm_inject_gp up from kvm_set_xcr to callers
Push the injection of #GP up to the callers, so that they can just use kvm_complete_insn_gp. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx')
-rw-r--r--arch/x86/kvm/vmx/vmx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 0cd24ae2db08..d995f47a08ef 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5223,9 +5223,8 @@ static int handle_xsetbv(struct kvm_vcpu *vcpu)
u64 new_bv = kvm_read_edx_eax(vcpu);
u32 index = kvm_rcx_read(vcpu);
- if (kvm_set_xcr(vcpu, index, new_bv) == 0)
- return kvm_skip_emulated_instruction(vcpu);
- return 1;
+ int err = kvm_set_xcr(vcpu, index, new_bv);
+ return kvm_complete_insn_gp(vcpu, err);
}
static int handle_apic_access(struct kvm_vcpu *vcpu)