Skip to contentSkip to conversation

pseries: Fix breakage in CPU QOM conversion

PATCH Applied David Gibson 3 participants 4 messages Mar 15, 2013 – Mar 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pseries: Fix breakage in CPU QOM conversion

Commit 259186a7d2f7184efc96ae99bc5658e6159f53ad "cpu: Move halted and interrupt_request fields to CPUState" broke the pseries machine. That's because it uses CPU() instead of ENV_GET_CPU() to convert from the global first_cpu pointer (still a CPUArchState) to a CPUState. This patch fixes the breakage.

Cc Andreas Färber <[email protected]>
---
 hw/ppc/spapr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr.c +1 -1
index 0c51d04..b776d34 100644
@@ -645,7 +645,7 @@ static void ppc_spapr_reset(void)
                        spapr->rtas_size);
 
     /* Set up the entry state */
-    first_cpu_cpu = CPU(first_cpu);
+    first_cpu_cpu = ENV_GET_CPU(first_cpu);
     first_cpu->gpr[3] = spapr->fdt_addr;
     first_cpu->gpr[5] = 0;
     first_cpu_cpu->halted = 0;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 8 lines · David Gibson

Commit 259186a7d2f7184efc96ae99bc5658e6159f53ad "cpu: Move halted and interrupt_request fields to CPUState" broke the pseries machine. That's because it uses CPU() instead of ENV_GET_CPU() to convert from the global first_cpu pointer (still a CPUArchState) to a CPUState. This patch fixes the breakage.

Cc Andreas Färber <[email protected]>

Thanks, applied to ppc-next.

Alex

Quoted 20 lines

---
hw/ppc/spapr.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr.c +1 -1
index 0c51d04..b776d34 100644
@@ -645,7 +645,7 @@ static void ppc_spapr_reset(void)
                       spapr->rtas_size);
 
    /* Set up the entry state */
-    first_cpu_cpu = CPU(first_cpu);
+    first_cpu_cpu = ENV_GET_CPU(first_cpu);
    first_cpu->gpr[3] = spapr->fdt_addr;
    first_cpu->gpr[5] = 0;
    first_cpu_cpu->halted = 0;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#2 lore raw
In reply to David Gibson

Am 15.03.2013 04:59, schrieb David Gibson:

Quoted 17 lines

Commit 259186a7d2f7184efc96ae99bc5658e6159f53ad "cpu: Move halted and interrupt_request fields to CPUState" broke the pseries machine. That's because it uses CPU() instead of ENV_GET_CPU() to convert from the global first_cpu pointer (still a CPUArchState) to a CPUState. This patch fixes the breakage.

Cc Andreas Färber <[email protected]>
---
 hw/ppc/spapr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr.c +0 -0
index 0c51d04..b776d34 100644

hw/ppc/spapr.c static void ppc_spapr_reset(void) · line 651

Quoted 8 lines
hw/ppc/spapr.c +1 -1
@@ -645,7 +645,7 @@ static void ppc_spapr_reset(void)
                        spapr->rtas_size);
 
     /* Set up the entry state */
-    first_cpu_cpu = CPU(first_cpu);
+    first_cpu_cpu = ENV_GET_CPU(first_cpu);
     first_cpu->gpr[3] = spapr->fdt_addr;
     first_cpu->gpr[5] = 0;
     first_cpu_cpu->halted = 0;

Oops,

Did you check the commit if there's more instances of that bug?

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#3 lore raw
Quoted 29 lines · Andreas Färber

Am 15.03.2013 04:59, schrieb David Gibson:

Quoted 17 lines

Commit 259186a7d2f7184efc96ae99bc5658e6159f53ad "cpu: Move halted and interrupt_request fields to CPUState" broke the pseries machine. That's because it uses CPU() instead of ENV_GET_CPU() to convert from the global first_cpu pointer (still a CPUArchState) to a CPUState. This patch fixes the breakage.

Cc Andreas Färber <[email protected]>
---
 hw/ppc/spapr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr.c +0 -0
index 0c51d04..b776d34 100644

hw/ppc/spapr.c static void ppc_spapr_reset(void) · line 651

Quoted 8 lines
hw/ppc/spapr.c +1 -1
@@ -645,7 +645,7 @@ static void ppc_spapr_reset(void)
                        spapr->rtas_size);
 
     /* Set up the entry state */
-    first_cpu_cpu = CPU(first_cpu);
+    first_cpu_cpu = ENV_GET_CPU(first_cpu);
     first_cpu->gpr[3] = spapr->fdt_addr;
     first_cpu->gpr[5] = 0;
     first_cpu_cpu->halted = 0;

Oops,

Quoted 3 lines

Did you check the commit if there's more instances of that bug?

I did not; sorry.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson