やるきなし

2017/02/20 13:03 / nvidia-kernel-dkms 340.96-1 on Linux 4.10

以下の kernel の修正に対する対応が必要.NVIDIA 375.26 Kernel 4.10-rc1 (w/ CPU hotplug workaround) を参考に.

--- a/nv-linux.h
+++ b/nv-linux.h
@@ -277,11 +277,13 @@ RM_STATUS nvos_forward_error_to_cray(struct pci_dev *, NvU32,
 
 extern int nv_pat_mode;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 #if !defined(NV_VMWARE) && defined(CONFIG_HOTPLUG_CPU)
 #define NV_ENABLE_HOTPLUG_CPU
 #include <linux/cpu.h>              /* CPU hotplug support              */
 #include <linux/notifier.h>         /* struct notifier_block, etc       */
 #endif
+#endif
 
 #if !defined(NV_VMWARE) && \
   (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE))
--- a/os-mlock.c
+++ b/os-mlock.c
@@ -50,8 +50,13 @@ RM_STATUS NV_API_CALL os_lock_user_pages(
        unsigned int flags = 0;
        if(write) flags |= FOLL_WRITE;
        if(force) flags |= FOLL_FORCE;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+       ret = get_user_pages_remote(current, mm, (unsigned long)address,
+                       page_count, flags, user_pages, NULL, NULL);
+#else
        ret = get_user_pages_remote(current, mm, (unsigned long)address,
                        page_count, flags, user_pages, NULL);
+#endif
     }
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
     ret = get_user_pages_remote(current, mm, (unsigned long)address,
--- a/uvm/nvidia_uvm_lite.c
+++ b/uvm/nvidia_uvm_lite.c
@@ -815,7 +815,7 @@ done:
 #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
 int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-    unsigned long vaddr = (unsigned long)vmf->virtual_address;
+    unsigned long vaddr = (unsigned long)vmf->address;
     struct page *page = NULL;
     int retval;
 

Related articles