public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: x86: Disable SSE4A
       [not found] <20251027114059.GJ3245006@noisy.programming.kicks-ass.net>
@ 2025-10-27 12:40 ` Borislav Petkov
  2025-10-28  4:19   ` Arisu Tachibana
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2025-10-27 12:40 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: x86, Leyvi Rose, Samuel Holland, Christian König,
	Masami Hiramatsu, lkml

On Mon, Oct 27, 2025 at 12:40:59PM +0100, Peter Zijlstra wrote:
> Leyvi Rose reported that his X86_NATIVE_CPU=y build is failing because
> our instruction decoder doesn't support SSE4A and the AMDGPU code seems
> to be generating those with his compiler of choice (CLANG+LTO).
> 
> Now, our normal build flags disable SSE MMX SSE2 3DNOW AVX, but then
> CC_FLAGS_FPU re-enable SSE SSE2.
> 
> Since nothing mentions SSE3 or SSE4, I'm assuming that -msse (or its
> negative) control all SSE variants -- but why then explicitly enumerate
> SSE2 ?
> 
> Anyway, until the instruction decoder gets fixed, explicitly disallow
> SSE4A (an AMD specific SSE4 extension).
> 
> Fixes: ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 4db7e4bf69f5..8fbff3106c56 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -75,7 +75,7 @@ export BITS
>  #
>  #    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
>  #
> -KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
> +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a
>  KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
>  KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2

Acked-by: Borislav Petkov (AMD) <bp@alien8.de>

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* Re: x86: Disable SSE4A
  2025-10-27 12:40 ` x86: Disable SSE4A Borislav Petkov
@ 2025-10-28  4:19   ` Arisu Tachibana
  2025-10-28  8:32     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Arisu Tachibana @ 2025-10-28  4:19 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Borislav Petkov, x86, Leyvi Rose, Samuel Holland,
	Christian König, Masami Hiramatsu, lkml

On Mon, Oct 27, 2025 at 9:41 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Mon, Oct 27, 2025 at 12:40:59PM +0100, Peter Zijlstra wrote:
> > Leyvi Rose reported that his X86_NATIVE_CPU=y build is failing because
> > our instruction decoder doesn't support SSE4A and the AMDGPU code seems
> > to be generating those with his compiler of choice (CLANG+LTO).
> >
> > Now, our normal build flags disable SSE MMX SSE2 3DNOW AVX, but then
> > CC_FLAGS_FPU re-enable SSE SSE2.
> >
> > Since nothing mentions SSE3 or SSE4, I'm assuming that -msse (or its
> > negative) control all SSE variants -- but why then explicitly enumerate
> > SSE2 ?
> >
> > Anyway, until the instruction decoder gets fixed, explicitly disallow
> > SSE4A (an AMD specific SSE4 extension).
> >
> > Fixes: ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> >
> > diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> > index 4db7e4bf69f5..8fbff3106c56 100644
> > --- a/arch/x86/Makefile
> > +++ b/arch/x86/Makefile
> > @@ -75,7 +75,7 @@ export BITS
> >  #
> >  #    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
> >  #
> > -KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
> > +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a
> >  KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
> >  KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
>
> Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
>

 Acked-by: Arisu Tachibana <arisu.tachibana@miraclelinux.com>


--
thanks,
arisut

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

* Re: x86: Disable SSE4A
  2025-10-28  4:19   ` Arisu Tachibana
@ 2025-10-28  8:32     ` Christian König
  2025-10-28 15:37       ` Harry Wentland
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2025-10-28  8:32 UTC (permalink / raw)
  To: Arisu Tachibana, Peter Zijlstra
  Cc: Borislav Petkov, x86, Leyvi Rose, Samuel Holland,
	Masami Hiramatsu, lkml, Wentland, Harry, Li, Sun peng (Leo),
	Rodrigo Siqueira

Adding AMDs DC people (the component which enables FPU in amdgpu) on CC.

On 10/28/25 05:19, Arisu Tachibana wrote:
> On Mon, Oct 27, 2025 at 9:41 PM Borislav Petkov <bp@alien8.de> wrote:
>>
>> On Mon, Oct 27, 2025 at 12:40:59PM +0100, Peter Zijlstra wrote:
>>> Leyvi Rose reported that his X86_NATIVE_CPU=y build is failing because
>>> our instruction decoder doesn't support SSE4A and the AMDGPU code seems
>>> to be generating those with his compiler of choice (CLANG+LTO).
>>>
>>> Now, our normal build flags disable SSE MMX SSE2 3DNOW AVX, but then
>>> CC_FLAGS_FPU re-enable SSE SSE2.
>>>
>>> Since nothing mentions SSE3 or SSE4, I'm assuming that -msse (or its
>>> negative) control all SSE variants -- but why then explicitly enumerate
>>> SSE2 ?
>>>
>>> Anyway, until the instruction decoder gets fixed, explicitly disallow
>>> SSE4A (an AMD specific SSE4 extension).
>>>
>>> Fixes: ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
>>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>>> ---
>>>
>>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>>> index 4db7e4bf69f5..8fbff3106c56 100644
>>> --- a/arch/x86/Makefile
>>> +++ b/arch/x86/Makefile
>>> @@ -75,7 +75,7 @@ export BITS
>>>  #
>>>  #    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
>>>  #
>>> -KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
>>> +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a
>>>  KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
>>>  KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
>>
>> Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
>>
> 
>  Acked-by: Arisu Tachibana <arisu.tachibana@miraclelinux.com>

Acked-by: Christian König <christian.koenig@amd.com>

> 
> 
> --
> thanks,
> arisut


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

* Re: x86: Disable SSE4A
  2025-10-28  8:32     ` Christian König
@ 2025-10-28 15:37       ` Harry Wentland
  0 siblings, 0 replies; 4+ messages in thread
From: Harry Wentland @ 2025-10-28 15:37 UTC (permalink / raw)
  To: Christian König, Arisu Tachibana, Peter Zijlstra
  Cc: Borislav Petkov, x86, Leyvi Rose, Samuel Holland,
	Masami Hiramatsu, lkml, Li, Sun peng (Leo), Rodrigo Siqueira



On 2025-10-28 04:32, Christian König wrote:
> Adding AMDs DC people (the component which enables FPU in amdgpu) on CC.
> 
> On 10/28/25 05:19, Arisu Tachibana wrote:
>> On Mon, Oct 27, 2025 at 9:41 PM Borislav Petkov <bp@alien8.de> wrote:
>>>
>>> On Mon, Oct 27, 2025 at 12:40:59PM +0100, Peter Zijlstra wrote:
>>>> Leyvi Rose reported that his X86_NATIVE_CPU=y build is failing because
>>>> our instruction decoder doesn't support SSE4A and the AMDGPU code seems
>>>> to be generating those with his compiler of choice (CLANG+LTO).
>>>>
>>>> Now, our normal build flags disable SSE MMX SSE2 3DNOW AVX, but then
>>>> CC_FLAGS_FPU re-enable SSE SSE2.
>>>>
>>>> Since nothing mentions SSE3 or SSE4, I'm assuming that -msse (or its
>>>> negative) control all SSE variants -- but why then explicitly enumerate
>>>> SSE2 ?
>>>>
>>>> Anyway, until the instruction decoder gets fixed, explicitly disallow
>>>> SSE4A (an AMD specific SSE4 extension).
>>>>
>>>> Fixes: ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
>>>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>>>> ---
>>>>
>>>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>>>> index 4db7e4bf69f5..8fbff3106c56 100644
>>>> --- a/arch/x86/Makefile
>>>> +++ b/arch/x86/Makefile
>>>> @@ -75,7 +75,7 @@ export BITS
>>>>  #
>>>>  #    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
>>>>  #
>>>> -KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
>>>> +KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a
>>>>  KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
>>>>  KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
>>>
>>> Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
>>>
>>
>>  Acked-by: Arisu Tachibana <arisu.tachibana@miraclelinux.com>
> 
> Acked-by: Christian König <christian.koenig@amd.com>
> 

Acked-by: Harry Wentland <harry.wentland@amd.com>

Harry

>>
>>
>> --
>> thanks,
>> arisut
> 


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

end of thread, other threads:[~2025-10-28 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251027114059.GJ3245006@noisy.programming.kicks-ass.net>
2025-10-27 12:40 ` x86: Disable SSE4A Borislav Petkov
2025-10-28  4:19   ` Arisu Tachibana
2025-10-28  8:32     ` Christian König
2025-10-28 15:37       ` Harry Wentland

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