- Posts: 1
- Joined: Fri Jan 20, 2017 6:01 am
Hello,
blackmagic-10.8.4a4 and blackmagic-io-10.8.4a4 fail to compile with DKMS on Linux kernel 4.9, which was released in mid-December and is now available in Debian unstable (sid). The compilation failure is due to a relatively simple change (commit 768ae309a96103ed02eb1e111e838c87854d8b51) to the get_user_pages and get_user_pages_remote functions.
Here's some simple patches to resolve the issue. I built the modified code successfully in Linux 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 GNU/Linux, and confirmed that my Intensity Pro 4K appears to work properly.
(Sorry if this is in the wrong place. I noticed that the earlier incompatibility in this function was also posted here in thread 49626.)
blackmagic-10.8.4a4 and blackmagic-io-10.8.4a4 fail to compile with DKMS on Linux kernel 4.9, which was released in mid-December and is now available in Debian unstable (sid). The compilation failure is due to a relatively simple change (commit 768ae309a96103ed02eb1e111e838c87854d8b51) to the get_user_pages and get_user_pages_remote functions.
Here's some simple patches to resolve the issue. I built the modified code successfully in Linux 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64 GNU/Linux, and confirmed that my Intensity Pro 4K appears to work properly.
- Code: Select all
diff -Naur ./blackmagic_lib.c /usr/src/blackmagic-10.8.4a4/blackmagic_lib.c
--- ./blackmagic_lib.c 2017-01-19 20:33:03.761221314 -0500
+++ /usr/src/blackmagic-10.8.4a4/blackmagic_lib.c 2017-01-19 20:36:35.075101131 -0500
@@ -662,7 +662,12 @@
write = 0;
down_read(¤t_task->mm->mmap_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ if (current_task == current)
+ ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0 , pages, NULL);
+ else
+ ret = get_user_pages_remote(current_task, current_task->mm, (unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
if (current_task == current)
ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write, 0, pages, NULL);
else
- Code: Select all
diff -Naur ./bm_mm.c /usr/src/blackmagic-io-10.8.4a4/bm_mm.c
--- ./bm_mm.c 2017-01-19 20:33:03.769221561 -0500
+++ /usr/src/blackmagic-io-10.8.4a4/bm_mm.c 2017-01-19 20:37:55.746770949 -0500
@@ -103,7 +103,12 @@
return false;
down_read(&task->mm->mmap_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ if (task == current)
+ ret = get_user_pages((unsigned long)address & PAGE_MASK, umem->length, write ? FOLL_WRITE : 0, umem->pages, NULL);
+ else
+ ret = get_user_pages_remote(task, task->mm, (unsigned long)address & PAGE_MASK, umem->length, write ? FOLL_WRITE : 0, umem->pages, NULL);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
if (task == current)
ret = get_user_pages((unsigned long)address & PAGE_MASK, umem->length, write, 0, umem->pages, NULL);
else
(Sorry if this is in the wrong place. I noticed that the earlier incompatibility in this function was also posted here in thread 49626.)