Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 10-12-12, 07:45 PM   #1
valdis
Registered User
 
Join Date: Apr 2003
Posts: 48
Default Heads up - linux 3.7-rc* header file reorg

A set of patches just landed in Linus's tree for 3.7 that reorg the include and arch/*/include directory trees. So conftest.sh ends up needing a few more -I parameters sprinkled on it to build.

The attached patch (a) works for me and (b) should be safe to apply for pre-3.7 kernels.
Attached Files
File Type: txt uapi-patch.txt (1.1 KB, 522 views)
valdis is offline   Reply With Quote
Old 10-13-12, 07:03 PM   #2
siddly
Registered User
 
Join Date: Jul 2003
Location: West Midlands, UK
Posts: 125
Default Re: Heads up - linux 3.7-rc* header file reorg

cc -Wp,-MD,/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/.nv-mmap.o.d -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.7/include -I/usr/src/XXX/linux-3.6.0/arch/x86/include -Iarch/x86/include/generated -I/usr/src/XXX/linux-3.6.0/include -Iinclude -I/usr/src/XXX/linux-3.6.0/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/XXX/linux-3.6.0/include/uapi -Iinclude/generated/uapi -include /usr/src/XXX/linux-3.6.0/include/linux/kconfig.h -I/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -march=k8 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -femit-struct-debug-baseonly -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -I/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"304.51\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv_mmap)" -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.o /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c
In file included from /usr/src/XXX/linux-3.6.0/include/linux/kernel.h:10:0,
from /usr/src/XXX/linux-3.6.0/include/linux/sched.h:15,
from /usr/src/XXX/linux-3.6.0/include/linux/utsname.h:5,
from /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-linux.h:38,
from /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c:15:
/usr/src/XXX/linux-3.6.0/include/linux/bitops.h: In function ‘hweight_long’:
/usr/src/XXX/linux-3.6.0/include/linux/bitops.h:66:41: warning: signed and unsigned type in conditional expression [-Wsign-compare]
In file included from /usr/src/XXX/linux-3.6.0/arch/x86/include/asm/uaccess.h:594:0,
from /usr/src/XXX/linux-3.6.0/include/linux/poll.h:11,
from /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-linux.h:97,
from /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c:15:
/usr/src/XXX/linux-3.6.0/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’:
/usr/src/XXX/linux-3.6.0/arch/x86/include/asm/uaccess_64.h:62:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c: In function ‘nv_kern_mmap’:
/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c:466:47: error: ‘VM_RESERVED’ undeclared (first use in this function)
/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.c:466:47: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nv-mmap.o] Error 1
make[3]: *** [_module_/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel] Error 2
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [install] Error 2

sabre:/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel # grep -r VM_RESERVED /usr/src/XXX/linux-3.6.0/include/*
sabre:/usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel #
This is from the latest git.

Removed VM_RESERVED from nv-mmap.c and it builds OK.

In file included from /usr/src/XXX/linux-3.6.0/include/linux/kernel.h:10:0,
from /usr/src/XXX/linux-3.6.0/include/linux/cache.h:4,
from /usr/src/XXX/linux-3.6.0/include/linux/time.h:4,
from /usr/src/XXX/linux-3.6.0/include/linux/stat.h:18,
from /usr/src/XXX/linux-3.6.0/include/linux/module.h:10,
from /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nvidia.mod.c:1:
/usr/src/XXX/linux-3.6.0/include/linux/bitops.h: In function ‘hweight_long’:
/usr/src/XXX/linux-3.6.0/include/linux/bitops.h:66:41: warning: signed and unsigned type in conditional expression [-Wsign-compare]
ld -r -m elf_x86_64 -T /usr/src/XXX/linux-3.6.0/scripts/module-common.lds --build-id -o /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nvidia.ko /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nvidia.o /usr/src/YYY/NVIDIA-Linux-x86_64-304.51/kernel/nvidia.mod.o
NVIDIA: left KBUILD.
WARNING: -e needs -E or -F
nvidia.ko installed successfully.
siddly is offline   Reply With Quote
Old 10-15-12, 06:43 PM   #3
rockob
Registered User
 
Join Date: Nov 2008
Posts: 95
Default Re: Heads up - linux 3.7-rc* header file reorg

Thanks valdis and siddly, the combination of those two patches makes it build and work fine on my system.
rockob is offline   Reply With Quote
Old 10-18-12, 10:49 PM   #4
valdis
Registered User
 
Join Date: Apr 2003
Posts: 48
Default Re: Heads up - linux 3.7-rc* header file reorg

A better patch than just removing VM_RESERVED would probably be this:

--- nv-mmap.c.dist 2012-08-08 22:52:53.000000000 -0400
+++ nv-mmap.c 2012-08-14 23:52:41.257235863 -0400
@@ -450,7 +450,7 @@
NV_PRINT_AT(NV_DBG_MEMINFO, at);
nv_vm_list_page_count(&at->page_table[i], pages);

- vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED);
+ vma->vm_flags |= (VM_IO | VM_LOCKED | (VM_DONTEXPAND | VM_DONTDUMP));

as the combination of those two flags has the same meaning as VM_RESERVED used to have before its demise. Simply removing VM_RESERVED means the vma *won't* be flagged as "DONTDUMP" or "DONTEXPAND" - both of which could result in hilarity ensuing.

(I forgot to post this part, because this change has been in the linux-next tree for a while already - the uapi stuff just landed in the last few days)
valdis is offline   Reply With Quote
Old 10-19-12, 06:05 AM   #5
siddly
Registered User
 
Join Date: Jul 2003
Location: West Midlands, UK
Posts: 125
Default Re: Heads up - linux 3.7-rc* header file reorg

Another issue that has cropped up with the latest 3.7-rc1 git updates, as far as I can tell from a brief look, nvidia-installer is looking for include/linux/version.h.

The module will build from the NVIDIA-Linux-x86_64-310.14/kernel directory with "make install".

"ln -s /usr/src/linux-3.7.0-rc1/include/generated/uapi/linux/version.h /usr/src/linux-3.7.0-rc1/include/linux/" is the quick workaround I have used to allow "./nvidia-installer" to work.
siddly is offline   Reply With Quote
Old 10-31-12, 09:34 AM   #6
Milos_SD
Registered User
 
Join Date: Jan 2009
Posts: 19
Default Re: Heads up - linux 3.7-rc* header file reorg

I hope NVIDIA will publish a driver that supports 3.7 kernel in new 304.xx legacy branch. This solution for VM_RESERVED is not good I think, there is major memory leak going on. 5.5-6GB memory usage after a day of use. I even close all my programs, but still there is a 5GB memory usage. I can't play Heroes of Newerth with that, because it starts to swap a lot.
Milos_SD is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:09 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.