Skip to contentSkip to conversation

Fix loading of registers preboot for PowerPC

PATCH New Jerone Young 1 participant 4 messages Apr 10, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix loading of registers preboot for PowerPC

So this now moves code away from common code to arch specific kvm_qemu_arch_init(). Also added is a removal of duplicate calls to kvm_qemu_init_env() in common code.

3 files changed, 6 insertions(+), 4 deletions(-)
qemu/hw/ppc440_bamboo.c |    3 ---
qemu/qemu-kvm-powerpc.c |    6 ++++++
qemu/qemu-kvm.c         |    1 -

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#1 lore raw

PATCH 1/1 Add kvm_load_registers into qemu_arch_init for PowerPC

1 file changed, 6 insertions(+)

qemu/qemu-kvm-powerpc.c | 6 ++++++

This patch adds a call to load_kvm_registers after creation of vcpu. This is required for ppc since we are required to set certain registers before boot.

qemu/qemu-kvm-powerpc.c +6 -0
@@ -121,6 +121,12 @@ void kvm_arch_save_regs(CPUState *env)
 
 int kvm_arch_qemu_init_env(CPUState *cenv)
 {
+    if (cenv->cpu_index == 0) {
+        /* load any registers set in env into
+           kvm  for the first guest vcpu */
+        kvm_load_registers(cenv);
+    }
+
     return 0;
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#2 lore raw

PATCH 1/1 Remove kvm_load_registers from ppc440_bamboo board model

In reply to Jerone Young
1 file changed, 3 deletions(-)

qemu/hw/ppc440_bamboo.c | 3 ---

This patch removes the call to kvm_load_registers while in board platform setup code. This must now be done later in vcpu initialization.

qemu/hw/ppc440_bamboo.c +0 -3
@@ -174,9 +174,6 @@ void bamboo_init(ram_addr_t ram_size, in
 		env->gpr[3] = dt_base;
 #endif
 		env->nip = ep;
-
-		printf("%s: loading kvm registers\n", __func__);
-		kvm_load_registers(env);
 	}
 
 	for (i = 0; i < nb_nics; i++) {

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#3 lore raw

PATCH 1/1 Remove duplicate kvm_qemu_init() calls

In reply to Jerone Young
1 file changed, 1 deletion(-)

qemu/qemu-kvm.c | 1 -

kvm_qemu_init is called in ap_main_loop() , when ap_main_loop() calls kvm_main_loop_cpu(), kvm_qemu_init() is run for a second time. It should only be called in kvm_main_loop_cpu().

~

qemu/qemu-kvm.c +0 -1
@@ -353,7 +353,6 @@ static void *ap_main_loop(void *_env)
     sigdelset(&signals, SIG_IPI);
     sigprocmask(SIG_BLOCK, &signals, NULL);
     kvm_create_vcpu(kvm_context, env->cpu_index);
-    kvm_qemu_init_env(env);
     if (kvm_irqchip_in_kernel(kvm_context))
 	env->hflags &= ~HF_HALTED_MASK;
     kvm_main_loop_cpu(env);

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone