Skip to content

Commit

Permalink
kernel: fix kernel v4.10 support
Browse files Browse the repository at this point in the history
We hadn't adjusted to some of the changes that came in kernel
v4.10. This commit ensure we use the new version of
get_user_pages_remote() and use the proper member of the struct
vm_fault with this kernel version.

Fixes hpc#17

Signed-off-by: Nathan Hjelm <[email protected]>
  • Loading branch information
hjelmn committed Mar 7, 2018
1 parent 3f1a048 commit f0f4dc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion kernel/xpmem_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ xpmem_fault_handler(struct vm_area_struct *vma, struct vm_fault *vmf)
{
int ret, att_locked = 0;
int seg_tg_mmap_sem_locked = 0, vma_verification_needed = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
u64 vaddr = (u64)(uintptr_t) vmf->address;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
struct vm_area_struct *vma = vmf->vma;
#endif
#else
u64 vaddr = (u64)(uintptr_t) vmf->virtual_address;
#endif
Expand Down
2 changes: 1 addition & 1 deletion kernel/xpmem_pfn.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ xpmem_pin_page(struct xpmem_thread_group *tg, struct task_struct *src_task,
}

/* get_user_pages() faults and pins the page */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
ret = get_user_pages_remote (src_task, src_mm, vaddr, 1, FOLL_WRITE | FOLL_FORCE,
&page, NULL, NULL);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
Expand Down

0 comments on commit f0f4dc9

Please sign in to comment.