KVM: Make vmport KVM-compatible
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 3 Feb 2010 20:16:41 +0000 (21:16 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 3 Feb 2010 21:47:34 +0000 (19:47 -0200)
The vmport "device" accesses the VCPU registers, so it requires proper
cpu_synchronize_state. Add it to vmport_ioport_read, which also
synchronizes vmport_ioport_write.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hw/vmport.c

index 884af3f..6c9d7c9 100644 (file)
@@ -25,6 +25,7 @@
 #include "isa.h"
 #include "pc.h"
 #include "sysemu.h"
+#include "kvm.h"
 
 //#define VMPORT_DEBUG
 
@@ -58,6 +59,8 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t addr)
     unsigned char command;
     uint32_t eax;
 
+    cpu_synchronize_state(env);
+
     eax = env->regs[R_EAX];
     if (eax != VMPORT_MAGIC)
         return eax;