Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Changelog

[xen-unstable] x86/hvm: don't leave emulator in inconsistent state

 

 

Xen changelog RSS feed   Index | Next | Previous | View Threaded


patchbot at xen

Jul 27, 2012, 8:00 PM

Post #1 of 1 (33 views)
Permalink
[xen-unstable] x86/hvm: don't leave emulator in inconsistent state

# HG changeset patch
# User Jan Beulich <jbeulich [at] suse>
# Date 1343317911 -3600
# Node ID ffcb24876b4f2e3c24be7db2a20318df81b0fc6c
# Parent c29feacecfc4b0564b364adf0fd9c8bf19e250d8
x86/hvm: don't leave emulator in inconsistent state

The fact that handle_mmio(), and thus the instruction emulator, is
being run through twice for emulations that require involvement of the
device model, allows for the second run to see a different guest state
than the first one. Since only the MMIO-specific emulation routines
update the vCPU's io_state, if they get invoked on the second pass,
internal state (and particularly this variable) can be left in a state
making successful emulation of a subsequent MMIO operation impossible.

Consequently, whenever the emulator invocation returns without
requesting a retry of the guest instruction, reset io_state.

Signed-off-by: Jan Beulich <jbeulich [at] suse>
Acked-by: Keir Fraser <keir [at] xen>
Committed-by: Ian Jackson <ian.jackson [at] eu>
---


diff -r c29feacecfc4 -r ffcb24876b4f xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c Thu Jul 26 16:47:37 2012 +0100
+++ b/xen/arch/x86/hvm/io.c Thu Jul 26 16:51:51 2012 +0100
@@ -179,6 +179,8 @@ int handle_mmio(void)

rc = hvm_emulate_one(&ctxt);

+ if ( rc != X86EMUL_RETRY )
+ vio->io_state = HVMIO_none;
if ( vio->io_state == HVMIO_awaiting_completion )
vio->io_state = HVMIO_handle_mmio_awaiting_completion;
else

_______________________________________________
Xen-changelog mailing list
Xen-changelog [at] lists
http://lists.xensource.com/xen-changelog

Xen changelog RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.