@@ -611,11 +611,21 @@ int kvm_cpu_exec(CPUState *env)
switch (run->exit_reason) {
case KVM_EXIT_IO:
dprintf("handle_io\n");
+#ifdef TARGET_I386
+ // HACK to make vmport/vmmouse work
+ if (run->io.port == 0x5658)
+ kvm_arch_get_registers(env);
+#endif
ret = kvm_handle_io(env, run->io.port,
(uint8_t *)run + run->io.data_offset,
run->io.direction,
run->io.size,
run->io.count);
+#ifdef TARGET_I386
+ // HACK to make vmport/vmmouse work
+ if (run->io.port == 0x5658)
+ kvm_arch_put_registers(env);
+#endif
break;
case KVM_EXIT_MMIO:
dprintf("handle_mmio\n");