KVM: selftests: fix supported_flags for aarch64
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Dec 2023 18:46:22 +0000 (13:46 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Dec 2023 18:46:22 +0000 (13:46 -0500)
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>
tools/testing/selftests/kvm/set_memory_region_test.c

index 6637a0845acf0437153d6ad015e9a885570ca4da..dfd1d1e22da32cd75dd850a7bccf1f39d59da5a9 100644 (file)
@@ -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