Skip to content

Commit 335869c

Browse files
sean-jcbonzini
authored andcommitted
KVM: selftests: Drop unused kvm_userspace_memory_region_find() helper
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>
1 parent 89ea60c commit 335869c

2 files changed

Lines changed: 0 additions & 33 deletions

File tree

tools/testing/selftests/kvm/include/kvm_util_base.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,6 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned int num_guest_pages)
776776
return n;
777777
}
778778

779-
struct kvm_userspace_memory_region *
780-
kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start,
781-
uint64_t end);
782-
783779
#define sync_global_to_guest(vm, g) ({ \
784780
typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g)); \
785781
memcpy(_p, &(g), sizeof(g)); \

tools/testing/selftests/kvm/lib/kvm_util.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -590,35 +590,6 @@ userspace_mem_region_find(struct kvm_vm *vm, uint64_t start, uint64_t end)
590590
return NULL;
591591
}
592592

593-
/*
594-
* KVM Userspace Memory Region Find
595-
*
596-
* Input Args:
597-
* vm - Virtual Machine
598-
* start - Starting VM physical address
599-
* end - Ending VM physical address, inclusive.
600-
*
601-
* Output Args: None
602-
*
603-
* Return:
604-
* Pointer to overlapping region, NULL if no such region.
605-
*
606-
* Public interface to userspace_mem_region_find. Allows tests to look up
607-
* the memslot datastructure for a given range of guest physical memory.
608-
*/
609-
struct kvm_userspace_memory_region *
610-
kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start,
611-
uint64_t end)
612-
{
613-
struct userspace_mem_region *region;
614-
615-
region = userspace_mem_region_find(vm, start, end);
616-
if (!region)
617-
return NULL;
618-
619-
return &region->region;
620-
}
621-
622593
__weak void vcpu_arch_free(struct kvm_vcpu *vcpu)
623594
{
624595

0 commit comments

Comments
 (0)