]> www.infradead.org Git - users/hch/configfs.git/commitdiff
KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper
authorSean Christopherson <seanjc@google.com>
Fri, 27 Oct 2023 18:22:06 +0000 (11:22 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Nov 2023 13:01:05 +0000 (08:01 -0500)
Drop kvm_userspace_memory_region_find(), it's unused and a terrible API
(probably why it's unused).  If anything outside of kvm_util.c needs to
get at the memslot, userspace_mem_region_find() can be exposed to give
others full access to all memory region/slot information.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20231027182217.3615211-25-seanjc@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/kvm_util.c

index a18db6a7b3cf474fe48cacf16bd962123f977e42..967eaaeacd756ea0bf87d61b1504260ce9bc0368 100644 (file)
@@ -776,10 +776,6 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned int num_guest_pages)
        return n;
 }
 
-struct kvm_userspace_memory_region *
-kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start,
-                                uint64_t end);
-
 #define sync_global_to_guest(vm, g) ({                         \
        typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g));     \
        memcpy(_p, &(g), sizeof(g));                            \
index 7a8af1821f5dae2993995c60e0ef08faa6431919..f09295d56c2361a8cb4364b7f33ab58f00d151e4 100644 (file)
@@ -590,35 +590,6 @@ userspace_mem_region_find(struct kvm_vm *vm, uint64_t start, uint64_t end)
        return NULL;
 }
 
-/*
- * KVM Userspace Memory Region Find
- *
- * Input Args:
- *   vm - Virtual Machine
- *   start - Starting VM physical address
- *   end - Ending VM physical address, inclusive.
- *
- * Output Args: None
- *
- * Return:
- *   Pointer to overlapping region, NULL if no such region.
- *
- * Public interface to userspace_mem_region_find. Allows tests to look up
- * the memslot datastructure for a given range of guest physical memory.
- */
-struct kvm_userspace_memory_region *
-kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start,
-                                uint64_t end)
-{
-       struct userspace_mem_region *region;
-
-       region = userspace_mem_region_find(vm, start, end);
-       if (!region)
-               return NULL;
-
-       return &region->region;
-}
-
 __weak void vcpu_arch_free(struct kvm_vcpu *vcpu)
 {