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 EB86EC54E5D for ; Tue, 19 Mar 2024 09:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qT7LQqEsX4GJCnwz5o9dz9xmyLYrDsqfHCtNWi3JgR0=; b=qaQ6Jp7tVhQWve 5fsojb7PQkW8hXsFwWWRNshpC6k60sew9gNG2TMae44yoznl1+SpvQLa5cm+4PxvjJYGEDD61botP uj+RZyGtsofU4m5kYJbMfIOLNFE1f7wD/zUGq9gZ3Yxzpz2rH+h8wZxqS6ovDdoa7zBxoAa75u30F XXDXwr36Xs9oQcINClasyytwgw8ntwi1QWFwtLVed4evCDPuMWP1n/ujypgoPOg4F/Z5PDaNJocpw OjqUTyIgw5rkDJJ1KLsR2+CABzL6wAFXeV//+5xEsPnUHy1cUGOEGlyfHhYkpcx4ncXIuV3mufRZQ mNbPqKB59SfeHPfL0hjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmW7D-0000000CAIM-2VOe; Tue, 19 Mar 2024 09:50:39 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmW74-0000000CAD7-0fyW for linux-arm-kernel@lists.infradead.org; Tue, 19 Mar 2024 09:50:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5367D60E16; Tue, 19 Mar 2024 09:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFC0EC433F1; Tue, 19 Mar 2024 09:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710841827; bh=h/JspNgve7/iyuNBy2SU5thz4r6B6oeu0Fnmd8liVt0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=b8sIbIXPkdF3S2VieRZRKCgq7icIzhDGDOwBc6LkR9pAw6DhfGFT/nmOg6OIToi8C DX0nQjhL7RbMcBgd+PerItrpTTwRjLEbdXmPxF56GSACVaqdbY3L7g49gtthEqieyj Uvh447SyxRsT1xfK+ej4XAqWybyhuWo7ifff78Dw9YFGpzexwQBy1sk9X7bkc0Mosf iRQL6ZYvchoEjMSWPqGnJeqfcTNFdIY0WKyOagWpCxX/2fWIFPzBwvDtDkCbhCCItS 9guPuNWwAKYLsh7k/tPip5lyVJc6A94kSwz2VxKsZ+m2xYKL2xevEFj/29IpelgQO7 S9tGvc4MZB1gw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rmW6z-00DXCp-Af; Tue, 19 Mar 2024 09:50:26 +0000 Date: Tue, 19 Mar 2024 09:50:23 +0000 Message-ID: <86msquzh28.wl-maz@kernel.org> From: Marc Zyngier To: Sebastian Ott Cc: linux-arm-kernel@lists.infradead.org, Oliver Upton Subject: Re: [PATCH 3/4] KVM: arm64: show writable masks for feature registers In-Reply-To: <356fc3d6-4129-f57f-055c-6a8e73e179e7@redhat.com> References: <20240318111636.10613-1-sebott@redhat.com> <20240318111636.10613-4-sebott@redhat.com> <86zfuvzr0n.wl-maz@kernel.org> <356fc3d6-4129-f57f-055c-6a8e73e179e7@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sebott@redhat.com, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240319_025030_807625_93DA0033 X-CRM114-Status: GOOD ( 27.62 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 18 Mar 2024 18:20:06 +0000, Sebastian Ott wrote: > > On Mon, 18 Mar 2024, Marc Zyngier wrote: > > On Mon, 18 Mar 2024 11:16:35 +0000, > > Sebastian Ott wrote: > >> > >> Instead of using ~0UL provide the actual writable mask for > >> non-id feature registers in the output of the > >> KVM_ARM_GET_REG_WRITABLE_MASKS ioctl. > > > > CTR_EL0 definitely seems to be in the feature ID range. And so does > > CLIDR_EL1. > > Sry, bad wording. I mean feature id regs for which is_id_reg() is false. > Maybe this means that we should revisit the range delineated by is_id_reg(). > >> > >> This changes the mask for the CTR_EL0 register. > > > > Only that? > > Yes. The patch shows otherwise, I'm afraid. > > >> Signed-off-by: Sebastian Ott > >> --- > >> arch/arm64/kvm/sys_regs.c | 21 ++++++--------------- > >> 1 file changed, 6 insertions(+), 15 deletions(-) > >> > >> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > >> index b2019faa9d73..0f8fe7790c35 100644 > >> --- a/arch/arm64/kvm/sys_regs.c > >> +++ b/arch/arm64/kvm/sys_regs.c > >> @@ -2489,12 +2489,12 @@ static const struct sys_reg_desc sys_reg_descs[] = { > >> > >> { SYS_DESC(SYS_CCSIDR_EL1), access_ccsidr }, > >> { SYS_DESC(SYS_CLIDR_EL1), access_clidr, reset_clidr, CLIDR_EL1, > >> - .set_user = set_clidr }, > >> + .set_user = set_clidr, .val = ~0UL }, > > > > How is CLIDR_EL1 (and all the crap that depend on it) recomputed when > > CTR_EL0 is changed? > > Do we have means to handle dependencies here? There is no natural order > in which userspace is writing to these regs. Nor a good time or a trigger > when the kernel should do a sanity/dependency check.. Well, we're not going to run the guest with something that describes an inconsistent topology either, so this is the very first thing that needs to be solved. Either by restoring acceptable defaults when the topology changes due to a write to CTR_EL0, or by returning an error to userspace if the cache topology has been restored but CTR_EL0 is incompatible with it. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel