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 4035D336ED8; Mon, 26 Jan 2026 12:17:35 +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=1769429855; cv=none; b=EGC100mTRqCuAdW6zTtxQSJqCTWmKwL3gmABxfXCPvYIBZ6TMtyiu/M2VPBmF87JNzckKE2+PIaeZppjtSG3DYNwxsKRg/wMPhY4NCIG5nN/1yt5DE8/4hk7P5a8DU87pG9j5GISOLh6FewpBmbd8hCNeXImCzz/djshYcFJlJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769429855; c=relaxed/simple; bh=cjSjGxnYioTuTQkGGQeoMXFPLKV/lqjRqjCssEI4KVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rwvOIu/HrMvut1WOEi8YDVko/wmEsPgqPINXUbBEzsemFlL1ihvzjB2WjQyafsXHWujF1YYlScovdrzzj3J9ERA0ANraDwTVWIG96xtdu6sjN0Z7dHcijPjWq6e4078pxYeJYqFlkK48bmQ7wlM1gf/UqG2kAiCoxquq54CWZQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lynbX/MK; 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="lynbX/MK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E827C2BC87; Mon, 26 Jan 2026 12:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769429855; bh=cjSjGxnYioTuTQkGGQeoMXFPLKV/lqjRqjCssEI4KVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lynbX/MKrusm4/GddjW2C1EcTeaJQuHw8aiCSS7Qb59DG6haFmWjqQv91Lne9rOhP Xm18Ia8UBL0QVFeo1MfGDe9D8Lwyf8SXJH/WRy0VR/DKFE/5yW7OaVrnKc7M1H5fAG Fu0GoabENZb4J/VHE6F1CDaQ4ehq0QWkWTi/BFZJhtW7kIv7ler9nUPwTSrRcqhKRx dnEKDXMz1SnjJQjSNYriyxl5pRJw4kYydCYPwQLevyeSyDhUSyXsDEH7BrZudkIxGH X5MsVIOYwrWag99XWz8r9hSQxBY+pilf79P3e5Jhdt+mGIN/sgPLv/fLteN5azlCD5 LOUN+L8P/YP2g== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) 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 1vkLXB-00000005hx6-1Ahu; Mon, 26 Jan 2026 12:17:33 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: Joey Gouly , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Fuad Tabba , Will Deacon , Catalin Marinas Subject: [PATCH 07/20] KVM: arm64: Allow RES1 bits to be inferred from configuration Date: Mon, 26 Jan 2026 12:16:41 +0000 Message-ID: <20260126121655.1641736-8-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260126121655.1641736-1-maz@kernel.org> References: <20260126121655.1641736-1-maz@kernel.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, oupton@kernel.org, yuzenghui@huawei.com, tabba@google.com, will@kernel.org, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false So far, when a bit field is tied to an unsupported feature, we set it as RES0. This is almost forrect, but there are a few exceptions where the bits become RES1. Add a AS_RES1 qualifier that instruct the RESx computing code to simply do that. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/config.c b/arch/arm64/kvm/config.c index 8d152605999ba..6a4674fabf865 100644 --- a/arch/arm64/kvm/config.c +++ b/arch/arm64/kvm/config.c @@ -24,6 +24,7 @@ struct reg_bits_to_feat_map { #define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */ #define FIXED_VALUE BIT(2) /* RAZ/WI or RAO/WI in KVM */ #define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */ +#define AS_RES1 BIT(4) /* RES1 when not supported */ unsigned long flags; @@ -1316,8 +1317,12 @@ struct resx __compute_fixed_bits(struct kvm *kvm, else match = idreg_feat_match(kvm, &map[i]); - if (!match || (map[i].flags & FIXED_VALUE)) - resx.res0 |= reg_feat_map_bits(&map[i]); + if (!match || (map[i].flags & FIXED_VALUE)) { + if (map[i].flags & AS_RES1) + resx.res1 |= reg_feat_map_bits(&map[i]); + else + resx.res0 |= reg_feat_map_bits(&map[i]); + } } return resx; -- 2.47.3