Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2013 11:46:39 -0500
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        AN <andy@neu.net>
Cc:        danfe@freebsd.org, freebsd-ports@freebsd.org
Subject:   Re: nvidia-driver broken by recent commit - 248084
Message-ID:  <CALBk6yLQbEpk7-Pn1Y-dFzZMWKACG=HC6jO8WfitJSaD815NiQ@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1303100310020.16118@mail.neu.net>
References:  <mailman.43243.1362306756.2166.freebsd-ports@freebsd.org> <alpine.BSF.2.00.1303100310020.16118@mail.neu.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 10, 2013 at 1:17 AM, AN <andy@neu.net> wrote:
>
> FreeBSD FBSD10 10.0-CURRENT FreeBSD 10.0-CURRENT #36 r248127: Sun Mar 10 =
00:13:59 CST 2013     root@FBSD10:/usr/obj/usr/src/sys/MYKERNEL  amd64
>
> /usr/ports/x11/nvidia-driver is broken, probably by this commit:
> http://svnweb.freebsd.org/base?view=3Drevision&revision=3D248084
>
> From commit log:"The KPI results heavilly broken by this commit.  Thirdy =
part ports must be updated accordingly (I can think off-hand of VirtualBox,=
 for example)."
>
>
>
> root@FBSD10 /usr/ports/x11/nvidia-driver]# make clean
> =3D=3D=3D>  Cleaning for nvidia-driver-310.32
> [root@FBSD10 /usr/ports/x11/nvidia-driver]# make install clean
> =3D=3D=3D>  License NVIDIA accepted by the user
> =3D=3D=3D>  Found saved configuration for nvidia-driver-304.64
> =3D=3D=3D>   nvidia-driver-310.32 depends on file: /usr/local/sbin/pkg - =
found
> =3D=3D=3D>  Extracting for nvidia-driver-310.32
> =3D> SHA256 Checksum OK for NVIDIA-FreeBSD-x86_64-310.32.tar.gz.
> =3D=3D=3D>  Patching for nvidia-driver-310.32
> =3D=3D=3D>  Applying extra patch /usr/ports/x11/nvidia-driver/files/r2460=
85-patch-src-nvidia_linux.c
> =3D=3D=3D>   nvidia-driver-310.32 depends on file: /usr/local/libdata/pkg=
config/xorg-server.pc - found
> =3D=3D=3D>   nvidia-driver-310.32 depends on shared library: GL.1 - found
> =3D=3D=3D>  Configuring for nvidia-driver-310.32
> =3D=3D=3D>  Building for nvidia-driver-310.32
> =3D=3D=3D> src (all)
> @ -> /usr/src/sys
> machine -> /usr/src/sys/amd64/include
> x86 -> /usr/src/sys/x86/include
> awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
> awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
> awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
> awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -p
> awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -q
> awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
> cc -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=3D\"310.32\" -D__KE=
RNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O -mno-red-zone -mcmode=
l=3Dkernel -UDEBUG -U_DEBUG -DNDEBUG -Werror -D_KERNEL -DKLD_MODULE -nostdi=
nc  -I. -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer  -mno-=
aes -mno-avx -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float=
  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=3Di=
so9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -W=
nested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -W=
inline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing=
-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wn=
o-error-empty-body -Wno-error-parentheses-equality -c nvidia_ctl.c
> In file included from nvidia_ctl.c:14:
> In file included from ./nv-freebsd.h:77:
> @/vm/vm_pager.h:127:2: error: implicit declaration of function 'rw_assert=
' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         VM_OBJECT_ASSERT_WLOCKED(object);
>         ^
> @/vm/vm_object.h:212:2: note: expanded from macro 'VM_OBJECT_ASSERT_WLOCK=
ED'
>         rw_assert(&(object)->lock, RA_WLOCKED)
>         ^
> In file included from nvidia_ctl.c:14:
> In file included from ./nv-freebsd.h:77:
> @/vm/vm_pager.h:127:2: error: use of undeclared identifier 'RA_WLOCKED'
>         VM_OBJECT_ASSERT_WLOCKED(object);
>         ^
> @/vm/vm_object.h:212:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOC=
KED'
>         rw_assert(&(object)->lock, RA_WLOCKED)
>                                    ^
> In file included from nvidia_ctl.c:14:
> In file included from ./nv-freebsd.h:77:
> @/vm/vm_pager.h:144:2: error: use of undeclared identifier 'RA_WLOCKED'
>         VM_OBJECT_ASSERT_WLOCKED(object);
>         ^
> @/vm/vm_object.h:212:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOC=
KED'
>         rw_assert(&(object)->lock, RA_WLOCKED)
>                                    ^
> In file included from nvidia_ctl.c:14:
> In file included from ./nv-freebsd.h:77:
> @/vm/vm_pager.h:168:2: error: use of undeclared identifier 'RA_WLOCKED'
>         VM_OBJECT_ASSERT_WLOCKED(object);
>         ^
> @/vm/vm_object.h:212:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOC=
KED'
>         rw_assert(&(object)->lock, RA_WLOCKED)
>                                    ^
> In file included from nvidia_ctl.c:14:
> In file included from ./nv-freebsd.h:77:
> @/vm/vm_pager.h:191:2: error: use of undeclared identifier 'RA_WLOCKED'
>         VM_OBJECT_ASSERT_WLOCKED(m->object);
>         ^
> @/vm/vm_object.h:212:29: note: expanded from macro 'VM_OBJECT_ASSERT_WLOC=
KED'
>         rw_assert(&(object)->lock, RA_WLOCKED)
>                                    ^
> 5 errors generated.
> *** [nvidia_ctl.o] Error code 1
>
> Stop in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-310.32/sr=
c.
> *** [all] Error code 1
>
> Stop in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-310.32.
> *** [do-build] Error code 1
>
> Stop in /usr/ports/x11/nvidia-driver.
> *** [install] Error code 1
>
> Stop in /usr/ports/x11/nvidia-driver.
> [root@FBSD10 /usr/ports/x11/nvidia-driver]#


Place the following diff in a file at
/usr/ports/x11/nvidia-driver/files/patch-r248084-vm-locking-changes.diff
(assuming your ports tree is at /usr/ports; adjust accordingly):

--- src/nv-freebsd.h	2013-03-10 11:29:12.000000000 -0500
+++ src/nv-freebsd.h	2013-03-10 11:23:12.000000000 -0500
@@ -59,6 +59,7 @@
 #include <sys/mman.h>
 #include <sys/file.h>
 #include <sys/poll.h>
+#include <sys/rwlock.h>

 #include <sys/syscall.h>
 #include <sys/bus.h>
--- src/nvidia_subr.c	2013-03-10 11:22:19.000000000 -0500
+++ src/nvidia_subr.c	2013-03-10 11:24:27.000000000 -0500
@@ -83,7 +83,7 @@
             if (!sc->BAR_objects[i])
                 goto failed;

-            VM_OBJECT_LOCK(sc->BAR_objects[i]);
+            VM_OBJECT_WLOCK(sc->BAR_objects[i]);
             switch (i) {
                 case NV_GPU_BAR_INDEX_FB:
                     vm_object_set_memattr(sc->BAR_objects[i],
@@ -95,7 +95,7 @@
                             VM_MEMATTR_UNCACHEABLE);
                     break;
             }
-            VM_OBJECT_UNLOCK(sc->BAR_objects[i]);
+            VM_OBJECT_WUNLOCK(sc->BAR_objects[i]);
         }
     }

@@ -541,9 +541,9 @@
                 goto failed;
             }

-            VM_OBJECT_LOCK(sc->UD_object);
+            VM_OBJECT_WLOCK(sc->UD_object);
             vm_object_set_memattr(sc->UD_object, VM_MEMATTR_UNCACHEABLE);
-            VM_OBJECT_UNLOCK(sc->UD_object);
+            VM_OBJECT_WUNLOCK(sc->UD_object);
         }

         nv->flags |=3D NV_FLAG_OPEN;
@@ -965,9 +965,9 @@
         goto failed;
     }

-    VM_OBJECT_LOCK(at->object);
+    VM_OBJECT_WLOCK(at->object);
     vm_object_set_memattr(at->object, attr);
-    VM_OBJECT_UNLOCK(at->object);
+    VM_OBJECT_WUNLOCK(at->object);

     *private =3D at;
     SLIST_INSERT_HEAD(&sc->alloc_list, at, list);
@@ -1108,9 +1108,9 @@
         goto failed;
     }

-    VM_OBJECT_LOCK(at->object);
+    VM_OBJECT_WLOCK(at->object);
     vm_object_set_memattr(at->object, attr);
-    VM_OBJECT_UNLOCK(at->object);
+    VM_OBJECT_WUNLOCK(at->object);

     *private =3D at;
     SLIST_INSERT_HEAD(&sc->alloc_list, at, list);





-Brandon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALBk6yLQbEpk7-Pn1Y-dFzZMWKACG=HC6jO8WfitJSaD815NiQ>