From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F322C7618A for ; Mon, 20 Mar 2023 15:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231529AbjCTPEM (ORCPT ); Mon, 20 Mar 2023 11:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjCTPDu (ORCPT ); Mon, 20 Mar 2023 11:03:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 899112E80A for ; Mon, 20 Mar 2023 07:59:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 175C3B80EC2 for ; Mon, 20 Mar 2023 14:59:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DFB4C4339C; Mon, 20 Mar 2023 14:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1679324339; bh=EndodniU0xg5sVGX3JEzoYq0PX+ns28MPsaYpfO0T0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSFm2LUt7utpEhgMUHH7r9GcC+xqHEmxXM9ZcJpm5IqtHwKng3Q8fMO1SNaCfNqhi /n9Ima5urzrR5Q/B3Q8rtL32Samvqlo7BZstkvela/0P5sc+mwS0UTwwxrXJ2Ay2ZY NiOIOo88HDmQgzhmH7iSRhkIvM2JQCNEfTq5hNEE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Gow , =?UTF-8?q?Sergio=20Gonz=C3=A1lez=20Collado?= , Richard Weinberger , Sasha Levin Subject: [PATCH 4.19 23/36] rust: arch/um: Disable FP/SIMD instruction to match x86 Date: Mon, 20 Mar 2023 15:54:49 +0100 Message-Id: <20230320145425.108532649@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230320145424.191578432@linuxfoundation.org> References: <20230320145424.191578432@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Gow [ Upstream commit 8849818679478933dd1d9718741f4daa3f4e8b86 ] The kernel disables all SSE and similar FP/SIMD instructions on x86-based architectures (partly because we shouldn't be using floats in the kernel, and partly to avoid the need for stack alignment, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 ) UML does not do the same thing, which isn't in itself a problem, but does add to the list of differences between UML and "normal" x86 builds. In addition, there was a crash bug with LLVM < 15 / rustc < 1.65 when building with SSE, so disabling it fixes rust builds with earlier compiler versions, see: https://github.com/Rust-for-Linux/linux/pull/881 Signed-off-by: David Gow Reviewed-by: Sergio González Collado Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/x86/Makefile.um | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um index 91085a08de6cb..3694beda02c8a 100644 --- a/arch/x86/Makefile.um +++ b/arch/x86/Makefile.um @@ -1,6 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 core-y += arch/x86/crypto/ +# +# Disable SSE and other FP/SIMD instructions to match normal x86 +# +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx +KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 + ifeq ($(CONFIG_X86_32),y) START := 0x8048000 -- 2.39.2