やるきなし

2018/11/06 11:30 / Linux 4.19.0 -> 4.20-rc1

4.20-rc1が出たので.configがどう変更されるのか見てみた.以下 - は削除されたもの,+ は追加されたもの.汎用指向の環境.Linux 5.0 になるのは来年らしい.

DKMS

broadcom-sta-dkms (6.30.223.271-9.1)は以下で compile できない.

Assembler messages:
Error: can't open arch/x86/kernel/macros.s for reading: No such file or directory

arch/x86/kernel/macros.s/usr/src/linux-headers-4.20.0-hoge-01/arch/x86/kernel/ に配置してあげると compile できる.

nvidia-kernel-dkms (390.87-2) は conftest の段階で以下の error.これ以上はひとまず追わず.

#error INIT_WORK() conftest failed!
#error kmem_cache_create() conftest failed!
#error on_each_cpu() conftest failed!
#error smp_call_function() conftest failed!
#error acpi_walk_namespace() conftest failed!
#error pci_dma_mapping_error() conftest failed!
#error wait_on_bit_lock() conftest failed!
#error radix_tree_replace_slot() conftest failed!

追記 (2018/12/14)

まず上記 conftest の失敗は arch/x86/kernel/macros.s を見に行くことが原因.nvidia-legacy についても同様.以下で解決.Version は nvidia-kernel-dkms (390.87-3) と nvidia-legacy-340xx-kernel-dkms 340.107-3.

# cd /usr/src/nvidia-current-390.87
# ln -s /usr/src/linux-headers-4.20.0-rcX-hogege-01/arch .
# cd /usr/src/nvidia-legacy-340xx-340.107
# ln -s /usr/src/linux-headers-4.20.0-rcX-hogege-01/arch .
# cd /usr/src/nvidia-legacy-340xx-340.107/uvm
# ln -s /usr/src/linux-headers-4.20.0-rcX-hogege-01/arch .

nvidia-current (390.87-3) は以下で compile に失敗する.Kernel の mm: change return type to vm_fault_tによる変更に由来する.

/var/lib/dkms/nvidia/current-390.87/build/nvidia-drm/nvidia-drm-gem-nvkms-memory.c: In function ‘__nv_drm_vma_fault’:
/var/lib/dkms/nvidia/current-390.87/build/nvidia-drm/nvidia-drm-gem-nvkms-memory.c:240:11: error: implicit declaration of function ‘vm_insert_pfn’; did you mean ‘vmf_insert_pfn’? [-Werror=implicit-function-declaration]
     ret = vm_insert_pfn(vma, address, pfn + page_offset);
           ^~~~~~~~~~~~~
           vmf_insert_pfn

以下の patch で解決.

--- a/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ b/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -230,31 +230,15 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,
     struct nv_drm_gem_nvkms_memory *nv_nvkms_memory = to_nv_nvkms_memory(
         to_nv_gem_object(gem));
     unsigned long page_offset, pfn;
-    int ret = -EINVAL;
+    vm_fault_t ret;
 
     pfn = (unsigned long)(uintptr_t)nv_nvkms_memory->pPhysicalAddress;
     pfn >>= PAGE_SHIFT;
 
     page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
 
-    ret = vm_insert_pfn(vma, address, pfn + page_offset);
-
-    switch (ret) {
-        case 0:
-        case -EBUSY:
-            /*
-             * EBUSY indicates that another thread already handled
-             * the faulted range.
-             */
-            return VM_FAULT_NOPAGE;
-        case -ENOMEM:
-            return VM_FAULT_OOM;
-        default:
-            WARN_ONCE(1, "Unhandled error in %s: %d\n", __FUNCTION__, ret);
-            break;
-    }
-
-    return VM_FAULT_SIGBUS;
+    ret = vmf_insert_pfn(vma, address, pfn + page_offset);
+    return ret;
 }
 
 /*