[PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-19 Thread Borislav Petkov
From: Petteri Aimonen 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. [ bp: Split out from a conglomerate patch, put comments over statements, r

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-19 Thread Andy Lutomirski
On Fri, Jun 19, 2020 at 10:41 AM Borislav Petkov wrote: > > From: Petteri Aimonen > > 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:

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-20 Thread kernel test robot
Hi Borislav, Thank you for the patch! Yet something to improve: [auto build test ERROR on kselftest/next] [also build test ERROR on tip/auto-latest linus/master v5.8-rc1 next-20200618] [cannot apply to tip/x86/core] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-22 Thread Borislav Petkov
On Sun, Jun 21, 2020 at 03:55:00AM +0800, kernel test robot wrote: > Hi Borislav, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on kselftest/next] > [also build test ERROR on tip/auto-latest linus/master v5.8-rc1 next-20200618] > [cannot apply to tip/x86/core]

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-22 Thread Borislav Petkov
On Fri, Jun 19, 2020 at 11:00:28AM -0700, Andy Lutomirski wrote: > This should be cc-option, not cc-ifversion, I think. Why? > But maybe we should consider dropping the problematic GCC version > instead? The old GCC versions with stack alignment problems are > seriously problematic for x86 kernel

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-22 Thread Nick Desaulniers
On Mon, Jun 22, 2020 at 10:04 AM Borislav Petkov wrote: > > On Sun, Jun 21, 2020 at 03:55:00AM +0800, kernel test robot wrote: > > Hi Borislav, > > > > Thank you for the patch! Yet something to improve: > > > > [auto build test ERROR on kselftest/next] > > [also build test ERROR on tip/auto-latest

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-22 Thread Andy Lutomirski
On Mon, Jun 22, 2020 at 10:12 AM Borislav Petkov wrote: > > On Fri, Jun 19, 2020 at 11:00:28AM -0700, Andy Lutomirski wrote: > > This should be cc-option, not cc-ifversion, I think. > > Why? For all the ridiculous distro gcc versions out there. Also, it seems less fragile, since it tests for wha

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-22 Thread Borislav Petkov
On Mon, Jun 22, 2020 at 11:26:50AM -0700, Andy Lutomirski wrote: > For all the ridiculous distro gcc versions out there. Also, it seems > less fragile, since it tests for what you actually care about Let's cross that bridge when we get there. Do you know of an actual compiler not supporting -mpr

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Nick Desaulniers
On Tue, Jun 23, 2020 at 12:13 PM Borislav Petkov wrote: > > On Tue, Jun 23, 2020 at 12:07:13PM -0700, Nick Desaulniers wrote: > > You already have a conditional below for CC_IS_GCC; just add an else > > and unconditionally add -msse2. You *should* use -msse2 for GCC 7.1+ > > IMO. > > Why if one c

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Borislav Petkov
On Tue, Jun 23, 2020 at 01:58:15PM -0700, Nick Desaulniers wrote: > My point was more so about avoiding needless cc-option checks when > they're tautological. No, you're right. The oldest gcc we support is 4.8 and that eats -msse2 just fine. > When Andy says "consider dropping the problematic GCC

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Borislav Petkov
On Mon, Jun 22, 2020 at 12:37:12PM -0700, Andy Lutomirski wrote: > It’s this whole mess: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 It really is a mess because our option detection doesn't really work. I did: ifdef CONFIG_CC_IS_GCC ifeq ($(call cc-option-yn,-mpreferred-stack-bounda

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Andy Lutomirski
On Tue, Jun 23, 2020 at 3:28 AM Borislav Petkov wrote: > > On Mon, Jun 22, 2020 at 12:37:12PM -0700, Andy Lutomirski wrote: > > It’s this whole mess: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 > > It really is a mess because our option detection doesn't really work. I did: > > ifde

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Borislav Petkov
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 in

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Nick Desaulniers
On Tue, Jun 23, 2020 at 11:47 AM Borislav Petkov wrote: > > 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

Re: [PATCH 2/2] selftests/fpu: Add an FPU selftest

2020-06-23 Thread Borislav Petkov
On Tue, Jun 23, 2020 at 12:07:13PM -0700, Nick Desaulniers wrote: > You already have a conditional below for CC_IS_GCC; just add an else > and unconditionally add -msse2. You *should* use -msse2 for GCC 7.1+ > IMO. Why if one can write it more compact with cc-option? FPU_CFLAGS += $(call cc-opti