From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8425129A9C9 for ; Thu, 22 Jan 2026 09:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769072870; cv=none; b=iDMqDVGziAraC3HHirrk+mv+m84CvqCFABYcfvaPXvCvBaThmsHWlicjkcO6gSrjTMYZWKJzyy2gn+u6ZUPP8M6yOmC2xOd+TMkZw0h5hlJb6weqWXpmfRWoBOgUZJ71R8KkOAD2YL9YYuuLmGGBjR3GFvl7Pyoyum86LO6Q+1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769072870; c=relaxed/simple; bh=ui6FN7ArLwvtBIDbQfy5pRl8V5wQYtCl40jZiB+Dt7s=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=cMDSG4MPDX6ina09u32slLcuBaaA9AJFvFwQudPi+kQXhtr0RMOv8udcDGVFQyr65vZxPmOgPlaDo79kfGTpvc613NbGGQx8JwFm5Vf98jb78UCefTyTccHTpV+z6o2uxPEk3a6uMTcXIWHIPWM9HcMsno42Eju/7QmPI8Glx54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DlGu7ZQi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DlGu7ZQi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CEA0C16AAE; Thu, 22 Jan 2026 09:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769072870; bh=ui6FN7ArLwvtBIDbQfy5pRl8V5wQYtCl40jZiB+Dt7s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DlGu7ZQigpyXDRtUNgOEXuz96GQ02SGJ+awi9gUlb0RB5dLcNjp+nd7YxQYOppJmC c8Tk+A7FzrYzkeVhPojlZxrwf6ms+7n0dUCWry/xEaKpV7s7/st27NXs/4vVODmbby odzEW6ci2kBbOWtIZyNbTqQNpoyCXlMvNzzTVW3bD76c66SqZqco6ALXFKXeox2ogT 381kKIZPzfZjybMqVT70ivqV5a3UlmXtv/OwTk5Uc4mTbUpjAe6enjDOu0lJT9uU+c gCYaWKd73PoGOUQ3YRFKRxuWq8guTZ9QJwZlBK8GNu4ijj0PCg8diyySTSsoRH0mWg 6bfAXqNyC1nVA== 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 1viqfM-00000004cQS-0rIx; Thu, 22 Jan 2026 09:07:48 +0000 Date: Thu, 22 Jan 2026 09:07:47 +0000 Message-ID: <86wm1aaucc.wl-maz@kernel.org> From: Marc Zyngier To: Zenghui Yu Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, wanghaibin.wang@huawei.com Subject: Re: [PATCH] KVM: arm64: nv: Return correct RES0 bits for FGT registers In-Reply-To: <20260121101631.41037-1-zenghui.yu@linux.dev> References: <20260121101631.41037-1-zenghui.yu@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) 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: zenghui.yu@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, wanghaibin.wang@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 21 Jan 2026 10:16:31 +0000, Zenghui Yu wrote: > > From: "Zenghui Yu (Huawei)" > > We had extended the sysreg masking infrastructure to more general > registers, instead of restricting it to VNCR-backed registers, since > commit a0162020095e ("KVM: arm64: Extend masking facility to arbitrary > registers"). Fix kvm_get_sysreg_res0() to reflect this fact. Huh, what a howler! Thanks a lot for spotting this! > > Note that we're sure that we only deal with FGT registers in > kvm_get_sysreg_res0(), the > > if (sr < __VNCR_START__) > > is actually a never false, which should probably be removed later. I think the biggest mistake is to have several places where we perform sysreg index to array index conversions. We should try to unify that. > > Fixes: 69c19e047dfe ("KVM: arm64: Add TCR2_EL2 to the sysreg arrays") > Signed-off-by: Zenghui Yu (Huawei) Cc: stable@vger.kernel.org Thanks again, M. -- Without deviation from the norm, progress is not possible.