]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: selftests: Rename vm_vaddr_populate_bitmap() => vm_populate_gva_bitmap()
authorSean Christopherson <seanjc@google.com>
Mon, 20 Apr 2026 21:19:58 +0000 (14:19 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 20 Apr 2026 21:54:17 +0000 (14:54 -0700)
Now that KVM selftests use gva_t instead of vm_vaddr_t, rename the helper
for populating the initial GVA bitmap to drop the defunct terminology and
use "vm" for the scope.

Opportunistically fixup the declaration of the API, which has been broken
since day 1.  The flaw went unnoticed because the sole caller is defined
after the weak version, i.e. can see the prototype without a previous
declaration.

No functional change intended.

Fixes: e8b9a055fa04 ("KVM: arm64: selftests: Align VA space allocator with TTBR0")
Link: https://patch.msgid.link/20260420212004.3938325-14-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/arm64/processor.c
tools/testing/selftests/kvm/lib/kvm_util.c

index 0239e89320e576af840a61010124400fa1d44c3e..0fbfb2a28767f45c606e0d5b2fb751f38e118038 100644 (file)
@@ -714,7 +714,7 @@ void vm_mem_region_reload(struct kvm_vm *vm, u32 slot);
 void vm_mem_region_move(struct kvm_vm *vm, u32 slot, u64 new_gpa);
 void vm_mem_region_delete(struct kvm_vm *vm, u32 slot);
 struct kvm_vcpu *__vm_vcpu_add(struct kvm_vm *vm, u32 vcpu_id);
-void vm_populate_vaddr_bitmap(struct kvm_vm *vm);
+void vm_populate_gva_bitmap(struct kvm_vm *vm);
 gva_t vm_unused_gva_gap(struct kvm_vm *vm, size_t sz, gva_t vaddr_min);
 gva_t vm_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min);
 gva_t __vm_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
index c4f0e37f29077a9f8c28b4013f501fd51405385b..384b6c80b1e7b1fc31827d1b48521cc463185212 100644 (file)
@@ -671,7 +671,7 @@ void kvm_selftest_arch_init(void)
        guest_modes_append_default();
 }
 
-void vm_vaddr_populate_bitmap(struct kvm_vm *vm)
+void vm_populate_gva_bitmap(struct kvm_vm *vm)
 {
        /*
         * arm64 selftests use only TTBR0_EL1, meaning that the valid VA space
index 8c82b40a744894da4b6e4f10d3ee1a5c9921c2cb..1a1b41021cc7f62577a319935eacaf86f8e26d46 100644 (file)
@@ -267,7 +267,7 @@ _Static_assert(sizeof(vm_guest_mode_params)/sizeof(struct vm_guest_mode_params)
  * based on the MSB of the VA. On architectures with this behavior
  * the VA region spans [0, 2^(va_bits - 1)), [-(2^(va_bits - 1), -1].
  */
-__weak void vm_vaddr_populate_bitmap(struct kvm_vm *vm)
+__weak void vm_populate_gva_bitmap(struct kvm_vm *vm)
 {
        sparsebit_set_num(vm->vpages_valid,
                0, (1ULL << (vm->va_bits - 1)) >> vm->page_shift);
@@ -385,7 +385,7 @@ struct kvm_vm *____vm_create(struct vm_shape shape)
 
        /* Limit to VA-bit canonical virtual addresses. */
        vm->vpages_valid = sparsebit_alloc();
-       vm_vaddr_populate_bitmap(vm);
+       vm_populate_gva_bitmap(vm);
 
        /* Limit physical addresses to PA-bits. */
        vm->max_gfn = vm_compute_max_gfn(vm);