]> err.no Git - linux-2.6/commitdiff
KVM: Set exit_reason to KVM_EXIT_MMIO where run->mmio is initialized.
authorJeff Dike <jdike@addtoit.com>
Tue, 17 Jul 2007 16:26:59 +0000 (12:26 -0400)
committerAvi Kivity <avi@qumranet.com>
Sat, 13 Oct 2007 08:18:19 +0000 (10:18 +0200)
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm_main.c
drivers/kvm/svm.c
drivers/kvm/vmx.c

index fc63de25d9b03ce7e15bfffb7adc00ca78385614..193197fb399ea30091ebf21b3d4c83592c9bb890 100644 (file)
@@ -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;
                }
index 5c058fa1c8adbba151570a9d5751c9f1883d9964..850a1b1d86c595caee2a4bb462631ba18008a38d 100644 (file)
@@ -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__);
index f3e78187e892d3547f4397287a1b581f894e097f..2c4f01bea1fb8a7e563f2baf0877e6e893246aa0 100644 (file)
@@ -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__);