Bug 181118 - [patch] x11/nvidia-driver
Summary: [patch] x11/nvidia-driver
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-07 18:30 UTC by Nikolai Lifanov
Modified: 2013-08-08 05:45 UTC (History)
0 users

See Also:


Attachments
patch.txt (634 bytes, text/plain)
2013-08-07 18:30 UTC, Nikolai Lifanov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Lifanov 2013-08-07 18:30:00 UTC
	FreeBSD base revision r254025:
	  Replace kernel virtual address space allocation with vmem.

	This specifically broke kmem_free and kmem_alloc_contig functions, which are used in nvidia-driver port.

	This patch fixes the problem. However, OSVERSION > 1000040 is a bit imprecise, since r254025 doesn't come with a param.h bump.

Fix: Apply this patch.
How-To-Repeat: 	Update to CURRENT above r254025
	make -C /usr/ports/x11/nvidia-driver
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-08-07 18:30:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danfe

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-08-08 05:39:08 UTC
Author: danfe
Date: Thu Aug  8 04:39:00 2013
New Revision: 324376
URL: http://svnweb.freebsd.org/changeset/ports/324376

Log:
  - Unbreak the build on recent -CURRENT after r254025 [1]
  - Respect custom SRC_BASE (e.g. when set in /etc/make.conf) [2]
  - Few non-functional changes (mostly comments; particularly, restore hint
    about MASTER_SITE_SUBDIR, bogusly changed by yours truly in r315754)
  
  PR:	ports/181118 [1]
  	ports/176733 [2]

Modified:
  head/x11/nvidia-driver/Makefile

Modified: head/x11/nvidia-driver/Makefile
==============================================================================
--- head/x11/nvidia-driver/Makefile	Wed Aug  7 23:43:22 2013	(r324375)
+++ head/x11/nvidia-driver/Makefile	Thu Aug  8 04:39:00 2013	(r324376)
@@ -16,7 +16,7 @@ DISTVERSION?=	319.32
 PORTREVISION?=	0
 CATEGORIES=	x11 kld
 MASTER_SITES=	${MASTER_SITE_NVIDIA}
-# MASTER_SITE_SUBDIR it set later because it depends on NVVERSION
+# MASTER_SITE_SUBDIR has to be set later because it depends on NVVERSION
 DISTNAME=	NVIDIA-FreeBSD-x86${ARCH_SUFX}-${DISTVERSION}
 
 MAINTAINER=	danfe@FreeBSD.org
@@ -38,7 +38,8 @@ USE_LDCONFIG=	yes
 # fixed upstream (across all versions, including legacy ones), use this
 # hack below to universally set NVIDIA_ROOT.  Also provide X11BASE value
 # since it is going away from `Mk/bsd.port.mk' as deprecated.
-MAKE_ENV=	NVIDIA_ROOT=${WRKSRC} X11BASE=${LOCALBASE}
+MAKE_ENV=	NVIDIA_ROOT=${WRKSRC} X11BASE=${LOCALBASE} \
+		SYSDIR=${SRC_BASE}/sys
 SUB_FILES=	pkg-deinstall pkg-install pkg-message
 DOCSDIR=	${PREFIX}/share/doc/NVIDIA_GLX-1.0
 MODULESDIR=	lib/xorg/modules
@@ -64,9 +65,9 @@ EXTRA_PATCHES=	${FILESDIR}/legacy-patch-
 
 # Fix recent arbitrary memory access vulnerability in legacy drivers
 .if ${NVVERSION} <= 1905300
-. if ${NVVERSION} != 1731435
+.  if ${NVVERSION} != 1731435
 EXTRA_PATCHES+=	${FILESDIR}/security-patch-CVE-2012-0946
-. endif
+.  endif
 EXTRA_PATCHES+=	${FILESDIR}/security-patch-CVE-2012-4225
 .endif
 
@@ -106,7 +107,7 @@ IGNORE=		requires fairly recent FreeBSD-
 .endif
 
 .if ${NVVERSION} < 1952200
-# ABI version is hardcoded inside the binary, so better be explicit here
+# ABI version is hardcoded inside the binary, so specify it explicitly
 LIB_DEPENDS=	libm.so.3:${PORTSDIR}/misc/compat5x
 .endif
 
@@ -155,6 +156,11 @@ post-patch: .SILENT
 		/return SYSCTL_OUT\(req, bus_type/d' \
 			${WRKSRC}/src/nvidia_sysctl.c
 .endif
+# Catch up with KVA space allocation API changes in recent -CURRENT
+.if ${OSVERSION} > 1000040
+	${REINPLACE_CMD} -e 's/kmem_free(kernel_map,/kva_free(/ ; \
+		/kmem_alloc_contig/s/map/arena/' ${WRKSRC}/src/nvidia_subr.c
+.endif
 # Process OPTIONS
 .if ${PORT_OPTIONS:MFREEBSD_AGP}
 	${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2013-08-08 05:44:35 UTC
State Changed
From-To: open->closed

Committed with minor modifications, thanks!