提交 8fc0d085 编写于 作者: J Jeff Dike 提交者: Avi Kivity

KVM: Set exit_reason to KVM_EXIT_MMIO where run->mmio is initialized.

Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 9eb829ce
...@@ -1276,6 +1276,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu, ...@@ -1276,6 +1276,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
r = x86_emulate_memop(&emulate_ctxt, &emulate_ops); r = x86_emulate_memop(&emulate_ctxt, &emulate_ops);
if ((r || vcpu->mmio_is_write) && run) { if ((r || vcpu->mmio_is_write) && run) {
run->exit_reason = KVM_EXIT_MMIO;
run->mmio.phys_addr = vcpu->mmio_phys_addr; run->mmio.phys_addr = vcpu->mmio_phys_addr;
memcpy(run->mmio.data, vcpu->mmio_data, 8); memcpy(run->mmio.data, vcpu->mmio_data, 8);
run->mmio.len = vcpu->mmio_size; 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) ...@@ -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. * Read-modify-write. Back to userspace.
*/ */
kvm_run->exit_reason = KVM_EXIT_MMIO;
r = 0; r = 0;
goto out; goto out;
} }
......
...@@ -928,7 +928,6 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) ...@@ -928,7 +928,6 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
return 1; return 1;
case EMULATE_DO_MMIO: case EMULATE_DO_MMIO:
++vcpu->stat.mmio_exits; ++vcpu->stat.mmio_exits;
kvm_run->exit_reason = KVM_EXIT_MMIO;
return 0; return 0;
case EMULATE_FAIL: case EMULATE_FAIL:
vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__);
......
...@@ -1610,7 +1610,6 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) ...@@ -1610,7 +1610,6 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
return 1; return 1;
case EMULATE_DO_MMIO: case EMULATE_DO_MMIO:
++vcpu->stat.mmio_exits; ++vcpu->stat.mmio_exits;
kvm_run->exit_reason = KVM_EXIT_MMIO;
return 0; return 0;
case EMULATE_FAIL: case EMULATE_FAIL:
vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册