From: Mark Brown <broonie@kernel.org>
To: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Joey Gouly <joey.gouly@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: [PATCH v2 2/3] KVM: selftests: arm64: Use symbolic definitions for incorrect encodings
Date: Tue, 06 Aug 2024 15:24:23 +0100 [thread overview]
Message-ID: <20240806-kvm-arm64-get-reg-list-v2-2-1d3fbc7b6844@kernel.org> (raw)
In-Reply-To: <20240806-kvm-arm64-get-reg-list-v2-0-1d3fbc7b6844@kernel.org>
Unfortunately incorrect encodings for CNTV_CTL_EL0 and CNTV_CVAL_EL0 made
their way into the KVM ABI, the encodings were swapped. The UAPI provides
custom KVM sysreg definitions with the incorrect encodings so let's update
get-reg-list to use them. Also add a comment explaining the situation to
help anyone looking at the test.
This will avoid these registers being picked up by further work to
automatically convert the test to use symbolic definitions rather than
manually repeating the encodings in the test.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
tools/testing/selftests/kvm/aarch64/get-reg-list.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index 97ac3f6b5c4b..a270287a4c88 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -313,8 +313,15 @@ static __u64 base_regs[] = {
KVM_REG_ARM_FW_FEAT_BMAP_REG(0), /* KVM_REG_ARM_STD_BMAP */
KVM_REG_ARM_FW_FEAT_BMAP_REG(1), /* KVM_REG_ARM_STD_HYP_BMAP */
KVM_REG_ARM_FW_FEAT_BMAP_REG(2), /* KVM_REG_ARM_VENDOR_HYP_BMAP */
- ARM64_SYS_REG(3, 3, 14, 3, 1), /* CNTV_CTL_EL0 */
- ARM64_SYS_REG(3, 3, 14, 3, 2), /* CNTV_CVAL_EL0 */
+
+ /*
+ * Incorrect encodings for CNTV_CTL_EL0 and CNTV_CVAL_EL0 made
+ * it into the KVM ABI so we have custom encodings for them
+ * that do not align with the architecture.
+ */
+ KVM_REG_ARM_TIMER_CTL,
+ KVM_REG_ARM_TIMER_CVAL,
+
ARM64_SYS_REG(3, 3, 14, 0, 2),
ARM64_SYS_REG(3, 0, 0, 0, 0), /* MIDR_EL1 */
ARM64_SYS_REG(3, 0, 0, 0, 6), /* REVIDR_EL1 */
--
2.39.2
next prev parent reply other threads:[~2024-08-06 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 14:24 [PATCH v2 0/3] KVM: selftests: arm64: Make use of sysreg defintions in get-reg-list Mark Brown
2024-08-06 14:24 ` [PATCH v2 1/3] KVM: selftests: arm64: Simplify specification of filtered registers Mark Brown
2024-08-06 14:24 ` Mark Brown [this message]
2024-08-06 14:24 ` [PATCH v2 3/3] KVM: selftests: arm64: Use generated defines for named system registers Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240806-kvm-arm64-get-reg-list-v2-2-1d3fbc7b6844@kernel.org \
--to=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®