Bugzilla – Bug 139359
Checking for remap_pfn_range() no longer works
Last modified: 2006-01-17 11:59:05 UTC
Date: Thu, 15 Dec 2005 16:02:23 +0100 From: Stefan Dirsch <sndirsch@suse.de> To: research@suse.de Subject: Re: [Research] remap_page_range no longer available? On Thu, Dec 15, 2005 at 03:26:07PM +0100, Stefan Dirsch wrote: > On Thu, Dec 15, 2005 at 01:02:04PM +0100, Stefan Dirsch wrote: > > Hi > > > > Looks like the nvidia kernel module cannot be compiled any longer for > > BETA (i386/x86_64) distribution. > > > > /usr/src/packages/BUILD/obj/bigsmp/1.0-8174/nv.c: In function 'nv_kern_mmap': > > /usr/src/packages/BUILD/obj/bigsmp/1.0-8174/nv.c:1980: error: implicit declaration of function 'remap_page_range' > > > > This does *not* happen for STABLE (i386/x86_64). I wonder what's the > > difference between STABLE and BETA here. > > > > # sndirsch@shannon:/work/SRC/BETA/all> ls > > flex gcc glibc ipsec-tools xgl > > > > Using STABLE glibc-devel package within a BETA build did *not* help. > > > > Any ideas what's wrong here (besides that NVIDIA is evil)? > > Forget about remap_page_range. The check for remap_pfn_range, which > should be prefered (I think remap_page_range is no longer used since a > longer time), fails in BETA. > > + gcc -D__KERNEL__ -nostdinc -isystem /usr/lib/gcc/i586-suse-linux/4.1.0/include -Werror -Wimplicit-function-declaration -I/usr/src/linux/include +-I/usr/src/linux/include/asm/mach-default -c conftest13540.c > cc1: warnings being treated as errors > In file included from /usr/src/linux/include/asm/mpspec.h:5, > from /usr/src/linux/include/asm/smp.h:18, > from /usr/src/linux/include/linux/irq.h:13, > from /usr/src/linux/include/asm/hardirq.h:6, > from /usr/src/linux/include/linux/hardirq.h:7, > from /usr/src/linux/include/linux/interrupt.h:11, > from /usr/src/linux/include/linux/rcuref.h:36, > from /usr/src/linux/include/linux/fs.h:12, > from /usr/src/linux/include/linux/mm.h:15, > from conftest13540.c:1: > /usr/src/linux/include/asm/mpspec_def.h:78: warning: 'packed' attribute ignored for field of type 'unsigned char[5u]' > > Whereas it still works in STABLE: > > + gcc -D__KERNEL__ -nostdinc -isystem /usr/lib/gcc/i586-suse-linux/4.1.0/include -Werror -Wimplicit-function-declaration -I/usr/src/linux/include +-I/usr/src/linux/include/asm/mach-default -c conftest13361.c > > Looks like gcc in BETA is more strict now. Of course I could simply remove the "-Werror" for us and maybe convince NVIDIA to do the same for the next release. But I think it would be better to fix this warning in the kernel sources or adjust gcc to no longer complain about this. What do you think? Best regards, Stefan
/usr/src/linux/include/asm/mpspec_def.h: [...] 74 struct mpc_config_bus 75 { 76 unsigned char mpc_type; 77 unsigned char mpc_busid; 78 unsigned char mpc_bustype[6] __attribute((packed)); 79 }; Richard, what do you think?
It's unfortunate ;) The attribute is ignored, because it doesn't make any difference if it is there or not. But the warning is stupid in this case. I'll report/fix upstream.
Date: Thu, 15 Dec 2005 16:15:07 +0100 From: Takashi Iwai <tiwai@suse.de> To: research@suse.de Subject: Re: [Research] remap_page_range no longer available? > Of course I could simply remove the "-Werror" for us and maybe > convince NVIDIA to do the same for the next release. But I think it > would be better to fix this warning in the kernel sources or adjust > gcc to no longer complain about this. What do you think? Sure, better to fix the compile warnings. The __attribute((packed)) there looks superfluous to me. Takashi
Ok. Then it makes sense to assign this to you, Richard. Thanks for the quick reply!
Rudi added a workaround to nvidia-gfx package for now. NVIDIA_kernel-1.0-8174-1438624.diff.txt: diff -ru usr/src/nv/conftest.sh usr/src/nv.1438624/conftest.sh --- usr/src/nv/conftest.sh 2005-11-23 03:22:31.000000000 +0100 +++ usr/src/nv.1438624/conftest.sh 2005-12-20 15:43:27.287128500 +0100 @@ -25,6 +25,13 @@ -nostdinc -isystem $ISYSTEM \ -Werror -Wimplicit-function-declaration" +touch conftest$$.c +$CC -Wno-attributes -c conftest$$.c > /dev/null 2>&1 +if [ $? -eq 0 ]; then + CFLAGS="$CFLAGS -Wno-attributes" +fi +rm -f conftest$$.* + if [ "$OUTPUT" != "$SOURCES" ]; then CFLAGS="$CFLAGS -I$OUTPUT/include2 -I$OUTPUT/include \ -I$HEADERS -I$HEADERS/asm/mach-default" Rudi, where does the patch come from? I couldn't find it on http://www.nvnews.net/vbulletin/showthread.php?t=61052.
Rudi, see my previous comment.
it's from http://www.nvnews.net/vbulletin/showthread.php?t=61874
the bad part about it is, that it helps for remap_page_range, but the build fails shortly afterwards: LD [M] /usr/src/packages/BUILD/obj/default/1.0-8174/nvidia.o Building modules, stage 2. MODPOST Warning: could not find /usr/src/packages/BUILD/obj/default/1.0-8174/.nv-kernel.o.cmd for /usr/src/packages/BUILD/obj/default/1.0-8174/nv-kernel.o /bin/sh: line 1: 20809 Segmentation fault scripts/mod/modpost -m -a -i /usr/src/linux-2.6.15-rc6-2-obj/x86_64/default/Module.symvers -s /dev/null /usr/ src/packages/BUILD/obj/default/1.0-8174/nvidia.o make[3]: *** [__modpost] Error 139 (same segfault on x86 and x86_64).
modpost broken? I see a similar failure (new!) for the ati-fglrx package ...
It looks like a bug in modpost. The patch below seems to work.
Created attachment 61609 [details] Patch for segfault of modpost
Takashi submitted the modpost patch to our kernel CVS. It's included by SuSE's kernel-of-the-day.
Not a "bug" in gcc according to upstream, more like a kernel issue. Not working on it, so re-assigning.
As per comment #12, I'm assuming this is solved then. Takashi, please make sure the fix goes upstream too!
No, comments #8-12 discuss a different bug.
Well, then, comment #5 still seems to indicate this is fixed?
No, the patch of comment #5 has not been integrated in the released proprietary nvidia driver.
The attribute has been removed upstream and thus in our latest kernels. Just ignoring bugs for long enough makes them magically better! Whee. ;-)