Skip to content

Commit cb7c4f3

Browse files
author
Marc Zyngier
committed
KVM: selftests: arm64: Initialise default guest mode at test startup time
As we are going to add support for a variable default mode on arm64, let's make sure it is setup first by using a constructor that gets called before the actual test runs. Suggested-by: Andrew Jones <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d58071a commit cb7c4f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/testing/selftests/kvm/lib/aarch64/processor.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,3 +432,12 @@ uint32_t guest_get_vcpuid(void)
432432
{
433433
return read_sysreg(tpidr_el1);
434434
}
435+
436+
/*
437+
* arm64 doesn't have a true default mode, so start by computing the
438+
* available IPA space and page sizes early.
439+
*/
440+
void __attribute__((constructor)) init_guest_modes(void)
441+
{
442+
guest_modes_append_default();
443+
}

0 commit comments

Comments
 (0)