Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432227 > unrolled thread

Re: [PATCH] x86: prevent gcc from emitting SSE into boot code

Started byIngo Molnar <mingo@kernel.org>
First post2016-06-27 21:10 +0200
Last post2016-06-27 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] x86: prevent gcc from emitting SSE into boot code Ingo Molnar <mingo@kernel.org> - 2016-06-27 21:10 +0200

#1432227 — Re: [PATCH] x86: prevent gcc from emitting SSE into boot code

FromIngo Molnar <mingo@kernel.org>
Date2016-06-27 21:10 +0200
SubjectRe: [PATCH] x86: prevent gcc from emitting SSE into boot code
Message-ID<rOJVg-454-19@gated-at.bofh.it>
* Dmitry Vyukov <dvyukov@google.com> wrote:

> On Wed, Jun 22, 2016 at 7:37 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> > Latest gcc manages to emit MOVDQA into boot code
> > which leads to crashes. Add more -mno-see flags.

Which GCC version is that?

> >
> > Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> > ---
> >  arch/x86/boot/compressed/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> > index f135688..7eaafb8 100644
> > --- a/arch/x86/boot/compressed/Makefile
> > +++ b/arch/x86/boot/compressed/Makefile
> > @@ -31,7 +31,7 @@ KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
> >  cflags-$(CONFIG_X86_32) := -march=i386
> >  cflags-$(CONFIG_X86_64) := -mcmodel=small
> >  KBUILD_CFLAGS += $(cflags-y)
> > -KBUILD_CFLAGS += -mno-mmx -mno-sse
> > +KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-sse3
> >  KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
> >  KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
> >
> > --
> > 2.8.0.rc3.226.g39d4020
> 
> 
> I withdraw this patch.
> 
> From off-list discussion:
> 
> "-mno-sse alone should disable all SSE/AVX instructions. If not,
> please file a GCC bug report".

So the GCC documentation says:

 -mmmx
 -mno-mmx
 -msse
 -mno-sse
 -msse2
 -mno-sse2
 -msse3
 -mno-sse3
 -m3dnow
 -mno-3dnow
    These switches enable or disable the use of built-in functions that allow 
    direct access to the MMX, SSE, SSE2, SSE3 and 3Dnow extensions of the 
    instruction set.

Technically -mno-mmx won't turn off SSE instructions because they are independent. 
Do we really want to rely on an undocumented property of -mno-sse (clearly broken 
in at least one released GCC version), especially as the fix is so easy?

Thanks,

	Ingo

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web