Patchwork [v1,1/1] ppc: Correctly define POWERPC_INSNS2_DEFAULT

login
register
mail settings
Submitter Meador Inge
Date Feb. 23, 2012, 1:44 p.m.
Message ID <1330004654-428-1-git-send-email-meadori@codesourcery.com>
Download mbox | patch
Permalink /patch/142623/
State New
Headers show

Comments

Meador Inge - Feb. 23, 2012, 1:44 p.m.
'POWERPC_INSNS2_DEFAULT' was defined incorrectly which was causing the
opcode table creation code to erroneously register 'eieio' and 'mbar'
for the "default" processor:

   ** ERROR: opcode 1a already assigned in opcode table 16
   *** ERROR: unable to insert opcode [1f-16-1a]
   *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a

Signed-off-by: Meador Inge <meadori@codesourcery.com>
---
 target-ppc/translate_init.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Meador Inge - March 5, 2012, 5:06 p.m.
On 02/23/2012 07:44 AM, Meador Inge wrote:

> 'POWERPC_INSNS2_DEFAULT' was defined incorrectly which was causing the
> opcode table creation code to erroneously register 'eieio' and 'mbar'
> for the "default" processor:
> 
>    ** ERROR: opcode 1a already assigned in opcode table 16
>    *** ERROR: unable to insert opcode [1f-16-1a]
>    *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
> 
> Signed-off-by: Meador Inge <meadori@codesourcery.com>

Ping.

> ---
>  target-ppc/translate_init.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 6253076..6cb5fad 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -6713,7 +6713,7 @@ static void init_proc_620 (CPUPPCState *env)
>  #if defined (TARGET_PPC64) && 0 // XXX: TODO
>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC64
>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC64
> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC64
> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC64
>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC64
>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC64
>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC64
> @@ -6725,7 +6725,7 @@ static void init_proc_620 (CPUPPCState *env)
>  #else
>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC32
>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC32
> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC32
> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC32
>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC32
>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC32
>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC32
Andreas Färber - March 5, 2012, 7:53 p.m.
Am 05.03.2012 18:06, schrieb Meador Inge:
> On 02/23/2012 07:44 AM, Meador Inge wrote:
> 
>> 'POWERPC_INSNS2_DEFAULT' was defined incorrectly which was causing the
>> opcode table creation code to erroneously register 'eieio' and 'mbar'
>> for the "default" processor:
>>
>>    ** ERROR: opcode 1a already assigned in opcode table 16
>>    *** ERROR: unable to insert opcode [1f-16-1a]
>>    *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
>>
>> Signed-off-by: Meador Inge <meadori@codesourcery.com>
> 
> Ping.

Cc'ing qemu-ppc.

What's the test case (command line) that breaks? Don't all machines use
different default CPUs? I would rather drop these ..._DEFAULT defines in
favor of using a real CPU model - but maybe I'm misunderstanding something?

Andreas

> 
>> ---
>>  target-ppc/translate_init.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
>> index 6253076..6cb5fad 100644
>> --- a/target-ppc/translate_init.c
>> +++ b/target-ppc/translate_init.c
>> @@ -6713,7 +6713,7 @@ static void init_proc_620 (CPUPPCState *env)
>>  #if defined (TARGET_PPC64) && 0 // XXX: TODO
>>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC64
>>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC64
>> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC64
>> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC64
>>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC64
>>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC64
>>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC64
>> @@ -6725,7 +6725,7 @@ static void init_proc_620 (CPUPPCState *env)
>>  #else
>>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC32
>>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC32
>> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC32
>> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC32
>>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC32
>>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC32
>>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC32
Meador Inge - March 5, 2012, 8:26 p.m.
On 03/05/2012 01:53 PM, Andreas Färber wrote:

> Am 05.03.2012 18:06, schrieb Meador Inge:
>> On 02/23/2012 07:44 AM, Meador Inge wrote:
>>
>>> 'POWERPC_INSNS2_DEFAULT' was defined incorrectly which was causing the
>>> opcode table creation code to erroneously register 'eieio' and 'mbar'
>>> for the "default" processor:
>>>
>>>    ** ERROR: opcode 1a already assigned in opcode table 16
>>>    *** ERROR: unable to insert opcode [1f-16-1a]
>>>    *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
>>>
>>> Signed-off-by: Meador Inge <meadori@codesourcery.com>
>>
>> Ping.
> 
> Cc'ing qemu-ppc.
> 
> What's the test case (command line) that breaks? Don't all machines use
> different default CPUs? I would rather drop these ..._DEFAULT defines in
> favor of using a real CPU model - but maybe I'm misunderstanding something?

I meant quite literally the "default" CPU:

$ ./install/bin/qemu-system-ppc -cpu default
*** ERROR: opcode 1a already assigned in opcode table 16
*** ERROR: unable to insert opcode [1f-16-1a]
*** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
Segmentation fault (core dumped)

> 
>>
>>> ---
>>>  target-ppc/translate_init.c |    4 ++--
>>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
>>> index 6253076..6cb5fad 100644
>>> --- a/target-ppc/translate_init.c
>>> +++ b/target-ppc/translate_init.c
>>> @@ -6713,7 +6713,7 @@ static void init_proc_620 (CPUPPCState *env)
>>>  #if defined (TARGET_PPC64) && 0 // XXX: TODO
>>>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC64
>>>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC64
>>> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC64
>>> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC64
>>>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC64
>>>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC64
>>>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC64
>>> @@ -6725,7 +6725,7 @@ static void init_proc_620 (CPUPPCState *env)
>>>  #else
>>>  #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC32
>>>  #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC32
>>> -#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC32
>>> +#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC32
>>>  #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC32
>>>  #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC32
>>>  #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC32
>
Alexander Graf - March 12, 2012, 7:20 p.m.
On 05.03.2012, at 21:26, Meador Inge wrote:

> On 03/05/2012 01:53 PM, Andreas Färber wrote:
> 
>> Am 05.03.2012 18:06, schrieb Meador Inge:
>>> On 02/23/2012 07:44 AM, Meador Inge wrote:
>>> 
>>>> 'POWERPC_INSNS2_DEFAULT' was defined incorrectly which was causing the
>>>> opcode table creation code to erroneously register 'eieio' and 'mbar'
>>>> for the "default" processor:
>>>> 
>>>>   ** ERROR: opcode 1a already assigned in opcode table 16
>>>>   *** ERROR: unable to insert opcode [1f-16-1a]
>>>>   *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
>>>> 
>>>> Signed-off-by: Meador Inge <meadori@codesourcery.com>
>>> 
>>> Ping.
>> 
>> Cc'ing qemu-ppc.
>> 
>> What's the test case (command line) that breaks? Don't all machines use
>> different default CPUs? I would rather drop these ..._DEFAULT defines in
>> favor of using a real CPU model - but maybe I'm misunderstanding something?
> 
> I meant quite literally the "default" CPU:
> 
> $ ./install/bin/qemu-system-ppc -cpu default
> *** ERROR: opcode 1a already assigned in opcode table 16
> *** ERROR: unable to insert opcode [1f-16-1a]
> *** ERROR initializing PowerPC instruction 0x1f 0x16 0x1a
> Segmentation fault (core dumped)

Ouch. And thanks, applied to ppc-next.


Alex

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 6253076..6cb5fad 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -6713,7 +6713,7 @@  static void init_proc_620 (CPUPPCState *env)
 #if defined (TARGET_PPC64) && 0 // XXX: TODO
 #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC64
 #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC64
-#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC64
+#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC64
 #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC64
 #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC64
 #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC64
@@ -6725,7 +6725,7 @@  static void init_proc_620 (CPUPPCState *env)
 #else
 #define CPU_POWERPC_DEFAULT    CPU_POWERPC_PPC32
 #define POWERPC_INSNS_DEFAULT  POWERPC_INSNS_PPC32
-#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS_PPC32
+#define POWERPC_INSNS2_DEFAULT POWERPC_INSNS2_PPC32
 #define POWERPC_MSRM_DEFAULT   POWERPC_MSRM_PPC32
 #define POWERPC_MMU_DEFAULT    POWERPC_MMU_PPC32
 #define POWERPC_EXCP_DEFAULT   POWERPC_EXCP_PPC32