All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR
@ 2016-06-23 22:35 Aaron Larson
  2016-06-24  2:27 ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Larson @ 2016-06-23 22:35 UTC (permalink / raw)
  To: agraf, alarson, david, qemu-devel, qemu-ppc


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(-)

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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR
  2016-06-23 22:35 [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR Aaron Larson
@ 2016-06-24  2:27 ` David Gibson
  2016-06-25  7:55   ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2016-06-24  2:27 UTC (permalink / raw)
  To: Aaron Larson; +Cc: agraf, qemu-devel, qemu-ppc

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

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;

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR
  2016-06-24  2:27 ` David Gibson
@ 2016-06-25  7:55   ` Thomas Huth
  2016-06-27  1:29     ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2016-06-25  7:55 UTC (permalink / raw)
  To: David Gibson, Aaron Larson; +Cc: qemu-ppc, agraf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]

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;
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR
  2016-06-25  7:55   ` Thomas Huth
@ 2016-06-27  1:29     ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2016-06-27  1:29 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Aaron Larson, qemu-ppc, agraf, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

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;
> > 
> 
> 



-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-27  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 22:35 [Qemu-devel] [PATCH] target-ppc: ppce500_spin.c uses SPR_PIR, should use SPR_BOOKE_PIR Aaron Larson
2016-06-24  2:27 ` David Gibson
2016-06-25  7:55   ` Thomas Huth
2016-06-27  1:29     ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.