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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F2C2CF07BF for ; Thu, 10 Oct 2024 08:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n9ENzHg7tPYpJtE43PefYJwyU05UEoBmVVMbi+fFu3o=; b=QqSGFF5GLOJvATPdWnVh013vOd Ed1GwAJEGSS3c9tyfqCnAWNmv1ZsusWSfdjioXgvC6mFW4b25376NF1sPQL1rt90xlHY2cpB3NeYs BbSlG82wLBf/mP9gXQASuzgW0OrDGun5ruGFSSA7ciURf8QbOd2Y9anvBErrtYomtp9USc5Fd5SY4 +rkexmlaowQgMNHvjVOP8q1HsXcEzlmIpZgAhDjIjF4SL0knrM/9XV8oQz/kSQx5tySDvgL+Lp23U 5qSsOzucwjIdrsTctYdEPpkdPtjejjcOfCEtEZN+s70VGx3aVK906MJS/ty8e3+u3hFgP7rr79Mq9 YP22mEeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syoHA-0000000BvHn-3nQQ; Thu, 10 Oct 2024 08:12:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1synx0-0000000BsVt-20aQ for linux-arm-kernel@bombadil.infradead.org; Thu, 10 Oct 2024 07:51:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n9ENzHg7tPYpJtE43PefYJwyU05UEoBmVVMbi+fFu3o=; b=SjwPzUnO4+sdr1vrFvTzyRqBOA NDP0jua7VivR26Ht3geoNchlySxLbCDLzgtlmOFl4GbogtVNyoFu3xuxRP0exF7zAXF4UxPrFIutn GzIUMt3SG8krLQkV7avdnASDoc+QMmTqCXYb+ypjowG69LyEJXoZt0NawuuIXN7yLoIuymUsGSnID JDRdmGNSnbsyra4MtG5ewU49x7Ex9Ib+fjjN+FCK1zS6wdIRtUDo0k8fbvh1j91ojqxB6PwhvA39b NLhS/IICVJAvVfcqDQeYD+2zbW39wdu5x+yQChcfFTPCqIypxaFpJ51WQv9pUFqc1JamlH76DV6vX gcea+TnQ==; Received: from out-185.mta1.migadu.com ([2001:41d0:203:375::b9]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1synwv-00000005EC6-26gB for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 07:51:09 +0000 Date: Thu, 10 Oct 2024 00:50:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1728546660; 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=n9ENzHg7tPYpJtE43PefYJwyU05UEoBmVVMbi+fFu3o=; b=QA9sA4TbDGSie23xU+ntyEWDGUOLiEwOX3TkWQYWCbFKYsmJmdpKWBYZYLvyRymvlauJG+ LedOFexrTPRxdSlRldpf1A5Q29PMCM4vnNrjnVzPBCSKl+Ooq5s9jnBuPqfyQRQXcAc1Bd thdOH+OIX1WMpZV1l2oz3boZKN2PwOM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Joey Gouly , Suzuki K Poulose , Zenghui Yu , Alexandru Elisei , Mark Brown Subject: Re: [PATCH v4 23/36] KVM: arm64: Hide TCR2_EL1 from userspace when disabled for guests Message-ID: References: <20241009190019.3222687-1-maz@kernel.org> <20241009190019.3222687-24-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241009190019.3222687-24-maz@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_085105_786614_CA8BA43C X-CRM114-Status: GOOD ( 19.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 09, 2024 at 08:00:06PM +0100, Marc Zyngier wrote: > From: Mark Brown > > When the guest does not support FEAT_TCR2 we should not allow any access > to it in order to ensure that we do not create spurious issues with guest > migration. Add a visibility operation for it. This should come at the beginning of ths series (same for the subsequent S1PIE patch) so the EL2 registers use the correct visibility filtering from the start. > Fixes: fbff56068232 ("KVM: arm64: Save/restore TCR2_EL1") > Signed-off-by: Mark Brown > Link: https://lore.kernel.org/r/20240822-kvm-arm64-hide-pie-regs-v2-2-376624fa829c@kernel.org > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_host.h | 3 +++ > arch/arm64/kvm/sys_regs.c | 29 ++++++++++++++++++++++++++--- > 2 files changed, 29 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 1a5477181447c..197a7a08b3af5 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -1511,4 +1511,7 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); > (system_supports_fpmr() && \ > kvm_has_feat((k), ID_AA64PFR2_EL1, FPMR, IMP)) > > +#define kvm_has_tcr2(k) \ > + (kvm_has_feat((k), ID_AA64MMFR3_EL1, TCRX, IMP)) > + nit: we should consistently use this predicate if we want to keep it. -- Thanks, Oliver