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 506F3C5B552 for ; Wed, 4 Jun 2025 07:01:00 +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=lhpQ4QZp47RZjXkpewd4RRV4y7k+VQGxo0dVvqtncUs=; b=iDoHsUkoz8OnryE9uKoenGE6PE A1usazhyLCIe4R587YWQZz6MkwxmviAhQCkRNhuRMmcvpKH1I18wsmmfmL1bHoXJU7uM9TWZCU/Io bIf97AAkeN7RGRJ08J/ue/ii6m80hVYaIJhmScME1FMxPNaBAjgz+dMsw/Q3BW35FNNTyJSdbdw9d 359GyY+wnK2GLqscL4S3zDYnb7znSX73H48rex2645oUgqSYRedH+WFinX5/1WvWTRB3F64ScrdUV eSE4HwA5HJ6jPXtdHh0iXTEraxGPVNcr1AKZYeMyH7N2g5OvpL2IwQs+kRfTSyy762iagF8SgJceN 2cSi0p2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMi7J-0000000Cj8w-3qRQ; Wed, 04 Jun 2025 07:00:53 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uMi1c-0000000CiHh-0Jwn for linux-arm-kernel@lists.infradead.org; Wed, 04 Jun 2025 06:55:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 7BA8F4A40C; Wed, 4 Jun 2025 06:54:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E253C4CEED; Wed, 4 Jun 2025 06:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749020099; bh=FWpdcjiy6UtflQwkZexf4d0V3CaS7JiXW1hDgpjYlNE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B9Zo22sGVsRAVhwQZyQJ3DldIKuL47yphEm5CWQcI9dzYgU8YmcYHQx8cRtooTRrp vxVxUePmvu/dCcNtXWkyArI9q9Zvw0uPqmXTp2YnN99MTVmPB5aYyNcxuiUjrTibv9 S5R60+Yx1PkCvlcPNLR7nWzncVFO0/ptcxyYMQGRlnGdJcOMMLzsRdSCQwlggqTYVb Ybz+gNDh4CDEo8snZYfyyuSfdWhmhZxCor5kDcut/Rq78pyvxZYC3nQ4TF8IUEqMus 8gg5ZEMEx3pJStdpXizLKQmu9XmpYZjoRNf/k72MSTl+PoYFeNiLpTO71Hnw7MZ/K3 UPzbVcmhKF36g== Received: from [149.88.19.236] (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.95) (envelope-from ) id 1uMi1Y-0038cW-Ov; Wed, 04 Jun 2025 07:54:57 +0100 Date: Wed, 04 Jun 2025 07:54:55 +0100 Message-ID: <87cybkdmio.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Joey Gouly , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH v2 0/4] KVM: arm64: vcpu sysreg accessor rework In-Reply-To: References: <20250603070824.1192795-1-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: 149.88.19.236 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com 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-20250603_235500_135685_2991CF91 X-CRM114-Status: GOOD ( 27.02 ) 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 Tue, 03 Jun 2025 22:06:27 +0100, Oliver Upton wrote: > > On Tue, Jun 03, 2025 at 08:08:20AM +0100, Marc Zyngier wrote: > > This series tries to bring some sanity to the way the RESx masks > > are applied when accessing the in-memory view of the guest's > > system registers. > > > > Currently, we have *one* accessor (__vcpu_sys_reg()) that can either > > be used as a rvalue or lvalue while that applies the RESx masks behind > > the scenes. This works fine when used as a rvalue. > > > > However, when used as a lvalue, it does the wrong thing, as it only > > sanitises the value we're about to overwrite. This is pointless work > > and potentially hides bugs. > > > > I propose that we move to a set of store-specific accessors (for > > assignments and RMW) instead of the lvalue hack, ensuring that the > > assigned value is the one that gets sanitised. This then allows the > > legacy accessor to be converted to rvalue-only. > > Very happy with how this is shaping up. > > > Given the level of churn this introduces, I'd like this to land very > > early in the cycle. Either before 6.16-rc2, or early in 6.17. > > What's your mood on sneaking this in as a fix for 6.16? It'd fix the > unmasked write bug you mention and hopefully give a semi-stable / early > base for building the 6.17 content on top off. I'm absolutely in favour of taking this in ASAP. The impact should be minimal for new code (and trivial to fix). I'll send this to Paolo by the end of the week, or early next week at the latest. > Otherwise this will be the very first thing I take for 6.17. > > Reviewed-by: Oliver Upton Thanks! M. -- Jazz isn't dead. It just smells funny.