From patchwork Mon May 16 09:12:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9099281 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6BE35BF29F for ; Mon, 16 May 2016 09:13:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3E322026C for ; Mon, 16 May 2016 09:13:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB9FD201B4 for ; Mon, 16 May 2016 09:13:24 +0000 (UTC) Received: from localhost ([::1]:43179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2EaZ-0004QR-Kw for patchwork-qemu-devel@patchwork.kernel.org; Mon, 16 May 2016 05:13:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2EaS-0004Jm-QB for qemu-devel@nongnu.org; Mon, 16 May 2016 05:13:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2EaP-0004sL-Gt for qemu-devel@nongnu.org; Mon, 16 May 2016 05:13:16 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2EaP-0004sE-9a; Mon, 16 May 2016 05:13:13 -0400 Received: by mail-wm0-x243.google.com with SMTP id r12so16607695wme.0; Mon, 16 May 2016 02:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=soKPs4e9vuIA2+qCNjvNPisKOOb7G9t/0K+IM1tPKBw=; b=E3ZZUsVMjOjeS5tlYS46yoHalbn1wXt/FT8K907BHbYvYcsd2O2rtP4GYSrLisEWOn TWcX6JEK0lBWtO9vF9p+zKg+DkPErqzjOxc9FlI0OpP3isQeUltyJUoNvrl8r0xPJPPz sFMPmU3BSQqTcDZJm8/HxGRrmnavtXxkzQdPiwf8K0S/jg9NkqBnnzRkDvW9kxnFia5Y iKqwS6+izQq3GBHlnLcpz03WMnAhalNg4wKcL5+6Pdvn/G0bhbAs2gQL1t+DqH27ESA5 ZS1qXaeBEaiYsKGH5wuNbUpubrOQ2Py1D2oAczVLnpgot/mhG66I+HBieKegNtYO6vZt ywqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=soKPs4e9vuIA2+qCNjvNPisKOOb7G9t/0K+IM1tPKBw=; b=fbsb3779+ZGd9fnbyyfK/JjJm9q/AxEwzyveVPAwv/TYK7idtuUflcwgwnHeWsXXYY rG0MKJZCoQEJ679ioS1N+9H05javd2ZjPXRrnm46nxxQzNAm/1Kb4/orSf0k3yA3IbFe JzSRPmpHC8qixL8Nfp02P4BQc+Ql9+G0UIZFUTV9pVCUuu0r+Cc4XeEBFj+tNzuDBqoo 4biZ5qRXX7nS4WRPKTBxJNW/7gdE5lospkj30un5Z5oBffV2L5VGn/husVIMUKkgc4Dx ARVlk8gLkzn1J+NlCBmNJVqMIvmdEx7pArDWOt3R4sTDb8ERORFi+F7e7Kpdnaz3k2eu du0g== X-Gm-Message-State: AOPr4FWRX/QY2ukCFYinD3zKB0AEUCh+IXja+dR/lbbqDOJojjuMQyoYld2WCPfWhJkbFQ== X-Received: by 10.194.5.103 with SMTP id r7mr32723670wjr.0.1463389991170; Mon, 16 May 2016 02:13:11 -0700 (PDT) Received: from donizetti.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id c85sm16790854wmd.0.2016.05.16.02.13.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 02:13:09 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 16 May 2016 11:12:59 +0200 Message-Id: <1463389979-16348-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.5.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH] target-i386: key sfence availability on CPUID_SSE, not CPUID_SSE2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, qemu-stable@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Stefan Weil Reviewed-by: Richard Henderson --- 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)