Bug#928634: nvidia-legacy-390xx-kernel-source: Fails to build with kernel 5.1
Kevin Locke
kevin at kevinlocke.name
Wed May 8 02:13:31 BST 2019
Package: nvidia-legacy-390xx-kernel-source
Version: 390.116-1
Severity: normal
Tags: patch
Dear Maintainer,
nvidia-legacy-390xx-kernel fails to build with Linux 5.1 due to errors
such as the following:
/usr/src/modass/usr_src/modules/nvidia-legacy-390xx-kernel/common/inc/nv-list-helpers.h:94:19: error: redefinition of ‘list_is_first’
static inline int list_is_first(const struct list_head *list,
^~~~~~~~~~~~~
In file included from ./include/linux/preempt.h:11,
from ./include/linux/spinlock.h:51,
from /usr/src/modass/usr_src/modules/nvidia-legacy-390xx-kernel/common/inc/nv-lock.h:16,
from /usr/src/modass/usr_src/modules/nvidia-legacy-390xx-kernel/common/inc/nv-linux.h:19,
from /usr/src/modass/usr_src/modules/nvidia-legacy-390xx-kernel/nvidia/nv-frontend.c:13:
./include/linux/list.h:214:19: note: previous definition of ‘list_is_first’ was here
static inline int list_is_first(const struct list_head *list,
^~~~~~~~~~~~~
Presumably this will be fixed by the next release in the 390 series.
Until then, I have attached a patch with the minimal necessary changes
backported from 418.74. I compiled and tested (by running some
graphics-intensive workloads) the module on an amd64 system, but have
not tested on arm or i386.
Best,
Kevin
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.1.0 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages nvidia-legacy-390xx-kernel-source depends on:
pn debhelper-compat <none>
ii make 4.2.1-1.2
ii quilt 0.65-3
ii xz-utils 5.2.4-1
Versions of packages nvidia-legacy-390xx-kernel-source recommends:
ii module-assistant 0.11.10
ii nvidia-legacy-390xx-kernel-support 390.116-1
Versions of packages nvidia-legacy-390xx-kernel-source suggests:
ii nvidia-legacy-390xx-driver 390.116-1
Versions of packages nvidia-legacy-390xx-driver depends on:
ii nvidia-installer-cleanup 20151021+9
ii nvidia-legacy-390xx-alternative 390.116-1
ii nvidia-legacy-390xx-driver-bin 390.116-1
ii nvidia-legacy-390xx-driver-libs 390.116-1
ii nvidia-legacy-390xx-kernel-5.0.8 [nvidia-legacy-390xx-k 390.116-1+5.0.8-9
ii nvidia-legacy-390xx-kernel-5.1.0 [nvidia-legacy-390xx-k 390.116-1+5.1.0-11
ii nvidia-legacy-390xx-vdpau-driver 390.116-1
ii nvidia-support 20151021+9
ii xserver-xorg-video-nvidia-legacy-390xx 390.116-1
Versions of packages nvidia-legacy-390xx-driver recommends:
ii libnvidia-legacy-390xx-cfg1 390.116-1
pn nvidia-persistenced <none>
ii nvidia-settings-legacy-390xx 390.116-1
nvidia-legacy-390xx-driver suggests no packages.
Versions of packages nvidia-legacy-390xx-driver-libs:amd64 depends on:
ii libgl1-nvidia-legacy-390xx-glvnd-glx 390.116-1
ii nvidia-legacy-390xx-egl-icd 390.116-1
Versions of packages nvidia-legacy-390xx-driver-libs:amd64 recommends:
ii libgles-nvidia-legacy-390xx1 390.116-1
ii libgles-nvidia-legacy-390xx2 390.116-1
ii libglx-nvidia-legacy-390xx0 390.116-1
ii libnvidia-legacy-390xx-cfg1 390.116-1
ii libopengl0 1.1.0-1
pn nvidia-legacy-390xx-driver-libs-i386 <none>
ii nvidia-legacy-390xx-vulkan-icd 390.116-1
Versions of packages xserver-xorg-video-nvidia-legacy-390xx depends on:
ii libc6 2.28-10
ii libnvidia-legacy-390xx-glcore 390.116-1
ii nvidia-installer-cleanup 20151021+9
ii nvidia-legacy-390xx-alternative 390.116-1
ii nvidia-support 20151021+9
ii xserver-xorg-core [xorg-video-abi-24] 2:1.20.3-1
Versions of packages xserver-xorg-video-nvidia-legacy-390xx recommends:
ii nvidia-legacy-390xx-driver 390.116-1
ii nvidia-legacy-390xx-kernel-5.0.8 [nvidia-legacy-390xx-k 390.116-1+5.0.8-9
ii nvidia-legacy-390xx-kernel-5.1.0 [nvidia-legacy-390xx-k 390.116-1+5.1.0-11
ii nvidia-legacy-390xx-vdpau-driver 390.116-1
ii nvidia-settings-legacy-390xx 390.116-1
xserver-xorg-video-nvidia-legacy-390xx suggests no packages.
Versions of packages nvidia-legacy-390xx-alternative depends on:
ii dpkg 1.19.6
ii glx-alternative-nvidia 1.0.0
Versions of packages glx-alternative-nvidia depends on:
ii dpkg 1.19.6
ii glx-alternative-mesa 1.0.0
ii glx-diversions 1.0.0
ii update-glx 1.0.0
Versions of packages glx-alternative-nvidia suggests:
pn nvidia-driver <none>
Versions of packages xserver-xorg-video-intel depends on:
ii libc6 2.28-10
ii libdrm-intel1 2.4.97-1
ii libdrm2 2.4.97-1
ii libpciaccess0 0.14-1
ii libpixman-1-0 0.36.0-1
ii libudev1 241-3
ii libx11-6 2:1.6.7-1
ii libx11-xcb1 2:1.6.7-1
ii libxcb-dri2-0 1.13.1-2
ii libxcb-dri3-0 1.13.1-2
ii libxcb-sync1 1.13.1-2
ii libxcb-util0 0.3.8-3+b2
ii libxcb1 1.13.1-2
ii libxcursor1 1:1.1.15-2
ii libxdamage1 1:1.1.4-3+b3
ii libxext6 2:1.3.3-1+b2
ii libxfixes3 1:5.0.3-1
ii libxinerama1 2:1.1.4-2
ii libxrandr2 2:1.5.1-1
ii libxrender1 1:0.9.10-1
ii libxshmfence1 1.3-1
ii libxss1 1:1.2.3-1
ii libxtst6 2:1.2.3-1
ii libxv1 2:1.0.11-1
ii libxvmc1 2:1.0.10-1
ii xserver-xorg-core [xorg-video-abi-24] 2:1.20.3-1
Versions of packages nvidia-legacy-390xx-kernel-source is related to:
pn bumblebee <none>
pn bumblebee-nvidia <none>
pn ccache <none>
pn libcuda1 <none>
pn libdrm-nouveau1 <none>
pn libdrm-nouveau1a <none>
ii libdrm-nouveau2 2.4.97-1
ii libegl1 1.1.0-1
ii libgl1 1.1.0-1
ii libgl1-nvidia-legacy-390xx-glvnd-glx [libgl1-nvidia-glx-any] 390.116-1
ii libgles1 1.1.0-1
ii libgles2 1.1.0-1
ii libglvnd0 1.1.0-1
ii libglx0 1.1.0-1
ii libnvidia-legacy-390xx-cuda1 [libcuda1-any] 390.116-1
pn libopencl0 <none>
ii libvulkan1 1.1.97-2
pn linux-headers <none>
ii make 4.2.1-1.2
pn nvidia-glx-legacy-390xx <none>
ii nvidia-kernel-common 20151021+9
ii nvidia-legacy-390xx-driver [nvidia-glx-any] 390.116-1
pn nvidia-legacy-390xx-kernel-dkms <none>
ii nvidia-legacy-390xx-kernel-source 390.116-1
ii nvidia-legacy-390xx-kernel-support [nvidia-kernel-support-any] 390.116-1
ii nvidia-legacy-390xx-opencl-icd [opencl-icd] 390.116-1
ii nvidia-legacy-390xx-vulkan-icd [vulkan-icd] 390.116-1
ii nvidia-modprobe 418.56-1
pn nvidia-settings <none>
ii nvidia-support 20151021+9
pn nvidia-xconfig <none>
ii ocl-icd-libopencl1 [libopencl1] 2.2.12-2
ii xserver-xorg 1:7.7+19
ii xserver-xorg-core 2:1.20.3-1
ii xserver-xorg-legacy 2:1.20.3-1
ii xserver-xorg-video-nouveau 1:1.0.16-1
ii xserver-xorg-video-nvidia-legacy-390xx [xserver-xorg-video-nvid 390.116-1
-- no debconf information
-------------- next part --------------
Author: Kevin Locke <kevin at kevinlocke.name>
Description: backport changes from 418.74 for kernel 5.1.patch
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -1082,6 +1082,10 @@
#define NV_PAGE_MASK (NvU64)(long)PAGE_MASK
+#ifndef NV_VMF_INSERT_PFN_PRESENT
+typedef int vm_fault_t;
+#endif
+
extern void *nvidia_stack_t_cache;
// Changed in 2.6.23 via commit 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac
--- a/common/inc/nv-list-helpers.h
+++ b/common/inc/nv-list-helpers.h
@@ -91,10 +91,12 @@
list_entry((pos)->member.next, typeof(*(pos)), member)
#endif
-static inline int list_is_first(const struct list_head *list,
- const struct list_head *head)
-{
- return list->prev == head;
-}
+#if !defined(NV_LIST_IS_FIRST_PRESENT)
+ static inline int list_is_first(const struct list_head *list,
+ const struct list_head *head)
+ {
+ return list->prev == head;
+ }
+#endif
#endif // __NV_LIST_HELPERS_H__
--- a/conftest.sh
+++ b/conftest.sh
@@ -106,6 +106,7 @@
FILES="$FILES drm/drm_atomic_uapi.h"
FILES="$FILES drm/drm_drv.h"
FILES="$FILES drm/drm_framebuffer.h"
+ FILES="$FILES drm/drm_probe_helper.h"
FILES="$FILES generated/autoconf.h"
FILES="$FILES generated/compile.h"
FILES="$FILES generated/utsrelease.h"
@@ -407,6 +408,22 @@
compile_check_conftest "$CODE" "NV_SET_MEMORY_ARRAY_UC_PRESENT" "" "functions"
;;
+ list_is_first)
+ #
+ # Determine if the list_is_first() function is present.
+ #
+ # Added by commit 0d29c2d43753 ("mm, compaction: Use free lists to quickly
+ # locate a migration source -fix") in linux-next tree
+ #
+ CODE="
+ #include <linux/list.h>
+ void conftest_list_is_first(void) {
+ list_is_first();
+ }"
+
+ compile_check_conftest "$CODE" "NV_LIST_IS_FIRST_PRESENT" "" "functions"
+ ;;
+
set_pages_uc)
#
# Determine if the set_pages_uc() function is present.
--- a/nvidia/nvidia.Kbuild
+++ b/nvidia/nvidia.Kbuild
@@ -102,6 +102,7 @@
NV_CONFTEST_FUNCTION_COMPILE_TESTS += follow_pfn
NV_CONFTEST_FUNCTION_COMPILE_TESTS += vmap
NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_pages_uc
+NV_CONFTEST_FUNCTION_COMPILE_TESTS += list_is_first
NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_memory_uc
NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_memory_array_uc
NV_CONFTEST_FUNCTION_COMPILE_TESTS += change_page_attr
--- a/nvidia-drm/nvidia-drm-connector.c
+++ b/nvidia-drm/nvidia-drm-connector.c
@@ -30,6 +30,14 @@
#include "nvidia-drm-utils.h"
#include "nvidia-drm-encoder.h"
+/*
+ * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
+ * moves a number of helper function definitions from
+ * drm/drm_crtc_helper.h to a new drm_probe_helper.h.
+ */
+#if defined(NV_DRM_DRM_PROBE_HELPER_H_PRESENT)
+#include <drm/drm_probe_helper.h>
+#endif
#include <drm/drm_crtc_helper.h>
#include <drm/drm_atomic.h>
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/nvidia-drm/nvidia-drm-drv.c
@@ -41,6 +41,14 @@
#include <drm/drmP.h>
+/*
+ * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
+ * moves a number of helper function definitions from
+ * drm/drm_crtc_helper.h to a new drm_probe_helper.h.
+ */
+#if defined(NV_DRM_DRM_PROBE_HELPER_H_PRESENT)
+#include <drm/drm_probe_helper.h>
+#endif
#include <drm/drm_crtc_helper.h>
#if defined(NV_DRM_DRM_GEM_H_PRESENT)
--- a/nvidia-drm/nvidia-drm-encoder.c
+++ b/nvidia-drm/nvidia-drm-encoder.c
@@ -31,6 +31,14 @@
#include "nvidia-drm-crtc.h"
#include "nvidia-drm-helper.h"
+/*
+ * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
+ * moves a number of helper function definitions from
+ * drm/drm_crtc_helper.h to a new drm_probe_helper.h.
+ */
+#if defined(NV_DRM_DRM_PROBE_HELPER_H_PRESENT)
+#include <drm/drm_probe_helper.h>
+#endif
#include <drm/drm_crtc_helper.h>
#include <drm/drm_atomic.h>
--- a/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
+++ b/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
@@ -24,6 +24,7 @@
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+#include "nv-linux.h"
#include "nvidia-drm-gem-nvkms-memory.h"
#include "nvidia-drm-ioctl.h"
@@ -222,7 +223,7 @@
/* XXX Move these vma operations to os layer */
-static int __nv_drm_vma_fault(struct vm_area_struct *vma,
+static vm_fault_t __nv_drm_vma_fault(struct vm_area_struct *vma,
struct vm_fault *vmf)
{
unsigned long address = nv_page_fault_va(vmf);
@@ -230,7 +231,7 @@
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;
@@ -238,8 +239,7 @@
page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
#if defined(NV_VMF_INSERT_PFN_PRESENT)
- (void)ret;
- return vmf_insert_pfn(vma, address, pfn + page_offset);
+ ret = vmf_insert_pfn(vma, address, pfn + page_offset);
#else
ret = vm_insert_pfn(vma, address, pfn + page_offset);
@@ -250,16 +250,18 @@
* EBUSY indicates that another thread already handled
* the faulted range.
*/
- return VM_FAULT_NOPAGE;
+ ret = VM_FAULT_NOPAGE;
+ break;
case -ENOMEM:
- return VM_FAULT_OOM;
+ ret = VM_FAULT_OOM;
+ break;
default:
WARN_ONCE(1, "Unhandled error in %s: %d\n", __FUNCTION__, ret);
+ ret = VM_FAULT_SIGBUS;
break;
}
-
- return VM_FAULT_SIGBUS;
#endif
+ return ret;
}
/*
@@ -268,12 +270,12 @@
*/
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
-static int nv_drm_vma_fault(struct vm_fault *vmf)
+static vm_fault_t nv_drm_vma_fault(struct vm_fault *vmf)
{
return __nv_drm_vma_fault(vmf->vma, vmf);
}
#else
-static int nv_drm_vma_fault(struct vm_area_struct *vma,
+static vm_fault_t nv_drm_vma_fault(struct vm_area_struct *vma,
struct vm_fault *vmf)
{
return __nv_drm_vma_fault(vma, vmf);
--- a/nvidia-uvm/uvm8.c
+++ b/nvidia-uvm/uvm8.c
@@ -166,13 +166,13 @@
// If a fault handler is not set, paths like handle_pte_fault in older kernels
// assume the memory is anonymous. That would make debugging this failure harder
// so we force it to fail instead.
-static int uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
{
UVM_DBG_PRINT_RL("Fault to address 0x%lx in disabled vma\n", nv_page_fault_va(vmf));
return VM_FAULT_SIGBUS;
}
-static int uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
{
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
return uvm_vm_fault_sigbus(vmf->vma, vmf);
@@ -390,7 +390,7 @@
uvm_record_unlock_mmap_sem_write(¤t->mm->mmap_sem);
}
-static int uvm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
uvm_va_space_t *va_space = uvm_va_space_get(vma->vm_file);
uvm_va_block_t *va_block;
@@ -507,7 +507,7 @@
}
}
-static int uvm_vm_fault_wrapper(struct vm_fault *vmf)
+static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
{
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
return uvm_vm_fault(vmf->vma, vmf);
More information about the pkg-nvidia-devel
mailing list