Skip to contentSkip to conversation

target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR

PATCH Applied Aaron Larson 3 participants 4 messages Jun 23, 2016 – Jun 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR

ppce500_spin.c uses SPR_PIR to initialize the spin table, however on Book E processors the correct SPR is SPR_BOOKE_PIR.

---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/ppce500_spin.c +1 -1
index 76bd78b..225177b 100644
@@ -104,7 +104,7 @@ static void spin_kick(void *data)
     hwaddr map_start;
 
     cpu_synchronize_state(cpu);
-    stl_p(&curspin->pir, env->spr[SPR_PIR]);
+    stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
     env->nip = ldq_p(&curspin->addr) & (map_size - 1);
     env->gpr[3] = ldq_p(&curspin->r3);
     env->gpr[4] = 0;
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 5 lines · Aaron Larson

ppce500_spin.c uses SPR_PIR to initialize the spin table, however on Book E processors the correct SPR is SPR_BOOKE_PIR.

Applied to ppc-for-2.7, thanks.

IIRC this leaves a redundant bit in spin_init, but that can be cleaned up later.

Quoted 17 lines
---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/ppce500_spin.c +1 -1
index 76bd78b..225177b 100644
@@ -104,7 +104,7 @@ static void spin_kick(void *data)
     hwaddr map_start;
 
     cpu_synchronize_state(cpu);
-    stl_p(&curspin->pir, env->spr[SPR_PIR]);
+    stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
     env->nip = ldq_p(&curspin->addr) & (map_size - 1);
     env->gpr[3] = ldq_p(&curspin->r3);
     env->gpr[4] = 0;
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
#2 lore raw
Quoted 11 lines · David Gibson
Quoted 5 lines · Aaron Larson

ppce500_spin.c uses SPR_PIR to initialize the spin table, however on Book E processors the correct SPR is SPR_BOOKE_PIR.

Applied to ppc-for-2.7, thanks.

IIRC this leaves a redundant bit in spin_init, but that can be cleaned up later.

It's in spin_reset() ... and I'm not sure whether this value is needed between reset and kick time, so maybe it's safer to just keep that line in spin_reset()?

Quoted 18 lines
Quoted 17 lines
---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/ppce500_spin.c +1 -1
index 76bd78b..225177b 100644
@@ -104,7 +104,7 @@ static void spin_kick(void *data)
     hwaddr map_start;
 
     cpu_synchronize_state(cpu);
-    stl_p(&curspin->pir, env->spr[SPR_PIR]);
+    stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
     env->nip = ldq_p(&curspin->addr) & (map_size - 1);
     env->gpr[3] = ldq_p(&curspin->r3);
     env->gpr[4] = 0;
#3 lore raw
Quoted 8 lines · Thomas Huth
Quoted 7 lines · David Gibson
Quoted 5 lines · Aaron Larson

ppce500_spin.c uses SPR_PIR to initialize the spin table, however on Book E processors the correct SPR is SPR_BOOKE_PIR.

Quoted 8 lines
Quoted 4 lines

Applied to ppc-for-2.7, thanks.

IIRC this leaves a redundant bit in spin_init, but that can be cleaned up later.

It's in spin_reset() ... and I'm not sure whether this value is needed between reset and kick time, so maybe it's safer to just keep that line in spin_reset()?

It shouldn't be. According to the spin table definition, the guest isn't supposed to read the rest of the info in the table until after it is kickced.

Quoted 21 lines
Quoted 19 lines
Quoted 18 lines
---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/ppce500_spin.c +1 -1
index 76bd78b..225177b 100644
@@ -104,7 +104,7 @@ static void spin_kick(void *data)
     hwaddr map_start;
 
     cpu_synchronize_state(cpu);
-    stl_p(&curspin->pir, env->spr[SPR_PIR]);
+    stl_p(&curspin->pir, env->spr[SPR_BOOKE_PIR]);
     env->nip = ldq_p(&curspin->addr) & (map_size - 1);
     env->gpr[3] = ldq_p(&curspin->r3);
     env->gpr[4] = 0;
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