From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F5BF2C21F8; Sat, 23 May 2026 15:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779549699; cv=none; b=Mu2XCBzCuacYNcNBqrqL7fjO2erp+gb+iuZogm5R/eKz5jROI7hF3pp2A9IeLSi+aN2YkyLLg/AvjELzjcsNm1p8tkEgQfbrAKdw58cKk/axqh/Wpq3cv67fVNJFbNSs/fFv/HsZvUMkgiS8dIVOoZBtQE5fUWjFKxZP9F9QBsY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779549699; c=relaxed/simple; bh=Bk+WjSGaL4cmbJiBJs445ZLaLwKNIeuXmW2NLLtjtkk=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=gHgeqDBDLmdf0PRpBwwRBA+u0ChDdWdnDob25whx3GfdRufMn1364l5GHlki3gjl3wQvbEap7Wf7R0gd8w++w8B9zndx8PjfL+GgGwainB5dAwGTVz7J74J8//XOmZ7wweoBE/+/7L70rNOzbMO+X0+lH90WKjMycs7lklytQKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cFj6jHhx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cFj6jHhx" 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) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.