KVM: selftests: Fix typo in vgic_init test
authorSean Christopherson <seanjc@google.com>
Wed, 16 Feb 2022 19:47:05 +0000 (11:47 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 14:14:40 +0000 (10:14 -0400)
When iterating over vCPUs, invoke access_v3_redist_reg() on the "current"
vCPU instead of vCPU0, which is presumably what was intended by iterating
over all vCPUs.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/aarch64/vgic_init.c

index 0f046e3..defd196 100644 (file)
@@ -426,8 +426,9 @@ static void test_v3_typer_accesses(void)
                          KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true);
 
        for (i = 0; i < NR_VCPUS ; i++) {
-               ret = access_v3_redist_reg(v.gic_fd, 0, GICR_TYPER, &val, false);
-               TEST_ASSERT(!ret && !val, "read GICR_TYPER before rdist region setting");
+               ret = access_v3_redist_reg(v.gic_fd, i, GICR_TYPER, &val, false);
+               TEST_ASSERT(!ret && val == i * 0x100,
+                           "read GICR_TYPER before rdist region setting");
        }
 
        addr = REDIST_REGION_ATTR_ADDR(2, 0x200000, 0, 0);