From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "David Gow" <davidgow@google.com>,
"Sergio González Collado" <sergio.collado@gmail.com>,
"Richard Weinberger" <richard@nod.at>,
"Sasha Levin" <sashal@kernel.org>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org
Subject: [PATCH AUTOSEL 6.2 04/13] rust: arch/um: Disable FP/SIMD instruction to match x86
Date: Tue, 14 Mar 2023 08:42:56 -0400 [thread overview]
Message-ID: <20230314124305.470657-4-sashal@kernel.org> (raw)
In-Reply-To: <20230314124305.470657-1-sashal@kernel.org>
From: David Gow <davidgow@google.com>
[ 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 <davidgow@google.com>
Reviewed-by: Sergio González Collado <sergio.collado@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/Makefile.um | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index b3c1ae084180d..d2e95d1d4db77 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
next prev parent reply other threads:[~2023-03-14 12:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 12:42 [PATCH AUTOSEL 6.2 01/13] mmc: atmel-mci: fix race between stop command and start of next command Sasha Levin
2023-03-14 12:42 ` [PATCH AUTOSEL 6.2 02/13] soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported Sasha Levin
2023-03-14 12:42 ` [PATCH AUTOSEL 6.2 03/13] jffs2: correct logic when creating a hole in jffs2_write_begin Sasha Levin
2023-03-14 12:42 ` Sasha Levin [this message]
2023-03-14 12:42 ` [PATCH AUTOSEL 6.2 05/13] ext4: fail ext4_iget if special inode unallocated Sasha Levin
2023-03-14 12:42 ` [PATCH AUTOSEL 6.2 06/13] ext4: update s_journal_inum if it changes after journal replay Sasha Levin
2023-03-14 12:42 ` [PATCH AUTOSEL 6.2 07/13] ext4: fix task hung in ext4_xattr_delete_inode Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 08/13] drm/amdkfd: Fix an illegal memory access Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 09/13] net/9p: fix bug in client create for .L Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 10/13] LoongArch: Only call get_timer_irq() once in constant_clockevent_init() Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 11/13] sh: intc: Avoid spurious sizeof-pointer-div warning Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 12/13] drm/amdgpu: fix ttm_bo calltrace warning in psp_hw_fini Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.2 13/13] drm/amd/display: fix shift-out-of-bounds in CalculateVMAndRowBytes Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230314124305.470657-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davidgow@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard@nod.at \
--cc=sergio.collado@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).