diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-03-27 11:39:57 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-03-27 11:39:57 +0000 |
commit | 2248727b1d267ebd3debfc0d1c807b247dc62cfa (patch) | |
tree | 3da8ca51b2cb08b366580f212f4ebd3a3e0373a0 /xen/arch/x86/hvm/io.c | |
parent | 8f62617cf4f3236d1aed3e8e2e8f1e97247fc593 (diff) | |
download | xen-2248727b1d267ebd3debfc0d1c807b247dc62cfa.tar.gz xen-2248727b1d267ebd3debfc0d1c807b247dc62cfa.tar.bz2 xen-2248727b1d267ebd3debfc0d1c807b247dc62cfa.zip |
x86, hvm: MMIO emulations should defer domain shutdown requests until
the relevant instruction has been fully emulated (which may require
multiple round trips to qemu-dm).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/io.c')
-rw-r--r-- | xen/arch/x86/hvm/io.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index bc5f8acce3..ac1e62782a 100644 --- a/xen/arch/x86/hvm/io.c +++ b/xen/arch/x86/hvm/io.c @@ -221,35 +221,34 @@ int handle_mmio_with_translation(unsigned long gva, unsigned long gpfn) void hvm_io_assist(void) { - struct vcpu *v = current; - ioreq_t *p = &get_ioreq(v)->vp_ioreq; + struct vcpu *curr = current; + ioreq_t *p = &get_ioreq(curr)->vp_ioreq; enum hvm_io_state io_state; if ( p->state != STATE_IORESP_READY ) { gdprintk(XENLOG_ERR, "Unexpected HVM iorequest state %d.\n", p->state); - domain_crash(v->domain); - goto out; + domain_crash_synchronous(); } rmb(); /* see IORESP_READY /then/ read contents of ioreq */ p->state = STATE_IOREQ_NONE; - io_state = v->arch.hvm_vcpu.io_state; - v->arch.hvm_vcpu.io_state = HVMIO_none; + io_state = curr->arch.hvm_vcpu.io_state; + curr->arch.hvm_vcpu.io_state = HVMIO_none; if ( (io_state == HVMIO_awaiting_completion) || (io_state == HVMIO_handle_mmio_awaiting_completion) ) { - v->arch.hvm_vcpu.io_state = HVMIO_completed; - v->arch.hvm_vcpu.io_data = p->data; + curr->arch.hvm_vcpu.io_state = HVMIO_completed; + curr->arch.hvm_vcpu.io_data = p->data; if ( io_state == HVMIO_handle_mmio_awaiting_completion ) (void)handle_mmio(); } - out: - vcpu_end_shutdown_deferral(v); + if ( p->state == STATE_IOREQ_NONE ) + vcpu_end_shutdown_deferral(curr); } void dpci_ioport_read(uint32_t mport, ioreq_t *p) |