Received: from eggs.gnu.org ([2001:4830:134:3::10]:42716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrkx-0004qA-3u for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWrks-0006JV-U7 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:7124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrks-0006J8-Kz for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:06:38 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u78Kxk5r095339 for ; Mon, 8 Aug 2016 17:06:38 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 24nbyr8u96-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 17:06:37 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 17:06:36 -0400 From: Michael Roth Date: Mon, 8 Aug 2016 16:03:39 -0500 In-Reply-To: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> Message-Id: <1470690267-31454-9-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 08/56] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini From: 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 CPU: 0 EIP: 0010:[] 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: [] [] [] [] [] [] [] 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 Fixes: 121f3157887f92268a3d6169e2d4601f9292020b Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 14cb949a3e2efd64ea3271b919b33b452ce7b180) Signed-off-by: Michael Roth --- 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) -- 1.9.1