summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm/svm.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-02-05 01:57:48 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-03-15 09:43:20 +0100
commitc483c45471b94f59c76cf45b676eb08318a9519a (patch)
treed956e60d4fbbc7c70ecd7fa9971cb53f2397c61f /arch/x86/kvm/svm/svm.c
parentKVM: x86: Move trivial instruction-based exit handlers to common code (diff)
downloadlinux-c483c45471b94f59c76cf45b676eb08318a9519a.tar.xz
linux-c483c45471b94f59c76cf45b676eb08318a9519a.zip
KVM: x86: Move RDPMC emulation to common code
Move the entirety of the accelerated RDPMC emulation to x86.c, and assign the common handler directly to the exit handler array for VMX. SVM has bizarre nrips behavior that prevents it from directly invoking the common handler. The nrips goofiness will be addressed in a future patch. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210205005750.3841462-8-seanjc@google.com> 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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 628844e6181c..cbb124b253f3 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2424,13 +2424,10 @@ static int rsm_interception(struct kvm_vcpu *vcpu)
static int rdpmc_interception(struct kvm_vcpu *vcpu)
{
- int err;
-
if (!nrips)
return emulate_on_interception(vcpu);
- err = kvm_rdpmc(vcpu);
- return kvm_complete_insn_gp(vcpu, err);
+ return kvm_emulate_rdpmc(vcpu);
}
static bool check_selective_cr0_intercepted(struct kvm_vcpu *vcpu,