Re: [PATCH 04/22] x86/fpu: Always init the `state' in fpu__clear()

From: Borislav Petkov
Date: Mon Jan 14 2019 - 14:32:19 EST


On Wed, Jan 09, 2019 at 12:47:26PM +0100, Sebastian Andrzej Siewior wrote:
> fpu__clear() only initializes the `state' if the FPU is present. This
> initialisation is also required for the FPU-less system and takes place

"in math_emulate()."

> math_emulate(). Since fpu__initialize() only performs the initialization
> if ->initialized is zero it does not matter that it is invoked each time
> an opcode is emulated. It makes the removal of ->initialized easier if
> the struct is also initialized in FPU-less case at the same time.

in the

>
> Move fpu__initialize() before the FPU check so it is also performed in
> FPU-less case.

in the...

>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/fpu/internal.h | 1 -
> arch/x86/kernel/fpu/core.c | 5 ++---
> arch/x86/math-emu/fpu_entry.c | 3 ---
> 3 files changed, 2 insertions(+), 7 deletions(-)

With that fixed:

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.