memflow / memflow-kvm

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

Linux 5.9 support #1

Closed mkuehn94 closed 3 years ago

mkuehn94 commented 3 years ago

Trying to compile your kernel module but getting the error:

make[1]: Entering directory '/usr/lib/modules/5.9.1-arch1-1/build' CC [M] /home/max/Documents/git/memflow-kvm/build/main.o /home/max/Documents/git/memflow-kvm/memflow-kmod/main.c:11:10: fatal error: kallsyms/ksyms.h: No such file or directory 11 | #include "kallsyms/ksyms.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated.

target system: OS: Arch Linux x86_64 Kernel: 5.9.1-arch1-1

trying to install for the archive from releases leaves me with following error log: https://pastebin.com/6nCLkzsv

any help would be greatly appreciated

h33p commented 3 years ago

Hey there! Thanks for the issue report! Your particular issue is about git submodules not being initialized. It can be solved with this command:

git submodule update --init

I should totally make that clear in the README!

However, this is not all. From the logs I can see that ~there are errors specific to Linux version 5.9~ your kernel does not have CONFIG_LIVEPATCH enabled. It appears to be the default for Arch linux. This will require me updating the code to fix that. I'm sorry, but it will take a few days!

In the meantime, you could prototype your code with the qemu-procfs connector.

mkuehn94 commented 3 years ago

thank you so much for your help!

h33p commented 3 years ago

You're welcome! I have updated the kallsyms module, which should work better, tell me if that fixes the issue!

mkuehn94 commented 3 years ago

thank you! it seems like it fixed something because i get other errors now when compiling vmtools.c https://pastebin.com/8JT6KmAV

TTMDragon commented 3 years ago

thank you! it seems like it fixed something because i get other errors now when compiling vmtools.c https://pastebin.com/8JT6KmAV

This can be fixed by modifying /memflow-kvm/memflow-kmod/vmtools.c:246 to data->nr_pages = get_user_pages_remote(data->wrapped_task->mm, data->wrapped_vma->vm_start, nr_pages, foll_flags, data->pages, tmp_vmas, NULL);

Tested on 5.9.3-arch1 and it's working.

h33p commented 3 years ago

Thank you! I will get a 5.9 kernel up and running, and then will push an update adding support

h33p commented 3 years ago

I have pushed an update for 5.9 support! It should compile now. I will see if there are any 5.10 changes too, then issue a release, and close the issue, if everything works.

h33p commented 3 years ago

5.10 should work as well, closing. Thanks for reporting it :)