From eda0159cda3e5f05f6c8f8b93317c973a39109d4 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 5 Jan 2009 00:53:19 +0200 Subject: [PATCH] --- yaml --- r: 133705 b: refs/heads/master c: 10f32d84c750ccf8c0afb3a4ea9d4059aa3e9ffc h: refs/heads/master i: 133703: 34b6d65a470ac9778127fa0824eaa795daf1bb4e v: v3 --- [refs] | 2 +- trunk/arch/x86/kvm/vmx.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 1e3682805b3b..61f473eab172 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9fd4a3b7a412f983696b23121413a79d2132fed6 +refs/heads/master: 10f32d84c750ccf8c0afb3a4ea9d4059aa3e9ffc diff --git a/trunk/arch/x86/kvm/vmx.c b/trunk/arch/x86/kvm/vmx.c index a6598cbaa001..a309be6788e7 100644 --- a/trunk/arch/x86/kvm/vmx.c +++ b/trunk/arch/x86/kvm/vmx.c @@ -3130,7 +3130,6 @@ static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) { - struct vcpu_vmx *vmx = to_vmx(vcpu); int err; preempt_enable(); @@ -3155,11 +3154,6 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, local_irq_disable(); preempt_disable(); - - /* Guest state should be valid now except if we need to - * emulate an MMIO */ - if (guest_state_valid(vcpu)) - vmx->emulation_required = 0; } /* @@ -3208,8 +3202,11 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) /* If we need to emulate an MMIO from handle_invalid_guest_state * we just return 0 */ - if (vmx->emulation_required && emulate_invalid_guest_state) + if (vmx->emulation_required && emulate_invalid_guest_state) { + if (guest_state_valid(vcpu)) + vmx->emulation_required = 0; return 0; + } /* Access CR3 don't cause VMExit in paging mode, so we need * to sync with guest real CR3. */