From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH 04/22] x86/fpu: Always init the `state' in fpu__clear() Date: Mon, 14 Jan 2019 20:32:14 +0100 Message-ID: <20190114193214.GR2773@zn.tnic> References: <20190109114744.10936-1-bigeasy@linutronix.de> <20190109114744.10936-5-bigeasy@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Dave Hansen To: Sebastian Andrzej Siewior Return-path: Content-Disposition: inline In-Reply-To: <20190109114744.10936-5-bigeasy@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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 > --- > 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 -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.