From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E1EA60A261B for ; Wed, 21 Oct 2026 14:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=oYmbbjR1; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fGjvyCzl 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:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID: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=HG5WwI0uva9+q35bmaikDJW5M7QGxWPn9cqDARaboVE=; b=oYmbbjR1g7+zQPbO/hKCal8Vod 93Xt4wpzZvaG1+q392b8J+bwcr9r7Bk3DpRcqixL+438YqrnN85ERf65Rk/IrqYWIhH6BUssfGBdL tNVTKjG9MpVA5KVkNr1WsKRfmeosy4OXuWFbg3WN+3uW/3D13hptkm0kaVurz0MQQaTSdzLjgQFTf IidKMePnFLOUXjEsp9skoG+C7TTWujmvKNqyoFq9Q6JWyU1nhbqg+zwHYqA3CTMAb9QxA7bdcQQXF sZ/D5r6sy/GCA9uhkems6k8iKyW7PXh5rQTlXDxv/gdKZ1x5KATJADmVAu8SylSSb9fSVmnEzC+YH VOcNnPCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xJWuN-0000000C2Du-0hXo; Wed, 21 Oct 2026 14:03:11 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xJWuK-0000000C2D5-19CA for linux-arm-kernel@lists.infradead.org; Wed, 21 Oct 2026 14:03:09 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 6C19860142; Wed, 21 Oct 2026 14:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EF621F000C8; Wed, 21 Oct 2026 14:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792591387; bh=HG5WwI0uva9+q35bmaikDJW5M7QGxWPn9cqDARaboVE=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=fGjvyCzl/fJR+Od4lSDF8SJ6aZKPrlsrQz4NQHh6aQRKTNbxA8w5bvEkcPmIm1xpD 0UbBGkvMb2PXPQyZplNPm75s5OZMCs/of/Q32mdtF/smWQKFNP+WRVkOVM1g/pgF7M k6Gilcq91OuB8lxZWSo00NOqkLLNDe4YfheInStdqfZqXqgjkEexCgjzhpWK7jNZnu n9w/rjbYE9+Ogl2+2nUyjwlTtBNyRUgQR6xwpeDtOajbZKWpMIFENdUf57CPUfbI+p XxgSiHkBRrGucN9Hhu/l1ep5E8AAg+JpBLP1qT7YhJ+SATLQ2wcWoaAydcqYox4Jd8 hWBtCNuaWDKkQ== 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.98.2) (envelope-from ) id 1xJWuG-00000005dP4-3zaA; Wed, 21 Oct 2026 14:03:05 +0000 Date: Wed, 21 Oct 2026 15:03:04 +0100 Message-ID: <86o6cnywvb.wl-maz@kernel.org> From: Marc Zyngier To: Fuad Tabba Cc: "Lorenzo Stoakes (ARM)" , Oliver Upton , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Mark Brown , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] KVM: arm64: Sanitise ID_AA64MMFR3_EL1.S1P[IO]E In-Reply-To: References: <20261020064306.1542865-1-fuad.tabba@linux.dev> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Archived-By: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: fuad.tabba@linux.dev, ljs@kernel.org, oupton@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, broonie@kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, 20 Oct 2026 20:30:56 +0100, Fuad Tabba wrote: > > >> @@ -59,6 +59,7 @@ struct reg_feat_map_desc { > >> const struct reg_bits_to_feat_map feat_map; > >> const struct reg_bits_to_feat_map *bit_feat_map; > >> const unsigned int bit_feat_map_sz; > >> + const unsigned int idreg_idx; > > > > This field feels a bit hazardous - 0 is a valid index and now things that > > don't declare it are setting a valid value. > > idreg_idx is only read for the descriptors in idreg_feat_maps[], which > all come from DECLARE_IDREG_FEAT_MAP(), so the 0 in the others is > never used. Storing the encoding would work as well, I'll leave that > one to Marc. I don't think we should baby-sit people who hack this code. If you put something that is not the output of IDREG_IDX(), you get to keep the pieces. If you use this out of context, it will blow up in your face. > > [...] > >> +static bool idreg_deps(struct kvm *kvm, const struct reg_feat_map_desc *r) > > > > To me this reads confusingly - idreg_apply_deps() would be clearer I think. > > Agreed. > > [...] > >> + for (int i = 0; i < r->bit_feat_map_sz; i++) { > >> + if ((r->bit_feat_map[i].flags & CALL_FUNC) && > > > > What if it isn't a CALL_FUNC feature? > > > > Could this loop just be replaced with compute_resx_bits()? > > It's skipped, so a dependency written as a plain field match would be > silently ignored. Both entries today are CALL_FUNC, but > compute_resx_bits() handles every kind of entry and would also give > the res1 line something to set. It'd mean moving idreg_deps() below > it. I really do not want to drag compute_resx_bits() into this. None of that stuff is RESx. It is bad enough that we use the same structures to represent different type of dependencies. I also want to add new ways to affect ID registers that really do not fit the RESx handling. > Marc, compute_resx_bits(), the rename and the loop rework are all fine > by me. If you agree, I can respin with them, or you can fold them in > when applying, whichever is easier for you. I don't care about the name, but I don't want the rest of the proposed changes. Thanks, M. -- Without deviation from the norm, progress is not possible.