Skip to content

Commit 26f4571

Browse files
Ricardo Kolleroupton
authored andcommitted
KVM: arm64: Export kvm_are_all_memslots_empty()
Export kvm_are_all_memslots_empty(). This will be used by a future commit when checking before setting a capability. Signed-off-by: Ricardo Koller <ricarkol@google.com> Reviewed-by: Shaoqin Huang <shahuang@redhat.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Link: https://lore.kernel.org/r/20230426172330.1439644-5-ricarkol@google.com Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent e7c0554 commit 26f4571

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

include/linux/kvm_host.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ static inline bool kvm_memslots_empty(struct kvm_memslots *slots)
991991
return RB_EMPTY_ROOT(&slots->gfn_tree);
992992
}
993993

994+
bool kvm_are_all_memslots_empty(struct kvm *kvm);
995+
994996
#define kvm_for_each_memslot(memslot, bkt, slots) \
995997
hash_for_each(slots->id_hash, bkt, memslot, id_node[slots->node_idx]) \
996998
if (WARN_ON_ONCE(!memslot->npages)) { \

virt/kvm/kvm_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4598,7 +4598,7 @@ int __attribute__((weak)) kvm_vm_ioctl_enable_cap(struct kvm *kvm,
45984598
return -EINVAL;
45994599
}
46004600

4601-
static bool kvm_are_all_memslots_empty(struct kvm *kvm)
4601+
bool kvm_are_all_memslots_empty(struct kvm *kvm)
46024602
{
46034603
int i;
46044604

@@ -4611,6 +4611,7 @@ static bool kvm_are_all_memslots_empty(struct kvm *kvm)
46114611

46124612
return true;
46134613
}
4614+
EXPORT_SYMBOL_GPL(kvm_are_all_memslots_empty);
46144615

46154616
static int kvm_vm_ioctl_enable_cap_generic(struct kvm *kvm,
46164617
struct kvm_enable_cap *cap)

0 commit comments

Comments
 (0)