From 8fc0d085f521a2a76418f8f569cf1cd27f0e43d4 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Tue, 17 Jul 2007 12:26:59 -0400 Subject: [PATCH] KVM: Set exit_reason to KVM_EXIT_MMIO where run->mmio is initialized. Signed-off-by: Jeff Dike Signed-off-by: Avi Kivity --- drivers/kvm/kvm_main.c | 2 +- drivers/kvm/svm.c | 1 - drivers/kvm/vmx.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index fc63de25d9b0..193197fb399e 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -1276,6 +1276,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu, r = x86_emulate_memop(&emulate_ctxt, &emulate_ops); if ((r || vcpu->mmio_is_write) && run) { + run->exit_reason = KVM_EXIT_MMIO; run->mmio.phys_addr = vcpu->mmio_phys_addr; memcpy(run->mmio.data, vcpu->mmio_data, 8); run->mmio.len = vcpu->mmio_size; @@ -1937,7 +1938,6 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) /* * Read-modify-write. Back to userspace. */ - kvm_run->exit_reason = KVM_EXIT_MMIO; r = 0; goto out; } diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 5c058fa1c8ad..850a1b1d86c5 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -928,7 +928,6 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) return 1; case EMULATE_DO_MMIO: ++vcpu->stat.mmio_exits; - kvm_run->exit_reason = KVM_EXIT_MMIO; return 0; case EMULATE_FAIL: vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index f3e78187e892..2c4f01bea1fb 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1610,7 +1610,6 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) return 1; case EMULATE_DO_MMIO: ++vcpu->stat.mmio_exits; - kvm_run->exit_reason = KVM_EXIT_MMIO; return 0; case EMULATE_FAIL: vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); -- 2.39.5