Skip to contentSkip to conversation

Disable generation of sse3 instructions in kernel build.

PATCH Michael S. Zick 2 participants 3 messages May 10, 2009 – May 12, 2009 1 message not in the archive x86

lore
Share & tools
lore
#0 lore raw

Ref: 2.6.30-rcX
The option to disable sse3 instructions needs to be added to build system for x86. Otherwise strange and mysterious things happen (tm).

Like (also attached):

arch/x86/Makefile +1 -1
index 8c86b72..3c0df6f 100644
@@ -103,7 +103,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
 #
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 # prevent gcc from generating any FP code by mistake
-KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-sse3 -mno-3dnow,)
 
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
arch/x86/Makefile +1 -1
index 8c86b72..3c0df6f 100644
@@ -103,7 +103,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
 #
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 # prevent gcc from generating any FP code by mistake
-KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-sse3 -mno-3dnow,)
 
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
#1 lore raw
Quoted 3 lines · Michael S. Zick

Ref: 2.6.30-rcX
The option to disable sse3 instructions needs to be added to build system for x86. Otherwise strange and mysterious things happen (tm).

Can you please expand a little bit? With what compiler version did you see problems? And in what area did they happen?

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

[sending again with linux-kernel cc. Please don't drop cc list like this]

Quoted 7 lines · you
Quoted 6 lines
Quoted 3 lines · Michael S. Zick

Ref: 2.6.30-rcX
The option to disable sse3 instructions needs to be added to build system for x86. Otherwise strange and mysterious things happen (tm).

Quoted 5 lines
Quoted 3 lines

Can you please expand a little bit? With what compiler version did you see problems? And in what area did they happen?

Sorry about the comment - it was based on the preceding code comment - perhaps now outdated.

It's not outdated. I wrote it originally.

Quoted 6 lines

Once upon a time, the kernel did not touch the co-processor registers (any style of them) on x86 - see the preceding code comment and existing contents of the flag line being changed.

If the kernel now saves/restores the co-processor registers - then only the code comment needs to be changed and the existing contents of the flag line be brought into line.

No the kernel doesn't do that. At least not automatically.

The reason these options are there is that at least some older gcc versions had corner cases where they could generate instructions to touch MMX or SSE registers even when the code doesn't use any floating point. That's why these options were originally added to make sure this doesn't happen in the kernel, where it would corrupt user data or crash.

But sse3 is just an extension of sse2 and when sse2 is enabled then sse3 should be implicitely too. Unless some gcc version is really broken in this regard, but I hope not. That is why I was asking if you've actually seen failures from this.

Apparently you did not though. So your patch is not needed.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.