diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-12-14 15:49:54 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-04 13:27:37 +0300 |
commit | bbefd4fc8f590e765b455ef0a4deb6c105fee305 (patch) | |
tree | f40df0f620d38cc37fc487133c0bd5095a203155 /arch/x86/kvm/svm/svm.c | |
parent | fd238002616c5f1e44d9d8feed42580059eab87d (diff) | |
download | linux-bbefd4fc8f590e765b455ef0a4deb6c105fee305.tar.xz |
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/svm/svm.c')
-rw-r--r-- | arch/x86/kvm/svm/svm.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 30681633193e..fdea0994e94f 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -2357,11 +2357,8 @@ static int xsetbv_interception(struct vcpu_svm *svm) u64 new_bv = kvm_read_edx_eax(&svm->vcpu); u32 index = kvm_rcx_read(&svm->vcpu); - if (kvm_set_xcr(&svm->vcpu, index, new_bv) == 0) { - return kvm_skip_emulated_instruction(&svm->vcpu); - } - - return 1; + int err = kvm_set_xcr(&svm->vcpu, index, new_bv); + return kvm_complete_insn_gp(&svm->vcpu, err); } static int rdpru_interception(struct vcpu_svm *svm) |