diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-12-08 19:46:22 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-12-08 19:46:22 +0100 |
commit | 849c1816436fe359e85587fba5b69ddd3a957b31 (patch) | |
tree | bd1609137b5fa3a5c4830aad6328683c4d8bd96d | |
parent | selftests/kvm: fix compilation on non-x86_64 platforms (diff) | |
download | linux-849c1816436fe359e85587fba5b69ddd3a957b31.tar.xz linux-849c1816436fe359e85587fba5b69ddd3a957b31.zip |
KVM: selftests: fix supported_flags for aarch64
KVM/Arm supports readonly memslots; fix the calculation of
supported_flags in set_memory_region_test.c, otherwise the
test fails.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | tools/testing/selftests/kvm/set_memory_region_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c index 6637a0845acf..dfd1d1e22da3 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -333,9 +333,11 @@ static void test_invalid_memory_region_flags(void) struct kvm_vm *vm; int r, i; -#ifdef __x86_64__ +#if defined __aarch64__ || defined __x86_64__ supported_flags |= KVM_MEM_READONLY; +#endif +#ifdef __x86_64__ if (kvm_check_cap(KVM_CAP_VM_TYPES) & BIT(KVM_X86_SW_PROTECTED_VM)) vm = vm_create_barebones_protected_vm(); else |