From: SeongJae Park <sj@kernel.org>
To: Sasha Levin <sashal@kernel.org>, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
"David Gow" <davidgow@google.com>,
"Sergio González Collado" <sergio.collado@gmail.com>,
"Richard Weinberger" <richard@nod.at>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org
Subject: Re: [PATCH AUTOSEL 6.1 04/13] rust: arch/um: Disable FP/SIMD instruction to match x86
Date: Tue, 25 Apr 2023 00:01:18 +0000 [thread overview]
Message-ID: <20230425000118.45838-1-sj@kernel.org> (raw)
In-Reply-To: <20230314124325.470931-4-sashal@kernel.org>
Hello Sasha and Greg,
On Tue, 14 Mar 2023 08:43:16 -0400 Sasha Levin <sashal@kernel.org> wrote:
> 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>
There is a followup fix of this patch that merged into the mainline by commit
a3046a618a28 ("um: Only disable SSE on clang to work around old GCC bugs"), but
it has not added to 6.1.y so far. Without it, compiling on some setup using an
old version of gcc fails, as the followup is also mentioning. I also confirmed
the issue can be reproduced on latest 6.1.y.
Could you please add the followup fix to 6.1.y? I confirmed the commit can be
cleanly cherry-picked on latest 6.1.y, and fixes the issue as expected.
Thanks,
SJ
> ---
> 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-04-25 0:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 12:43 [PATCH AUTOSEL 6.1 01/13] mmc: atmel-mci: fix race between stop command and start of next command Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 02/13] soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 03/13] jffs2: correct logic when creating a hole in jffs2_write_begin Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 04/13] rust: arch/um: Disable FP/SIMD instruction to match x86 Sasha Levin
2023-04-25 0:01 ` SeongJae Park [this message]
2023-04-27 8:30 ` Greg KH
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 05/13] ext4: fail ext4_iget if special inode unallocated Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 06/13] ext4: update s_journal_inum if it changes after journal replay Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 07/13] ext4: fix task hung in ext4_xattr_delete_inode Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 08/13] drm/amdkfd: Fix an illegal memory access Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 09/13] net/9p: fix bug in client create for .L Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 10/13] LoongArch: Only call get_timer_irq() once in constant_clockevent_init() Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 11/13] sh: intc: Avoid spurious sizeof-pointer-div warning Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 12/13] drm/amdgpu: fix ttm_bo calltrace warning in psp_hw_fini Sasha Levin
2023-03-14 12:43 ` [PATCH AUTOSEL 6.1 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=20230425000118.45838-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=davidgow@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard@nod.at \
--cc=sashal@kernel.org \
--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