[PATCH v2 2/3] KVM: selftests: arm64: Use symbolic definitions for incorrect encodings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux