Messages in this thread | | | From | Andy Lutomirski <> | Date | Fri, 19 Jun 2020 11:00:28 -0700 | Subject | Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest |
| |
On Fri, Jun 19, 2020 at 10:41 AM Borislav Petkov <bp@alien8.de> wrote: > > From: Petteri Aimonen <jpa@git.mail.kapsi.fi> > > Add a selftest for the usage of FPU code in kernel mode. > > Currently only implemented for x86. In the future, kernel FPU testing > could be unified between the different architectures supporting it.
Acked-by: Andy Lutomirski <luto@kernel.org>
except:
> +# > +# 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 > +ifdef CONFIG_CC_IS_GCC > + ifeq ($(call cc-ifversion, -lt, 0701, y), y) > + # Stack alignment mismatch, proceed with caution. > + # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 > + # (8B stack alignment). > + FPU_CFLAGS += -mpreferred-stack-boundary=4 > + else > + FPU_CFLAGS += -msse2 > + endif > +endif
This should be cc-option, not cc-ifversion, I think. But maybe we should consider dropping the problematic GCC version instead? The old GCC versions with stack alignment problems are seriously problematic for x86 kernels, and I don't really trust kernels built with them.
| |