Skip to content

Commit b439eb8

Browse files
sean-jcbonzini
authored andcommitted
Revert "KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid"
Now that handle_fastpath_set_msr_irqoff() acquires kvm->srcu, i.e. allows dereferencing memslots during WRMSR emulation, drop the requirement that "next RIP" is valid. In hindsight, acquiring kvm->srcu would have been a better fix than avoiding the pastpath, but at the time it was thought that accessing SRCU-protected data in the fastpath was a one-off edge case. This reverts commit 5c30e81. Signed-off-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 3f2739b commit b439eb8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3986,14 +3986,8 @@ static int svm_vcpu_pre_run(struct kvm_vcpu *vcpu)
39863986

39873987
static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
39883988
{
3989-
struct vmcb_control_area *control = &to_svm(vcpu)->vmcb->control;
3990-
3991-
/*
3992-
* Note, the next RIP must be provided as SRCU isn't held, i.e. KVM
3993-
* can't read guest memory (dereference memslots) to decode the WRMSR.
3994-
*/
3995-
if (control->exit_code == SVM_EXIT_MSR && control->exit_info_1 &&
3996-
nrips && control->next_rip)
3989+
if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_MSR &&
3990+
to_svm(vcpu)->vmcb->control.exit_info_1)
39973991
return handle_fastpath_set_msr_irqoff(vcpu);
39983992

39993993
return EXIT_FASTPATH_NONE;

0 commit comments

Comments
 (0)