Patchwork target-i386: fix commit c22549204a6edc431e8e4358e61bd56386ff6957

login
register
mail settings
Submitter TeLeMan
Date March 12, 2010, 11:38 a.m.
Message ID <a38b25541003120338l54f1f12fq3afde9424ed76955@mail.gmail.com>
Download mbox | patch
Permalink /patch/47670/
State New
Headers show

Comments

TeLeMan - March 12, 2010, 11:38 a.m.
The commit c22549204a6edc431e8e4358e61bd56386ff6957 led movntps &
movntdq to be translated incorrectly.

Signed-off-by: TeLeMan <geleman@gmail.com>
---
 target-i386/translate.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

                 goto illegal_op;
Paolo Bonzini - March 12, 2010, 1:22 p.m.
On 03/12/2010 12:38 PM, TeLeMan wrote:
> The commit c22549204a6edc431e8e4358e61bd56386ff6957 led movntps&
> movntdq to be translated incorrectly.

This should go on stable-0.12 too.

Paolo

> Signed-off-by: TeLeMan<geleman@gmail.com>
> ---
>   target-i386/translate.c |    5 +++++
>   1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/target-i386/translate.c b/target-i386/translate.c
> index 6838d53..07b0a70 100644
> --- a/target-i386/translate.c
> +++ b/target-i386/translate.c
> @@ -3457,6 +3457,11 @@ static void gen_sse(DisasContext *s, int b,
> target_ulong pc_start, int rex_r)
>           case 0x1e7: /* movntdq */
>           case 0x02b: /* movntps */
>           case 0x12b: /* movntps */
> +            if (mod == 3)
> +                goto illegal_op;
> +            gen_lea_modrm(s, modrm,&reg_addr,&offset_addr);
> +            gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));
> +            break;
>           case 0x3f0: /* lddqu */
>               if (mod == 3)
>                   goto illegal_op;
Aurelien Jarno - March 12, 2010, 1:32 p.m.
Paolo Bonzini a écrit :
> On 03/12/2010 12:38 PM, TeLeMan wrote:
>> The commit c22549204a6edc431e8e4358e61bd56386ff6957 led movntps&
>> movntdq to be translated incorrectly.
> 
> This should go on stable-0.12 too.
> 


The patch is correct, and I agree it should go to stable-0.12 too. I'll
commit it later today.

> 
>> Signed-off-by: TeLeMan<geleman@gmail.com>
>> ---
>>   target-i386/translate.c |    5 +++++
>>   1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/target-i386/translate.c b/target-i386/translate.c
>> index 6838d53..07b0a70 100644
>> --- a/target-i386/translate.c
>> +++ b/target-i386/translate.c
>> @@ -3457,6 +3457,11 @@ static void gen_sse(DisasContext *s, int b,
>> target_ulong pc_start, int rex_r)
>>           case 0x1e7: /* movntdq */
>>           case 0x02b: /* movntps */
>>           case 0x12b: /* movntps */
>> +            if (mod == 3)
>> +                goto illegal_op;
>> +            gen_lea_modrm(s, modrm,&reg_addr,&offset_addr);
>> +            gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));
>> +            break;
>>           case 0x3f0: /* lddqu */
>>               if (mod == 3)
>>                   goto illegal_op;
> 
>

Patch

diff --git a/target-i386/translate.c b/target-i386/translate.c
index 6838d53..07b0a70 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -3457,6 +3457,11 @@  static void gen_sse(DisasContext *s, int b,
target_ulong pc_start, int rex_r)
         case 0x1e7: /* movntdq */
         case 0x02b: /* movntps */
         case 0x12b: /* movntps */
+            if (mod == 3)
+                goto illegal_op;
+            gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
+            gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg]));
+            break;
         case 0x3f0: /* lddqu */
             if (mod == 3)