Skip to contentSkip to conversation

PPC: Sync CPU state for KVM

PATCH In review Alexander Graf 2 participants 2 messages Dec 2, 2009 – Dec 3, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC: Sync CPU state for KVM

Some recent change made PPC guests always start at address 0x0 because env isn't synced to kvm_state on first bootup.

I'm not sure if this is the correct bugfix, but at least it makes PPC boot again with KVM enabled.

---
 hw/ppc_newworld.c |    4 ++++
 hw/ppc_oldworld.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
hw/ppc_newworld.c +4 -0
index da868d3..2f2f091 100644
@@ -38,6 +38,7 @@
 #include "ide.h"
 #include "loader.h"
 #include "elf.h"
+#include "kvm.h"
 
 #define MAX_IDE_BUS 2
 #define VGA_BIOS_SIZE 65536
@@ -134,6 +135,9 @@ static void ppc_core99_init (ram_addr_t ram_size,
         envs[i] = env;
     }
 
+    /* Make sure all register sets take effect */
+    cpu_synchronize_state(env);
+
     /* allocate RAM */
     ram_offset = qemu_ram_alloc(ram_size);
     cpu_register_physical_memory(0, ram_size, ram_offset);
hw/ppc_oldworld.c +4 -0
index 9b49a3d..4d89805 100644
@@ -38,6 +38,7 @@
 #include "ide.h"
 #include "loader.h"
 #include "elf.h"
+#include "kvm.h"
 
 #define MAX_IDE_BUS 2
 #define VGA_BIOS_SIZE 65536
@@ -162,6 +163,9 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
         envs[i] = env;
     }
 
+    /* Make sure all register sets take effect */
+    cpu_synchronize_state(env);
+
     /* allocate RAM */
     if (ram_size > (2047 << 20)) {
         fprintf(stderr,
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 6 lines · Alexander Graf

Some recent change made PPC guests always start at address 0x0 because env isn't synced to kvm_state on first bootup.

I'm not sure if this is the correct bugfix, but at least it makes PPC boot again with KVM enabled.

Looks good.

Signature · 1 line
error compiling committee.c: too many arguments to function