[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrXZhFJGJA2h4zP743KYTtni-rQSUME8mtSYUdk1-ZTauQ@mail.gmail.com>
Date: Fri, 19 Jun 2020 11:01:44 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: X86 ML <x86@...nel.org>, jpa@...nelbug.mail.kapsi.fi,
Dave Hansen <dave.hansen@...el.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
On Fri, Jun 19, 2020 at 10:41 AM Borislav Petkov <bp@...en8.de> wrote:
>
> From: Petteri Aimonen <jpa@....mail.kapsi.fi>
>
> Previously, kernel floating point code would run with the MXCSR control
> register value last set by userland code by the thread that was active
> on the CPU core just before kernel call. This could affect calculation
> results if rounding mode was changed, or a crash if a FPU/SIMD exception
> was unmasked.
>
> Restore MXCSR to the kernel's default value.
>
> [ bp: Carve out from a bigger patch by Petteri, add feature check, add
> FNINIT call too (amluto). ]
Acked-by: Andy Lutomirski <luto@...nel.org>
but:
shouldn't kernel_fpu_begin() end with a barrier()?
Powered by blists - more mailing lists