All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexander Potapenko <glider@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	kasan-dev <kasan-dev@googlegroups.com>
Subject: Re: [PATCH] x86: prevent gcc from emitting SSE into boot code
Date: Mon, 27 Jun 2016 20:53:03 +0200	[thread overview]
Message-ID: <20160627185303.GA1212@gmail.com> (raw)
In-Reply-To: <CACT4Y+b8WC8NaWgtjbeY+Ach8ZOyy-r_dvzWrNU34fSMRhuHFQ@mail.gmail.com>


* 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

  reply	other threads:[~2016-06-27 19:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 17:37 [PATCH] x86: prevent gcc from emitting SSE into boot code Dmitry Vyukov
2016-06-22 20:17 ` Dmitry Vyukov
2016-06-27 18:53   ` Ingo Molnar [this message]
2016-06-27 18:58     ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160627185303.GA1212@gmail.com \
    --to=mingo@kernel.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.