memflow / memflow-kvm

Linux kernel module for memflow's KVM connector
MIT License
36 stars 8 forks source link

Building on RHEL 8.8 Fails due to function redefinition. #12

Open slack2450 opened 1 year ago

slack2450 commented 1 year ago

I'm no kernel expert but the checks for LINUX_VERSION_CODE appear to not account for some functions being available much earlier than stated.

For example I get

/home/joss/memflow-kvm/memflow-kmod/mmap_lock.h:9:20: error: redefinition of ‘mmap_write_lock’
 static inline void mmap_write_lock(struct mm_struct *mm)

Which was resolved by removing the check for kernel version 5.8.0 in mmap_lock.h

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)

Another error that pops up is:

error: macro "kvm_for_each_memslot" requires 3 arguments, but only 2 given kvm_for_each_memslot2(slot, bkt, slots)

Which was resolved by removing the check for kernel version 5.17.0 in vmtools.c

#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)

It seems these kernel features are being found in much older kernels than expected, but this also causes issues with pre-built installation using dkms.

slack2450 commented 1 year ago

Proposed fix in #13