Skip to content

Commit 02de933

Browse files
Andrew JonesMarc Zyngier
authored andcommitted
KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)
When testing a kernel with commit a5905d6 ("KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated") get-reg-list output vregs: Number blessed registers: 234 vregs: Number registers: 238 vregs: There are 1 new registers. Consider adding them to the blessed reg list with the following lines: KVM_REG_ARM_FW_REG(3), vregs: PASS ... That output inspired two changes: 1) add the new register to the blessed list and 2) explain why "Number registers" is actually four larger than "Number blessed registers" (on the system used for testing), even though only one register is being stated as new. The reason is that some registers are host dependent and they get filtered out when comparing with the blessed list. The system used for the test apparently had three filtered registers. Signed-off-by: Andrew Jones <[email protected]> Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2f5d27e commit 02de933

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/testing/selftests/kvm/aarch64/get-reg-list.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,13 @@ static void run_test(struct vcpu_config *c)
503503
++missing_regs;
504504

505505
if (new_regs || missing_regs) {
506+
n = 0;
507+
for_each_reg_filtered(i)
508+
++n;
509+
506510
printf("%s: Number blessed registers: %5lld\n", config_name(c), blessed_n);
507-
printf("%s: Number registers: %5lld\n", config_name(c), reg_list->n);
511+
printf("%s: Number registers: %5lld (includes %lld filtered registers)\n",
512+
config_name(c), reg_list->n, reg_list->n - n);
508513
}
509514

510515
if (new_regs) {
@@ -683,9 +688,10 @@ static __u64 base_regs[] = {
683688
KVM_REG_ARM64 | KVM_REG_SIZE_U64 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(spsr[4]),
684689
KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpsr),
685690
KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(fp_regs.fpcr),
686-
KVM_REG_ARM_FW_REG(0),
687-
KVM_REG_ARM_FW_REG(1),
688-
KVM_REG_ARM_FW_REG(2),
691+
KVM_REG_ARM_FW_REG(0), /* KVM_REG_ARM_PSCI_VERSION */
692+
KVM_REG_ARM_FW_REG(1), /* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1 */
693+
KVM_REG_ARM_FW_REG(2), /* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 */
694+
KVM_REG_ARM_FW_REG(3), /* KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 */
689695
ARM64_SYS_REG(3, 3, 14, 3, 1), /* CNTV_CTL_EL0 */
690696
ARM64_SYS_REG(3, 3, 14, 3, 2), /* CNTV_CVAL_EL0 */
691697
ARM64_SYS_REG(3, 3, 14, 0, 2),

0 commit comments

Comments
 (0)