Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2692796pxb; Tue, 12 Oct 2021 11:28:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrAfYr9SNMldzC7bxVb04ACgFAhni3Uz8fnr2WGVTVB+T4n4Wp2haCpcV+bOu86QIAHeZ7 X-Received: by 2002:a65:6ab0:: with SMTP id x16mr24294181pgu.181.1634063339151; Tue, 12 Oct 2021 11:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634063339; cv=none; d=google.com; s=arc-20160816; b=cmc5fMuQ4qRWPoC86i6RXlqTvWI7D4Wbq+WVeVQMdITdIQGQ30t98CCTGbvpYoX+0W oYhDgaczU3OkGMZPIXUSobMYAwevYCWfwkkcIVCGuB9RwUCdheJBFDBWb74uzAY32JRM VmP/x6g3P7Un7cmXzIxjKe/72xbEHv6E3gcQnGXtGBEI/yz+KwftFKZNcJWKYEivAlc/ Axq/sQjP9cn/hR4n+U5wPTQ7AZD5ff9xFcsvkld/hqWYLGJfKE6Qinv+Fn32YpIXX+My Dm0kjYWoXLYPI74oVdI62jCkyaRHerJFQxx+W0LNAE1Gu/eH28UV13Jb3U5nXOLFK8hJ 3j7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=+JPNiXBO034X+zkqqSL63pmvtyjJNOIJ0HYL93XQQ7A=; b=AhZmX/XXcZcLvKQyMGhgtctx1v+pIepzjkJ9+oDVcKRYQK1MOZr8k7NtpHC88Hs2T6 tmJqzlBe/e40StpwHfz3aaN2JUJs5sIx14MXAE7pP6Xh1/XOveyhrE+OEDc7MqKO73cV AMWK8tg8Txk+nlrV6n63uZBB8XNPfkgt/LKwo74yn1h/reVQwJ83VxgG2qlKHge4QVQo AJifOKkQF86OLgKzGQ2PYRehbUMQuga1a/V+EUPwZn8gNvpM1KZlqh64/2iDn2X2ILXZ /VX8MFQWe7r4BK0Y3NqcbxC79TXhl45TRAArCwYjHai2F3eiVygZH6nPQE+QGwH3T8va bYZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pvvaUZAw; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si20596351plg.434.2021.10.12.11.28.40; Tue, 12 Oct 2021 11:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pvvaUZAw; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233775AbhJLS3H (ORCPT + 99 others); Tue, 12 Oct 2021 14:29:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbhJLS3G (ORCPT ); Tue, 12 Oct 2021 14:29:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C67DEC061745; Tue, 12 Oct 2021 11:27:04 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634063217; 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=+JPNiXBO034X+zkqqSL63pmvtyjJNOIJ0HYL93XQQ7A=; b=pvvaUZAwjhJ+46VazGKaBeY8C6s5xPP0UD9YmG6THvS6A8mSBOcEvk6M1Ef6ANI4MQY2Bl m117MA1p6FgPT7EAQhE+LuEPS8vSfvRFXGr5c3Jvl13enUYqAOeUE9HzvSoRoYeBNnhbtV 0td1ZXCwvuMziDDXEkdmsw/6dkERrMhtLlSKfiB+vLPfUrAg01EBEnKOoXwFdNfWCWEhX/ WP/iEEW8tgSJ2lbJb053pQWHVReaXcLzHx5HrutIbP8fB3aBoJKDV6aL33HPL7mqFhtesY CwbvFFqrFcqz1piUQsMuui4wkFsCRQPIQLhEyvYR0tzrlwHMkVh1bj8q35DY3w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634063217; 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=+JPNiXBO034X+zkqqSL63pmvtyjJNOIJ0HYL93XQQ7A=; b=DWT8JNaDcnyKx//6Ih2xZ3q05OGbU6zZWvwFQBH72QlQe8t2S9aB8vSW4/iKWoG7Po6H0G w09HlALxP1OinbAg== 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: <87czoaaymr.ffs@tglx> References: <20211011215813.558681373@linutronix.de> <20211011223611.069324121@linutronix.de> <87czoaaymr.ffs@tglx> Date: Tue, 12 Oct 2021 20:26:56 +0200 Message-ID: <87a6jeaykv.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 20:25, Thomas Gleixner wrote: > 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 Gah. I should have looked at the context first. "save" is correct here. Oh well...