diff options
-rw-r--r-- | arch/x86/kvm/x86.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 07c127fc2064..21ef1ba184ae 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5966,10 +5966,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) | |||
5966 | 5966 | ||
5967 | vcpu->mode = IN_GUEST_MODE; | 5967 | vcpu->mode = IN_GUEST_MODE; |
5968 | 5968 | ||
5969 | srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); | ||
5970 | |||
5969 | /* We should set ->mode before check ->requests, | 5971 | /* We should set ->mode before check ->requests, |
5970 | * see the comment in make_all_cpus_request. | 5972 | * see the comment in make_all_cpus_request. |
5971 | */ | 5973 | */ |
5972 | smp_mb(); | 5974 | smp_mb__after_srcu_read_unlock(); |
5973 | 5975 | ||
5974 | local_irq_disable(); | 5976 | local_irq_disable(); |
5975 | 5977 | ||
@@ -5979,12 +5981,11 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) | |||
5979 | smp_wmb(); | 5981 | smp_wmb(); |
5980 | local_irq_enable(); | 5982 | local_irq_enable(); |
5981 | preempt_enable(); | 5983 | preempt_enable(); |
5984 | vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); | ||
5982 | r = 1; | 5985 | r = 1; |
5983 | goto cancel_injection; | 5986 | goto cancel_injection; |
5984 | } | 5987 | } |
5985 | 5988 | ||
5986 | srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); | ||
5987 | |||
5988 | if (req_immediate_exit) | 5989 | if (req_immediate_exit) |
5989 | smp_send_reschedule(vcpu->cpu); | 5990 | smp_send_reschedule(vcpu->cpu); |
5990 | 5991 | ||