]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: SVM: Skip intercepted PAUSE instructions after emulation
authorSean Christopherson <seanjc@google.com>
Fri, 5 Feb 2021 00:57:50 +0000 (16:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Feb 2021 13:36:06 +0000 (08:36 -0500)
Skip PAUSE after interception to avoid unnecessarily re-executing the
instruction in the guest, e.g. after regaining control post-yield.
This is a benign bug as KVM disables PAUSE interception if filtering is
off, including the case where pause_filter_count is set to zero.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210205005750.3841462-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c

index 3725a46369300f887e07052e9e81362befaf3ecc..1c62d3ec7e5358c2804a41b3f652a9ecb3c18b01 100644 (file)
@@ -2982,7 +2982,7 @@ static int pause_interception(struct kvm_vcpu *vcpu)
                grow_ple_window(vcpu);
 
        kvm_vcpu_on_spin(vcpu, in_kernel);
-       return 1;
+       return kvm_skip_emulated_instruction(vcpu);
 }
 
 static int invpcid_interception(struct kvm_vcpu *vcpu)