KVM: arm64: Export kvm_are_all_memslots_empty()
authorRicardo Koller <ricarkol@google.com>
Wed, 26 Apr 2023 17:23:22 +0000 (17:23 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Tue, 16 May 2023 17:39:18 +0000 (17:39 +0000)
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>
include/linux/kvm_host.h
virt/kvm/kvm_main.c

index 0e571e973bc283c50d910d4fbda03cb49b741f16..7651069ada46b2b51ac577df8b1750b3e6e53bef 100644 (file)
@@ -991,6 +991,8 @@ static inline bool kvm_memslots_empty(struct kvm_memslots *slots)
        return RB_EMPTY_ROOT(&slots->gfn_tree);
 }
 
+bool kvm_are_all_memslots_empty(struct kvm *kvm);
+
 #define kvm_for_each_memslot(memslot, bkt, slots)                            \
        hash_for_each(slots->id_hash, bkt, memslot, id_node[slots->node_idx]) \
                if (WARN_ON_ONCE(!memslot->npages)) {                         \
index cb5c13eee1936e16e4226d1a355fc5d249666472..13aed654111a25193f9d49f8ff325421cc34fc10 100644 (file)
@@ -4598,7 +4598,7 @@ int __attribute__((weak)) kvm_vm_ioctl_enable_cap(struct kvm *kvm,
        return -EINVAL;
 }
 
-static bool kvm_are_all_memslots_empty(struct kvm *kvm)
+bool kvm_are_all_memslots_empty(struct kvm *kvm)
 {
        int i;
 
@@ -4611,6 +4611,7 @@ static bool kvm_are_all_memslots_empty(struct kvm *kvm)
 
        return true;
 }
+EXPORT_SYMBOL_GPL(kvm_are_all_memslots_empty);
 
 static int kvm_vm_ioctl_enable_cap_generic(struct kvm *kvm,
                                           struct kvm_enable_cap *cap)