From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1083C433FE for ; Tue, 12 Oct 2021 18:26:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96F5660ED4 for ; Tue, 12 Oct 2021 18:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233730AbhJLS2L (ORCPT ); Tue, 12 Oct 2021 14:28:11 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:57532 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbhJLS2J (ORCPT ); Tue, 12 Oct 2021 14:28:09 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634063149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=970N41MnZaYG7XtxW9PflsvxxFaQSnO5Y31eDQi0zqs=; b=KQX3sdrxdFpb4/y3y2CrcGl6ttIYlsFbIf8Fu4vUFaCzJvTq2sC+TrnTgvHuyQpCz63/5M fpgsnK+JX/x0p4p7eq8pJESz8sOwlLQ9r09NuD3AJRykdnpoQGZo0aSXg3nJwKNcFhApdU 8LkB/NvAY3qqvXZ3EOtFW4Xlh6jwtm38Rs6bgr82bRHaiHWskdOB3U/sekFLRBuVZwiYpJ kwS2sCBvEIgUZ2tBIaDb8FOAdf9A1m8IGkHe/hG4X6X+A6dmB4BE4TXI9YinMCK/06ABF/ Oyd53rHJ1HcS9QSYHqzm9WMCI2e96QVq49p9dR/wzH1Sfm+rl/Myov6ydBzu5w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634063149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=970N41MnZaYG7XtxW9PflsvxxFaQSnO5Y31eDQi0zqs=; b=282idd15MvIFaubRWInSIyOBhseW/Xxnvokrt+2EY3RMBlR96iUJmjM6M2ZxIS5VWgc2d3 DJr+N/UDe8lNmtAQ== To: Borislav Petkov Cc: LKML , x86@kernel.org, "Chang S. Bae" , Dave Hansen , Arjan van de Ven , kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [patch 13/31] x86/fpu: Move KVMs FPU swapping to FPU core In-Reply-To: References: <20211011215813.558681373@linutronix.de> <20211011223611.069324121@linutronix.de> Date: Tue, 12 Oct 2021 20:25:48 +0200 Message-ID: <87czoaaymr.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12 2021 at 18:53, Borislav Petkov wrote: > On Tue, Oct 12, 2021 at 02:00:17AM +0200, Thomas Gleixner wrote: >> /* >> - * Guests with protected state can't have it set by the hypervisor, >> - * so skip trying to set it. >> + * Guest with protected state have guest_fpu == NULL which makes > > "Guests ... " > >> + * the swap only safe the host state. Exclude PKRU from restore as > > "save" No I meant safe, but let me rephrase it, Swap does both save and restore. But it's not safe to dereference a NULL pointer :) .... makes the swap only handle the host state. Exclude PKRU from restore as Thanks, tglx