All of lore.kernel.org
 help / color / mirror / Atom feed
* Disable generation of sse3 instructions in kernel build.
@ 2009-05-10  0:03 Michael S. Zick
  2009-05-11 21:16 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Zick @ 2009-05-10  0:03 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

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):
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 8c86b72..3c0df6f 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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)

[-- Attachment #2: 00-fix-kbuild-flags.patch --]
[-- Type: text/x-diff, Size: 515 bytes --]

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 8c86b72..3c0df6f 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Disable generation of sse3 instructions in kernel build.
  2009-05-10  0:03 Disable generation of sse3 instructions in kernel build Michael S. Zick
@ 2009-05-11 21:16 ` Andi Kleen
       [not found]   ` <200905111847.46187.lkml@morethan.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2009-05-11 21:16 UTC (permalink / raw)
  To: lkml; +Cc: linux-kernel

"Michael S. Zick" <lkml@morethan.org> writes:

> 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
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Disable generation of sse3 instructions in kernel build.
       [not found]   ` <200905111847.46187.lkml@morethan.org>
@ 2009-05-12  6:51     ` Andi Kleen
  0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2009-05-12  6:51 UTC (permalink / raw)
  To: Michael S. Zick; +Cc: linux-kernel

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

> On Mon May 11 2009, you wrote:
> > "Michael S. Zick" <lkml@morethan.org> writes:
> > 
> > > 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?
> > 
> 
> Sorry about the comment - it was based on the preceding code comment - perhaps now outdated.

It's not outdated. I wrote it originally.

> 
> 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

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-12  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-10  0:03 Disable generation of sse3 instructions in kernel build Michael S. Zick
2009-05-11 21:16 ` Andi Kleen
     [not found]   ` <200905111847.46187.lkml@morethan.org>
2009-05-12  6:51     ` Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.