aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/io.c
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2011-06-15 16:05:14 +0100
committerGeorge Dunlap <george.dunlap@eu.citrix.com>2011-06-15 16:05:14 +0100
commitef99df4b11c2f924c46e06ad541b3410e0f4ab7b (patch)
tree4009338ba3152268f82e2c58f1c6f0f667b4eea0 /xen/arch/x86/hvm/io.c
parente06b727ba1a868e689061cc842ebe122b76fd32d (diff)
downloadxen-ef99df4b11c2f924c46e06ad541b3410e0f4ab7b.tar.gz
xen-ef99df4b11c2f924c46e06ad541b3410e0f4ab7b.tar.bz2
xen-ef99df4b11c2f924c46e06ad541b3410e0f4ab7b.zip
x86/hvm: Crash domain rather than guest on unexpected PIO IO state
Under certain conditions, if an IO gets into an unexpected state, hvmemul_do_io can return X86EMUL_UNHANDLEABLE. Unfortunately, handle_pio() does not expect this state, and calls BUG() if it sees it, crashing the host. Other HVM io-related code crashes the guest in this case. This patch makes handle_pio() do the same. The crash was seen when executing crash_guest in dom0 to forcibly crash the guest. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/io.c')
-rw-r--r--xen/arch/x86/hvm/io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 274048d227..1c35d57438 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -239,7 +239,9 @@ int handle_pio(uint16_t port, int size, int dir)
curr->arch.hvm_vcpu.io_state = HVMIO_handle_pio_awaiting_completion;
break;
default:
- BUG();
+ gdprintk(XENLOG_ERR, "Weird HVM ioemulation status %d.\n", rc);
+ domain_crash(curr->domain);
+ break;
}
return 1;