diff mbox

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

Message ID 201606232235.u5NMZHkU027326@linux03a.ddci.com
State New
Headers show

Commit Message

alarson@ddci.com June 23, 2016, 10:35 p.m. UTC
ppce500_spin.c uses SPR_PIR to initialize the spin table, however on
Book E processors the correct SPR is SPR_BOOKE_PIR.

Signed-off-by: Aaron Larson <alarson@ddci.com>
---
 hw/ppc/ppce500_spin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Gibson June 24, 2016, 2:27 a.m. UTC | #1
On Thu, Jun 23, 2016 at 03:35:17PM -0700, Aaron Larson wrote:
> 
> ppce500_spin.c uses SPR_PIR to initialize the spin table, however on
> Book E processors the correct SPR is SPR_BOOKE_PIR.
> 
> Signed-off-by: Aaron Larson <alarson@ddci.com>

Applied to ppc-for-2.7, thanks.

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

> ---
>  hw/ppc/ppce500_spin.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
> index 76bd78b..225177b 100644
> --- a/hw/ppc/ppce500_spin.c
> +++ b/hw/ppc/ppce500_spin.c
> @@ -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;
Thomas Huth June 25, 2016, 7:55 a.m. UTC | #2
On 24.06.2016 04:27, David Gibson wrote:
> On Thu, Jun 23, 2016 at 03:35:17PM -0700, Aaron Larson wrote:
>>
>> ppce500_spin.c uses SPR_PIR to initialize the spin table, however on
>> Book E processors the correct SPR is SPR_BOOKE_PIR.
>>
>> Signed-off-by: Aaron Larson <alarson@ddci.com>
> 
> 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()?

>> ---
>>  hw/ppc/ppce500_spin.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
>> index 76bd78b..225177b 100644
>> --- a/hw/ppc/ppce500_spin.c
>> +++ b/hw/ppc/ppce500_spin.c
>> @@ -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;
>
David Gibson June 27, 2016, 1:29 a.m. UTC | #3
On Sat, Jun 25, 2016 at 09:55:13AM +0200, Thomas Huth wrote:
> On 24.06.2016 04:27, David Gibson wrote:
> > On Thu, Jun 23, 2016 at 03:35:17PM -0700, Aaron Larson wrote:
> >>
> >> ppce500_spin.c uses SPR_PIR to initialize the spin table, however on
> >> Book E processors the correct SPR is SPR_BOOKE_PIR.
> >>
> >> Signed-off-by: Aaron Larson <alarson@ddci.com>
> > 
> > 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.

> 
> >> ---
> >>  hw/ppc/ppce500_spin.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
> >> index 76bd78b..225177b 100644
> >> --- a/hw/ppc/ppce500_spin.c
> >> +++ b/hw/ppc/ppce500_spin.c
> >> @@ -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;
> > 
> 
>
diff mbox

Patch

diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
index 76bd78b..225177b 100644
--- a/hw/ppc/ppce500_spin.c
+++ b/hw/ppc/ppce500_spin.c
@@ -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;