linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Cc: X86 ML <x86@kernel.org>,
	jpa@kernelbug.mail.kapsi.fi, Dave Hansen <dave.hansen@intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest
Date: Tue, 23 Jun 2020 20:47:26 +0200	[thread overview]
Message-ID: <20200623184726.GI32590@zn.tnic> (raw)
In-Reply-To: <CALCETrXfaEr9OGc5EDpxnhRZxFk5YZBBNVH-N32Eg8V8diwqXg@mail.gmail.com>

On Tue, Jun 23, 2020 at 11:22:53AM -0700, Andy Lutomirski wrote:
> See that same atrocious bug report.  It's the insane interaction
> between -mno-sse2 and -mpreferred-stack-boundary.  So you need to
> cc-option them both?  Or just stick with a compiler version check, I
> guess.

Yes, it was the interaction. This below seems to work. Note the "-msse"
in the first argument of cc-option which causes the compiler to error
out with

/dev/null:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12

Adding Nick for the clang side.

@Nick: I'm simply going to add -msse2 with cc-option.

Anyway, lemme test this thing a bit more.

Thx.

---

# CFLAGS for compiling floating point code inside the kernel. x86/Makefile turns
# off the generation of FPU/SSE* instructions for kernel proper but FPU_FLAGS
# get appended last to CFLAGS and thus override those previous compiler options.
#
FPU_CFLAGS := -mhard-float -msse
FPU_CFLAGS += $(call cc-option,-msse2,)
ifdef CONFIG_CC_IS_GCC
# Stack alignment mismatch, proceed with caution.
# GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3
# (8B stack alignment).
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
FPU_CFLAGS += $(call cc-option,-msse -mpreferred-stack-boundary=3,-mpreferred-stack-boundary=4)
endif

obj-$(CONFIG_TEST_FPU) += test_fpu.o
CFLAGS_test_fpu.o += $(FPU_CFLAGS)

-- 
Regards/Gruss,
    Boris.

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

  reply	other threads:[~2020-06-23 18:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 17:41 [PATCH 0/2] x86/FPU: FPU sanitization for in-kernel use Borislav Petkov
2020-06-19 17:41 ` [PATCH 1/2] x86/fpu: Reset MXCSR to default in kernel_fpu_begin() Borislav Petkov
2020-06-19 18:01   ` Andy Lutomirski
2020-06-22 17:09     ` Borislav Petkov
2020-06-22 18:33       ` Andy Lutomirski
2020-06-22 18:36         ` Petteri Aimonen
2020-06-22 18:38         ` Dave Hansen
2020-06-22 18:40           ` Andy Lutomirski
2020-06-22 18:59             ` Borislav Petkov
2020-06-19 17:41 ` [PATCH 2/2] selftests/fpu: Add an FPU selftest Borislav Petkov
2020-06-19 18:00   ` Andy Lutomirski
2020-06-22 17:12     ` Borislav Petkov
2020-06-22 18:26       ` Andy Lutomirski
2020-06-22 19:01         ` Borislav Petkov
     [not found]           ` <B4D00859-000A-4F8C-8CFB-45B9BBCCA16D@amacapital.net>
2020-06-23 10:28             ` Borislav Petkov
2020-06-23 18:22               ` Andy Lutomirski
2020-06-23 18:47                 ` Borislav Petkov [this message]
2020-06-23 19:07                   ` Nick Desaulniers
2020-06-23 19:13                     ` Borislav Petkov
2020-06-23 20:58                       ` Nick Desaulniers
2020-06-23 21:32                         ` Borislav Petkov
2020-06-20 19:55   ` kernel test robot
2020-06-22 17:04     ` Borislav Petkov
2020-06-22 18:15       ` Nick Desaulniers

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=20200623184726.GI32590@zn.tnic \
    --to=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=jpa@kernelbug.mail.kapsi.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=ndesaulniers@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).