qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2
@ 2016-05-16  9:12 Paolo Bonzini
  2016-05-16  9:54 ` Stefan Weil
  2016-05-16 15:14 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-05-16  9:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: rth, sw, qemu-stable

sfence was introduced before lfence and mfence.  This fixes Linux
2.4's measurement of checksumming speeds for the pIII_sse
algorithm:

md: linear personality registered as nr 1
md: raid0 personality registered as nr 2
md: raid1 personality registered as nr 3
md: raid5 personality registered as nr 4
raid5: measuring checksumming speed
   8regs     :   384.400 MB/sec
   32regs    :   259.200 MB/sec
invalid operand: 0000
CPU:    0
EIP:    0010:[<c0240b2a>]    Not tainted
EFLAGS: 00000246
eax: c15d8000   ebx: 00000000   ecx: 00000000   edx: c15d5000
esi: 8005003b   edi: 00000004   ebp: 00000000   esp: c15bdf50
ds: 0018   es: 0018   ss: 0018
Process swapper (pid: 1, stackpage=c15bd000)
Stack: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
       00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
       00000000 00000206 c0241c6c 00001000 c15d4000 c15d7000 c15d4000
c15d4000
Call Trace:    [<c0241c6c>] [<c0105000>] [<c0241db4>] [<c010503b>]
[<c0105000>]
  [<c0107416>] [<c0105030>]

Code: 0f ae f8 0f 10 04 24 0f 10 4c 24 10 0f 10 54 24 20 0f 10 5c
 <0>Kernel panic: Attempted to kill init!

Reported-by: Stefan Weil <sw@weilnetz.de>
Fixes: 121f3157887f92268a3d6169e2d4601f9292020b
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-i386/translate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target-i386/translate.c b/target-i386/translate.c
index 1a1214d..69760b4 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -8002,6 +8002,11 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
             }
             /* fallthru */
         case 0xf9 ... 0xff: /* sfence */
+            if (!(s->cpuid_features & CPUID_SSE)
+                || (prefixes & PREFIX_LOCK)) {
+                goto illegal_op;
+            }
+            break;
         case 0xe8 ... 0xef: /* lfence */
         case 0xf0 ... 0xf7: /* mfence */
             if (!(s->cpuid_features & CPUID_SSE2)
-- 
2.5.5

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

* Re: [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2
  2016-05-16  9:12 [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 Paolo Bonzini
@ 2016-05-16  9:54 ` Stefan Weil
  2016-05-16 15:14 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Weil @ 2016-05-16  9:54 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: Richard Henderson, qemu-stable

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

Am 16.05.2016 um 11:12 schrieb Paolo Bonzini:
> sfence was introduced before lfence and mfence.  This fixes Linux
> 2.4's measurement of checksumming speeds for the pIII_sse
> algorithm:
> 
> md: linear personality registered as nr 1
> md: raid0 personality registered as nr 2
> md: raid1 personality registered as nr 3
> md: raid5 personality registered as nr 4
> raid5: measuring checksumming speed
>    8regs     :   384.400 MB/sec
>    32regs    :   259.200 MB/sec
> invalid operand: 0000


It works now again. Thanks for the fast fix.
I think we'll need a 2.6.1 soon, maybe after solving the VGA regression.

Tested-by: Stefan Weil <sw@weilnetz.de>




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

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

* Re: [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2
  2016-05-16  9:12 [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 Paolo Bonzini
  2016-05-16  9:54 ` Stefan Weil
@ 2016-05-16 15:14 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2016-05-16 15:14 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: sw, qemu-stable

On 05/16/2016 02:12 AM, Paolo Bonzini wrote:
> sfence was introduced before lfence and mfence.  This fixes Linux
> 2.4's measurement of checksumming speeds for the pIII_sse
> algorithm:
>
> md: linear personality registered as nr 1
> md: raid0 personality registered as nr 2
> md: raid1 personality registered as nr 3
> md: raid5 personality registered as nr 4
> raid5: measuring checksumming speed
>    8regs     :   384.400 MB/sec
>    32regs    :   259.200 MB/sec
> invalid operand: 0000
> CPU:    0
> EIP:    0010:[<c0240b2a>]    Not tainted
> EFLAGS: 00000246
> eax: c15d8000   ebx: 00000000   ecx: 00000000   edx: c15d5000
> esi: 8005003b   edi: 00000004   ebp: 00000000   esp: c15bdf50
> ds: 0018   es: 0018   ss: 0018
> Process swapper (pid: 1, stackpage=c15bd000)
> Stack: 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
>        00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000
>        00000000 00000206 c0241c6c 00001000 c15d4000 c15d7000 c15d4000
> c15d4000
> Call Trace:    [<c0241c6c>] [<c0105000>] [<c0241db4>] [<c010503b>]
> [<c0105000>]
>   [<c0107416>] [<c0105030>]
>
> Code: 0f ae f8 0f 10 04 24 0f 10 4c 24 10 0f 10 54 24 20 0f 10 5c
>  <0>Kernel panic: Attempted to kill init!
>
> Reported-by: Stefan Weil <sw@weilnetz.de>
> Fixes: 121f3157887f92268a3d6169e2d4601f9292020b
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target-i386/translate.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

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

end of thread, other threads:[~2016-05-16 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-16  9:12 [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 Paolo Bonzini
2016-05-16  9:54 ` Stefan Weil
2016-05-16 15:14 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).