aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a6598cbaa001..a309be6788e7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3130,7 +3130,6 @@ static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3130static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, 3130static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3131 struct kvm_run *kvm_run) 3131 struct kvm_run *kvm_run)
3132{ 3132{
3133 struct vcpu_vmx *vmx = to_vmx(vcpu);
3134 int err; 3133 int err;
3135 3134
3136 preempt_enable(); 3135 preempt_enable();
@@ -3155,11 +3154,6 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3155 3154
3156 local_irq_disable(); 3155 local_irq_disable();
3157 preempt_disable(); 3156 preempt_disable();
3158
3159 /* Guest state should be valid now except if we need to
3160 * emulate an MMIO */
3161 if (guest_state_valid(vcpu))
3162 vmx->emulation_required = 0;
3163} 3157}
3164 3158
3165/* 3159/*
@@ -3208,8 +3202,11 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3208 3202
3209 /* If we need to emulate an MMIO from handle_invalid_guest_state 3203 /* If we need to emulate an MMIO from handle_invalid_guest_state
3210 * we just return 0 */ 3204 * we just return 0 */
3211 if (vmx->emulation_required && emulate_invalid_guest_state) 3205 if (vmx->emulation_required && emulate_invalid_guest_state) {
3206 if (guest_state_valid(vcpu))
3207 vmx->emulation_required = 0;
3212 return 0; 3208 return 0;
3209 }
3213 3210
3214 /* Access CR3 don't cause VMExit in paging mode, so we need 3211 /* Access CR3 don't cause VMExit in paging mode, so we need
3215 * to sync with guest real CR3. */ 3212 * to sync with guest real CR3. */