All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value
@ 2013-04-04 16:47 Alexander Graf
  2013-04-04 19:06 ` Andreas Färber
  2013-04-05  9:09 ` Fabien Chouteau
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Graf @ 2013-04-04 16:47 UTC (permalink / raw)
  To: qemu-ppc@nongnu.org list:PowerPC; +Cc: qemu-devel qemu-devel, Fabien Chouteau

On -M mac99, we can run 970 CPUs. However, these CPUs define the initial
instruction pointer they start execution at as part of their bootup protocol,
so effectively it's up to the board to decide where they start.

This went unnoticed, because they used to boot at the same location our flash
was mapped to, but due to the recent reset changes our 970 CPUs want to reset
to 0x100 now, which is always a 0 instruction.

Set the initial IP to something reasonable for -M mac99.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/mac_newworld.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index a08a6b2..ca7d98f 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -126,6 +126,8 @@ static void ppc_core99_reset(void *opaque)
     PowerPCCPU *cpu = opaque;
 
     cpu_reset(CPU(cpu));
+    /* 970 CPUs want to get their initial IP as part of their boot protocol */
+    cpu->env.nip = PROM_ADDR + 0x100;
 }
 
 /* PowerPC Mac99 hardware initialisation */
-- 
1.6.0.2

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

* Re: [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value
  2013-04-04 16:47 [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value Alexander Graf
@ 2013-04-04 19:06 ` Andreas Färber
  2013-04-04 22:25   ` Alexander Graf
  2013-04-05  9:09 ` Fabien Chouteau
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2013-04-04 19:06 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-ppc, qemu-devel, Fabien Chouteau

Am 04.04.2013 18:47, schrieb Alexander Graf:
> On -M mac99, we can run 970 CPUs. However, these CPUs define the initial
> instruction pointer they start execution at as part of their bootup protocol,
> so effectively it's up to the board to decide where they start.
> 
> This went unnoticed, because they used to boot at the same location our flash
> was mapped to, but due to the recent reset changes our 970 CPUs want to reset
> to 0x100 now, which is always a 0 instruction.
> 
> Set the initial IP to something reasonable for -M mac99.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  hw/ppc/mac_newworld.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index a08a6b2..ca7d98f 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -126,6 +126,8 @@ static void ppc_core99_reset(void *opaque)
>      PowerPCCPU *cpu = opaque;
>  
>      cpu_reset(CPU(cpu));
> +    /* 970 CPUs want to get their initial IP as part of their boot protocol */
> +    cpu->env.nip = PROM_ADDR + 0x100;
>  }
>  
>  /* PowerPC Mac99 hardware initialisation */

That is lacking a restriction to 970... :) There's probably some -cpu to
make it start from -4 instead, no?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value
  2013-04-04 19:06 ` Andreas Färber
@ 2013-04-04 22:25   ` Alexander Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2013-04-04 22:25 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-ppc, qemu-devel, Fabien Chouteau



Am 04.04.2013 um 21:06 schrieb Andreas Färber <afaerber@suse.de>:

> Am 04.04.2013 18:47, schrieb Alexander Graf:
>> On -M mac99, we can run 970 CPUs. However, these CPUs define the initial
>> instruction pointer they start execution at as part of their bootup protocol,
>> so effectively it's up to the board to decide where they start.
>> 
>> This went unnoticed, because they used to boot at the same location our flash
>> was mapped to, but due to the recent reset changes our 970 CPUs want to reset
>> to 0x100 now, which is always a 0 instruction.
>> 
>> Set the initial IP to something reasonable for -M mac99.
>> 
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> hw/ppc/mac_newworld.c |    2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>> 
>> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
>> index a08a6b2..ca7d98f 100644
>> --- a/hw/ppc/mac_newworld.c
>> +++ b/hw/ppc/mac_newworld.c
>> @@ -126,6 +126,8 @@ static void ppc_core99_reset(void *opaque)
>>     PowerPCCPU *cpu = opaque;
>> 
>>     cpu_reset(CPU(cpu));
>> +    /* 970 CPUs want to get their initial IP as part of their boot protocol */
>> +    cpu->env.nip = PROM_ADDR + 0x100;
>> }
>> 
>> /* PowerPC Mac99 hardware initialisation */
> 
> That is lacking a restriction to 970... :) There's probably some -cpu to
> make it start from -4 instead, no?

There shouldn't. All CPUs compatible with -M mac99 boot from 0xfff0100.

Alex

> 
> Andreas
> 
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

* Re: [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value
  2013-04-04 16:47 [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value Alexander Graf
  2013-04-04 19:06 ` Andreas Färber
@ 2013-04-05  9:09 ` Fabien Chouteau
  1 sibling, 0 replies; 4+ messages in thread
From: Fabien Chouteau @ 2013-04-05  9:09 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-ppc@nongnu.org list:PowerPC, qemu-devel qemu-devel

On 04/04/2013 06:47 PM, Alexander Graf wrote:
> On -M mac99, we can run 970 CPUs. However, these CPUs define the initial
> instruction pointer they start execution at as part of their bootup protocol,
> so effectively it's up to the board to decide where they start.
>
> This went unnoticed, because they used to boot at the same location our flash
> was mapped to, but due to the recent reset changes our 970 CPUs want to reset
> to 0x100 now, which is always a 0 instruction.
>

This is one of the regressions introduced by my patch, thanks for fixing
it.

Reviewed-by: Fabien Chouteau <chouteau@adacore.com>

> Set the initial IP to something reasonable for -M mac99.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  hw/ppc/mac_newworld.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index a08a6b2..ca7d98f 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -126,6 +126,8 @@ static void ppc_core99_reset(void *opaque)
>      PowerPCCPU *cpu = opaque;
>  
>      cpu_reset(CPU(cpu));
> +    /* 970 CPUs want to get their initial IP as part of their boot protocol */
> +    cpu->env.nip = PROM_ADDR + 0x100;
>  }
>  
>  /* PowerPC Mac99 hardware initialisation */
> 


-- 
Fabien Chouteau

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

end of thread, other threads:[~2013-04-05  9:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04 16:47 [Qemu-devel] [PATCH] PPC: mac newworld: fix cpu NIP reset value Alexander Graf
2013-04-04 19:06 ` Andreas Färber
2013-04-04 22:25   ` Alexander Graf
2013-04-05  9:09 ` Fabien Chouteau

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.