Skip to content

Commit 5dd544e

Browse files
reijiw-kvmMarc Zyngier
authored andcommitted
KVM: arm64: selftests: Change debug_version() to take ID_AA64DFR0_EL1
Change debug_version() to take the ID_AA64DFR0_EL1 value instead of vcpu as an argument, and change its callsite to read ID_AA64DFR0_EL1 (and pass it to debug_version()). Subsequent patches will reuse the register value in the callsite. No functional change intended. Signed-off-by: Reiji Watanabe <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 948f439 commit 5dd544e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/testing/selftests/kvm/aarch64/debug-exceptions.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,8 @@ static void guest_code_ss(int test_cnt)
337337
GUEST_DONE();
338338
}
339339

340-
static int debug_version(struct kvm_vcpu *vcpu)
340+
static int debug_version(uint64_t id_aa64dfr0)
341341
{
342-
uint64_t id_aa64dfr0;
343-
344-
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &id_aa64dfr0);
345342
return FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_DEBUGVER), id_aa64dfr0);
346343
}
347344

@@ -466,9 +463,11 @@ int main(int argc, char *argv[])
466463
struct kvm_vm *vm;
467464
int opt;
468465
int ss_iteration = 10000;
466+
uint64_t aa64dfr0;
469467

470468
vm = vm_create_with_one_vcpu(&vcpu, guest_code);
471-
__TEST_REQUIRE(debug_version(vcpu) >= 6,
469+
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &aa64dfr0);
470+
__TEST_REQUIRE(debug_version(aa64dfr0) >= 6,
472471
"Armv8 debug architecture not supported.");
473472
kvm_vm_free(vm);
474473

0 commit comments

Comments
 (0)