diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2025-09-17 14:20:31 -0700 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2025-09-24 19:23:31 +0100 |
| commit | 7326348209a0079a83c7bd7963a0e32d26af61c8 (patch) | |
| tree | f4b2502a5ddbd7d7ba14fc8b43cbc43271322ab4 /tools/testing/selftests/kvm/lib/arm64/processor.c | |
| parent | b320789d6883cc00ac78ce83bccbfe7ed58afcf0 (diff) | |
KVM: arm64: selftests: Provide kvm_arch_vm_post_create() in library code
In order to compel the default usage of EL2 in selftests, move
kvm_arch_vm_post_create() to library code and expose an opt-in for using
MTE by default.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/arm64/processor.c')
| -rw-r--r-- | tools/testing/selftests/kvm/lib/arm64/processor.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/arm64/processor.c b/tools/testing/selftests/kvm/lib/arm64/processor.c index eb115123d741..caed1998c7b3 100644 --- a/tools/testing/selftests/kvm/lib/arm64/processor.c +++ b/tools/testing/selftests/kvm/lib/arm64/processor.c @@ -653,3 +653,16 @@ void wfi(void) { asm volatile("wfi"); } + +static bool request_mte; + +void test_wants_mte(void) +{ + request_mte = true; +} + +void kvm_arch_vm_post_create(struct kvm_vm *vm) +{ + if (request_mte && vm_check_cap(vm, KVM_CAP_ARM_MTE)) + vm_enable_cap(vm, KVM_CAP_ARM_MTE, 0); +} |