Patchwork [4/6] KVM: Make vmport KVM-compatible

login
register
mail settings
Submitter Marcelo Tosatti
Date Feb. 3, 2010, 11:55 p.m.
Message ID <03c63b945239dc4abcf3a687beda6eb3b0cd69bc.1265241351.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/44432/
State New
Headers show

Comments

Marcelo Tosatti - Feb. 3, 2010, 11:55 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

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 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/vmport.c b/hw/vmport.c
index 884af3f..6c9d7c9 100644
--- a/hw/vmport.c
+++ b/hw/vmport.c
@@ -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;