Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: Move declaration of kvm_cpu_dirty_log_size() to kvm_dirty_ring.h

Not all architectures like ARM64 need to override the function. Move
its declaration to kvm_dirty_ring.h to avoid the following compiling
warning on ARM64 when the feature is enabled.

arch/arm64/kvm/../../../virt/kvm/dirty_ring.c:14:12: \
warning: no previous prototype for 'kvm_cpu_dirty_log_size' \
[-Wmissing-prototypes] \
int __weak kvm_cpu_dirty_log_size(void)

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221110104914.31280-3-gshan@redhat.com

authored by

Gavin Shan and committed by
Marc Zyngier
e8a18565 cf87ac73

+1 -2
-2
arch/x86/include/asm/kvm_host.h
··· 2090 2090 #define GET_SMSTATE(type, buf, offset) \ 2091 2091 (*(type *)((buf) + (offset) - 0x7e00)) 2092 2092 2093 - int kvm_cpu_dirty_log_size(void); 2094 - 2095 2093 int memslot_rmap_alloc(struct kvm_memory_slot *slot, unsigned long npages); 2096 2094 2097 2095 #define KVM_CLOCK_VALID_FLAGS \
+1
include/linux/kvm_dirty_ring.h
··· 66 66 67 67 #else /* CONFIG_HAVE_KVM_DIRTY_RING */ 68 68 69 + int kvm_cpu_dirty_log_size(void); 69 70 u32 kvm_dirty_ring_get_rsvd_entries(void); 70 71 int kvm_dirty_ring_alloc(struct kvm_dirty_ring *ring, int index, u32 size); 71 72