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 67DA2CD5BB8 for ; Sat, 23 May 2026 15:21:48 +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: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=BCKrEUBu72Mi2oKWr7L/Dq4QVJ2zfPIsIUhMNAG90Ak=; b=BJziPo43EWb5q1xzBpmsvuIoPw kIvnQbN5VZfKdXshpDH8NwmQy/gaDTbSx+K7gkHif7KMEM5ufhqASEongsKZp6n3/ciYmnWfM5pVi yIo1deWWjXmA2wpaKvPjLM8vo8WCViHswSKSM9auQFVQyNCX7llDfkjvMXViM3PwZDyOqiXBEMpau OvpQIQCb/RcNjmpmUYfthp7N9HrJaFyhudFTb9HAjcaG1ROwG+YOSE5wehU4f2Q3CMXhPY/vHX6eF gpt6k3nC1F9oKqVwTl0DEiuefd2S1c3UIxGkyqwoaIZgA+QYNh2yQ+shDr1/dHxh6rnrzKa7yzhEj Nhedxi0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wQoAW-0000000DUJ8-4AzP; Sat, 23 May 2026 15:21:40 +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 1wQoAV-0000000DUIq-0lk2 for linux-arm-kernel@lists.infradead.org; Sat, 23 May 2026 15:21:39 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 61FD360055; Sat, 23 May 2026 15:21:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F8FB1F000E9; Sat, 23 May 2026 15:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779549698; bh=BCKrEUBu72Mi2oKWr7L/Dq4QVJ2zfPIsIUhMNAG90Ak=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=cFj6jHhxW/KhwwUrixRhl1XDqDyyj0lsxih9w3gGS1mgnRwPZS81XzkuUi1gfAnUl OFNXxwZgVV+PyqMbK/HEU7h8TZnS2hQWxe1d/bAM8TiJxkfN6IvCp3WYHYYi/rRTjP O3m3n7TMugl5qJOYGl3WEqa0XEx12ZJTiijaCRfnNtd5pLtsh2ltbPKN6e9TRjI5x1 FWfXrfqMETPE/MJH3ACqAcUO6DO9DHHFHkBc+U3utOuR14a3wWGkvHhhAVRIXknzD6 CvsV4J6j88vhupNK5zrJRjXGTVNfasXvIEZL5hZEm/g+1s8mjRYYVP7B5U5tO1rHqN 1YwZxAvp3wgTQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1wQoAS-00000005ZBN-0M37; Sat, 23 May 2026 15:21:36 +0000 Date: Sat, 23 May 2026 16:24:52 +0100 Message-ID: <87fr3i9mij.wl-maz@kernel.org> From: Marc Zyngier To: Mark Brown Cc: Oliver Upton , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Preserve all guest ZCR_EL2.LEN values In-Reply-To: References: <20260522-kvm-arm64-fix-zcr-len-nv-v1-1-ec254e9078cf@kernel.org> <87h5nya4wl.wl-maz@kernel.org> 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) 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: broonie@kernel.org, oupton@kernel.org, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, 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-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 Sat, 23 May 2026 15:38:28 +0100, Mark Brown wrote: > > On Sat, May 23, 2026 at 09:47:38AM +0100, Marc Zyngier wrote: > > Mark Brown wrote: > > > > Currently all other bits in ZCR_EL2 are either RES0 or RAZ/WI, values > > > written are sanitised based on this. > > > Only for the direct writes to ZCR_EL2, as they are trapping. I don't > > see any sanitisation for writes using the ZCR_EL1 accessor, which is > > the common case. This needs fixing at the same time. > > OK, I'll convert ZCR_EL2 to a sanitised register. As I mentioned I was > a bit confused about why the existing code is the way it is and so > followed it in only managing the direct writes. I figured it was > considered OK to rely on the hardware for the RES0 and WI behaviour for > untrapped access. In general, that's OK. But given that you need sanitisation in the trapping case, it is way better to have a uniform behaviour and keep sanitisation at the accessor level. It is also more sustainable in the long run, should ZCR_ELx get new significant bits. Thanks, M. -- Jazz isn't dead. It just smells funny.