Patch "um: Only disable SSE on clang to work around old GCC bugs" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    um: Only disable SSE on clang to work around old GCC bugs

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     um-only-disable-sse-on-clang-to-work-around-old-gcc-bugs.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From a3046a618a284579d1189af8711765f553eed707 Mon Sep 17 00:00:00 2001
From: David Gow <davidgow@xxxxxxxxxx>
Date: Sat, 18 Mar 2023 12:15:54 +0800
Subject: um: Only disable SSE on clang to work around old GCC bugs

From: David Gow <davidgow@xxxxxxxxxx>

commit a3046a618a284579d1189af8711765f553eed707 upstream.

As part of the Rust support for UML, we disable SSE (and similar flags)
to match the normal x86 builds. This both makes sense (we ideally want a
similar configuration to x86), and works around a crash bug with SSE
generation under Rust with LLVM.

However, this breaks compiling stdlib.h under gcc < 11, as the x86_64
ABI requires floating-point return values be stored in an SSE register.
gcc 11 fixes this by only doing register allocation when a function is
actually used, and since we never use atof(), it shouldn't be a problem:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652

Nevertheless, only disable SSE on clang setups, as that's a simple way
of working around everyone's bugs.

Fixes: 884981867947 ("rust: arch/um: Disable FP/SIMD instruction to match x86")
Reported-by: Roberto Sassu <roberto.sassu@xxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/linux-um/6df2ecef9011d85654a82acd607fdcbc93ad593c.camel@xxxxxxxxxxxxxxx/
Tested-by: Roberto Sassu <roberto.sassu@xxxxxxxxxxxxxxx>
Tested-by: SeongJae Park <sj@xxxxxxxxxx>
Signed-off-by: David Gow <davidgow@xxxxxxxxxx>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx>
Tested-by: Arthur Grillo <arthurgrillo@xxxxxxxxxx>
Signed-off-by: Richard Weinberger <richard@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/x86/Makefile.um |    5 +++++
 1 file changed, 5 insertions(+)

--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -3,9 +3,14 @@ core-y += arch/x86/crypto/
 
 #
 # Disable SSE and other FP/SIMD instructions to match normal x86
+# This is required to work around issues in older LLVM versions, but breaks
+# GCC versions < 11. See:
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99652
 #
+ifeq ($(CONFIG_CC_IS_CLANG),y)
 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
+endif
 
 ifeq ($(CONFIG_X86_32),y)
 START := 0x8048000


Patches currently in stable-queue which might be from davidgow@xxxxxxxxxx are

queue-6.2/um-only-disable-sse-on-clang-to-work-around-old-gcc-bugs.patch
queue-6.2/rust-arch-um-disable-fp-simd-instruction-to-match-x86.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux