memflow / memflow-kvm

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

Add checks for RHEL8.8 #13

Open slack2450 opened 1 year ago

slack2450 commented 1 year ago

It would be worth testing on a machine that isn't redhat to make sure this doesn't cause issues

h33p commented 1 year ago

I don't quite trust this mechanism working really well, because it is not clear which older versions it was backported to. I think ideal thing to check would be existence of mmap_lock.h file:

$ grep -r "mmap_write_lock" /lib/modules/$(uname -r)/source          
/lib/modules/6.2.9-200.fc37.x86_64/source/include/linux/mmu_notifier.h: mmap_write_lock(mm);
/lib/modules/6.2.9-200.fc37.x86_64/source/include/linux/mmap_lock.h:static inline void mmap_write_lock(struct mm_struct *mm)
/lib/modules/6.2.9-200.fc37.x86_64/source/include/linux/mmap_lock.h:static inline void mmap_write_lock_nested(struct mm_struct *mm, int subclass)
/lib/modules/6.2.9-200.fc37.x86_64/source/include/linux/mmap_lock.h:static inline int mmap_write_lock_killable(struct mm_struct *mm)

Could you check for existence of the file in the Makefile and define a variable, something like HAS_MMAP_LOCK?