From patchwork Tue Mar 6 20:50:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 10262921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DEFE602BD for ; Tue, 6 Mar 2018 20:50:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30201291B2 for ; Tue, 6 Mar 2018 20:50:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25030291BC; Tue, 6 Mar 2018 20:50:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25C1291BC for ; Tue, 6 Mar 2018 20:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753871AbeCFUuq (ORCPT ); Tue, 6 Mar 2018 15:50:46 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38408 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753821AbeCFUup (ORCPT ); Tue, 6 Mar 2018 15:50:45 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 616F74040074 for ; Tue, 6 Mar 2018 20:50:45 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 00C7D2166BB2; Tue, 6 Mar 2018 20:50:43 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Tue, 06 Mar 2018 21:50:06 +0100 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: kvm@vger.kernel.org Cc: Paolo Bonzini Subject: [kvm-unit-tests PATCH] x86: prevent GCC from using sse2 instructions Date: Tue, 6 Mar 2018 21:50:01 +0100 Message-Id: <20180306205001.31698-1-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Mar 2018 20:50:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 06 Mar 2018 20:50:45 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GCC 8 emitted MOVDQU when compiling vmx.elf, but we do not enable CR4.OSFXSR in that test, so the instruction throws #UD. This patch forbids all sse2 instructions, instead of enabling CR4.OSFXSR, as I think it's better to keep the environment minimal. Signed-off-by: Radim Krčmář --- This probably hit a minor KVM bug: the instruction was "f3 0f 6f 41 28", but KVM reported that #UD happened on "f3 0f 6f 41". --- x86/Makefile.x86_64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64 index 623fc5b37726..6caa3a8863f1 100644 --- a/x86/Makefile.x86_64 +++ b/x86/Makefile.x86_64 @@ -1,7 +1,7 @@ cstart.o = $(TEST_DIR)/cstart64.o bits = 64 ldarch = elf64-x86-64 -COMMON_CFLAGS += -mno-red-zone +COMMON_CFLAGS += -mno-red-zone -mno-sse2 cflatobjs += lib/x86/setjmp64.o cflatobjs += lib/x86/intel-iommu.o