public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [tip:x86/urgent] x86-64, build: Always pass in -mno-sse
@ 2013-12-04  1:42 tip-bot for H. Peter Anvin
  2013-12-04  8:54 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: tip-bot for H. Peter Anvin @ 2013-12-04  1:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, tglx, hpa, hjl.tools, kevin.b.smith

Commit-ID:  5551a34e5aeab868f8d37f70d8754868921b4ee5
Gitweb:     http://git.kernel.org/tip/5551a34e5aeab868f8d37f70d8754868921b4ee5
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Wed, 20 Nov 2013 13:31:49 -0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 3 Dec 2013 17:40:22 -0800

x86-64, build: Always pass in -mno-sse

Always pass in the -mno-sse argument, regardless if
-preferred-stack-boundary is supported.  We never want to generate SSE
instructions in the kernel unless we *really* know what we're doing.

According to H. J. Lu, any version of gcc new enough that we support
it at all should handle the -mno-sse option, so just add it
unconditionally.

Reported-by: Kevin B. Smith <kevin.b.smith@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: H. J. Lu <hjl.tools@gmail.com>
Link: http://lkml.kernel.org/n/tip-j21wzqv790q834n7yc6g80j1@git.kernel.org
Cc: <stable@vger.kernel.org> # build fix only
---
 arch/x86/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 41250fb..eda00f9 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -31,6 +31,9 @@ ifeq ($(CONFIG_X86_32),y)
 
         KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
 
+        # Don't autogenerate SSE instructions
+	KBUILD_CFLAGS += -mno-sse
+
         # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
         # with nonstandard options
         KBUILD_CFLAGS += -fno-pic
@@ -57,8 +60,11 @@ else
         KBUILD_AFLAGS += -m64
         KBUILD_CFLAGS += -m64
 
+        # Don't autogenerate SSE instructions
+	KBUILD_CFLAGS += -mno-sse
+
 	# Use -mpreferred-stack-boundary=3 if supported.
-	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
+	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
 
         # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
         cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)

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

* Re: [tip:x86/urgent] x86-64, build: Always pass in -mno-sse
  2013-12-04  1:42 [tip:x86/urgent] x86-64, build: Always pass in -mno-sse tip-bot for H. Peter Anvin
@ 2013-12-04  8:54 ` Ingo Molnar
  2013-12-04 15:31   ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2013-12-04  8:54 UTC (permalink / raw)
  To: hpa, linux-kernel, tglx, hpa, kevin.b.smith, hjl.tools; +Cc: linux-tip-commits


* tip-bot for H. Peter Anvin <tipbot@zytor.com> wrote:

> Commit-ID:  5551a34e5aeab868f8d37f70d8754868921b4ee5
> Gitweb:     http://git.kernel.org/tip/5551a34e5aeab868f8d37f70d8754868921b4ee5
> Author:     H. Peter Anvin <hpa@linux.intel.com>
> AuthorDate: Wed, 20 Nov 2013 13:31:49 -0800
> Committer:  H. Peter Anvin <hpa@linux.intel.com>
> CommitDate: Tue, 3 Dec 2013 17:40:22 -0800
> 
> x86-64, build: Always pass in -mno-sse
> 
> Always pass in the -mno-sse argument, regardless if
> -preferred-stack-boundary is supported.  We never want to generate SSE
> instructions in the kernel unless we *really* know what we're doing.
> 
> According to H. J. Lu, any version of gcc new enough that we support
> it at all should handle the -mno-sse option, so just add it
> unconditionally.
> 
> Reported-by: Kevin B. Smith <kevin.b.smith@intel.com>
> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
> Cc: H. J. Lu <hjl.tools@gmail.com>
> Link: http://lkml.kernel.org/n/tip-j21wzqv790q834n7yc6g80j1@git.kernel.org
> Cc: <stable@vger.kernel.org> # build fix only
> ---
>  arch/x86/Makefile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 41250fb..eda00f9 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -31,6 +31,9 @@ ifeq ($(CONFIG_X86_32),y)
>  
>          KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
>  
> +        # Don't autogenerate SSE instructions
> +	KBUILD_CFLAGS += -mno-sse
> +
>          # Never want PIC in a 32-bit kernel, prevent breakage with GCC built
>          # with nonstandard options
>          KBUILD_CFLAGS += -fno-pic
> @@ -57,8 +60,11 @@ else
>          KBUILD_AFLAGS += -m64
>          KBUILD_CFLAGS += -m64
>  
> +        # Don't autogenerate SSE instructions
> +	KBUILD_CFLAGS += -mno-sse
> +
>  	# Use -mpreferred-stack-boundary=3 if supported.
> -	KBUILD_CFLAGS += $(call cc-option,-mno-sse -mpreferred-stack-boundary=3)
> +	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
>  
>          # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
>          cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)

Just a detail I noticed: in kbuild we intentionally use 8 spaces for 
tabs in Makefiles and only use tabs for commands where tabs are 
required.

The above code introduces tabs in the middle of 8-space sequences. It 
works but is inconsistent.

Thanks,

	Ingo

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

* Re: [tip:x86/urgent] x86-64, build: Always pass in -mno-sse
  2013-12-04  8:54 ` Ingo Molnar
@ 2013-12-04 15:31   ` H. Peter Anvin
  2013-12-04 15:37     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2013-12-04 15:31 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel, tglx, hpa, kevin.b.smith, hjl.tools
  Cc: linux-tip-commits

I can regenerate the patch if you want.

Ingo Molnar <mingo@kernel.org> wrote:
>
>* tip-bot for H. Peter Anvin <tipbot@zytor.com> wrote:
>
>> Commit-ID:  5551a34e5aeab868f8d37f70d8754868921b4ee5
>> Gitweb:    
>http://git.kernel.org/tip/5551a34e5aeab868f8d37f70d8754868921b4ee5
>> Author:     H. Peter Anvin <hpa@linux.intel.com>
>> AuthorDate: Wed, 20 Nov 2013 13:31:49 -0800
>> Committer:  H. Peter Anvin <hpa@linux.intel.com>
>> CommitDate: Tue, 3 Dec 2013 17:40:22 -0800
>> 
>> x86-64, build: Always pass in -mno-sse
>> 
>> Always pass in the -mno-sse argument, regardless if
>> -preferred-stack-boundary is supported.  We never want to generate
>SSE
>> instructions in the kernel unless we *really* know what we're doing.
>> 
>> According to H. J. Lu, any version of gcc new enough that we support
>> it at all should handle the -mno-sse option, so just add it
>> unconditionally.
>> 
>> Reported-by: Kevin B. Smith <kevin.b.smith@intel.com>
>> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
>> Cc: H. J. Lu <hjl.tools@gmail.com>
>> Link:
>http://lkml.kernel.org/n/tip-j21wzqv790q834n7yc6g80j1@git.kernel.org
>> Cc: <stable@vger.kernel.org> # build fix only
>> ---
>>  arch/x86/Makefile | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>> index 41250fb..eda00f9 100644
>> --- a/arch/x86/Makefile
>> +++ b/arch/x86/Makefile
>> @@ -31,6 +31,9 @@ ifeq ($(CONFIG_X86_32),y)
>>  
>>          KBUILD_CFLAGS += -msoft-float -mregparm=3
>-freg-struct-return
>>  
>> +        # Don't autogenerate SSE instructions
>> +	KBUILD_CFLAGS += -mno-sse
>> +
>>          # Never want PIC in a 32-bit kernel, prevent breakage with
>GCC built
>>          # with nonstandard options
>>          KBUILD_CFLAGS += -fno-pic
>> @@ -57,8 +60,11 @@ else
>>          KBUILD_AFLAGS += -m64
>>          KBUILD_CFLAGS += -m64
>>  
>> +        # Don't autogenerate SSE instructions
>> +	KBUILD_CFLAGS += -mno-sse
>> +
>>  	# Use -mpreferred-stack-boundary=3 if supported.
>> -	KBUILD_CFLAGS += $(call cc-option,-mno-sse
>-mpreferred-stack-boundary=3)
>> +	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
>>  
>>          # FIXME - should be integrated in Makefile.cpu
>(Makefile_32.cpu)
>>          cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
>
>Just a detail I noticed: in kbuild we intentionally use 8 spaces for 
>tabs in Makefiles and only use tabs for commands where tabs are 
>required.
>
>The above code introduces tabs in the middle of 8-space sequences. It 
>works but is inconsistent.
>
>Thanks,
>
>	Ingo

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

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

* Re: [tip:x86/urgent] x86-64, build: Always pass in -mno-sse
  2013-12-04 15:31   ` H. Peter Anvin
@ 2013-12-04 15:37     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2013-12-04 15:37 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, tglx, hpa, kevin.b.smith, hjl.tools,
	linux-tip-commits


* H. Peter Anvin <hpa@zytor.com> wrote:

> I can regenerate the patch if you want.

No need, I think a separate cleanup patch might be better (in a 
non-urgent branch), because currently a number of other lines in 
arch/x86/Makefile are violating this kbuild convention as well.

Thanks,

	Ingo

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

end of thread, other threads:[~2013-12-04 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04  1:42 [tip:x86/urgent] x86-64, build: Always pass in -mno-sse tip-bot for H. Peter Anvin
2013-12-04  8:54 ` Ingo Molnar
2013-12-04 15:31   ` H. Peter Anvin
2013-12-04 15:37     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox