Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nvidia Kernel 1.0.6111 Fix for mm-sources thread
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
chickaroo
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2004
Posts: 102
Location: #!/usr/bin/girl

PostPosted: Wed Sep 22, 2004 1:55 am    Post subject: Reply with quote

i released a patch for this with an ebuild over here

[edit] hmm... i shoud have read the rest of this thread i guess. DaMouse seems to have put that in his latest source. doesn't seem to fix it though, it's just a work around. i see his patch has this:
Code:

+#ifndef __VMALLOC_RESERVE
+unsigned int __VMALLOC_RESERVE;
+#endif


when actually it needs:
Code:
+unsigned int __VMALLOC_RESERVE = 128 << 20;

_________________
Registered Linux user #364515 (Jun, 2004)


Last edited by chickaroo on Fri Oct 01, 2004 10:34 am; edited 2 times in total
Back to top
View user's profile Send private message
DaMouse
Apprentice
Apprentice


Joined: 18 Jul 2003
Posts: 233

PostPosted: Wed Sep 22, 2004 6:20 am    Post subject: Reply with quote

I'm not sure editing vmalloc everytime we load the module is such a good idea.. its normally a static value.. but perhaps it could work since the symbol wasn't loaded properly before..

-DaMouse
_________________
I am the dark lord DaMouse I eat souls and wear the dressing gown of evil.
Back to top
View user's profile Send private message
AstralStorm
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 80
Location: /dev/null

PostPosted: Thu Sep 23, 2004 10:22 pm    Post subject: Reply with quote

I've already added that variable, anyway, that was quite easy.
Been using hand-modded nvidia-kernel ebuild anyway,
1st patch from DaMouse, 2nd my own, identical to DaMouse's.
Fixing it now to initialise the value properly.

Right now trying 2.6.9-rc2-mm3-pre (from Ingo, w/o ZAPHOD) + voluntary-preemption-2.6.9-rc2-mm3-S5 + Con's patches.
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Sep 28, 2004 9:49 am    Post subject: Reply with quote

anyone found out how to patch nvidia-kernel for mm4 with that remap_page_range() -> remap_pfn_range() switch?

one example fix from lkml:
Code:

-      } else if (remap_page_range(vma, vma->vm_start,
-                   (kerninfo.aper_base + offset),
+      } else if (remap_pfn_range(vma, vma->vm_start,
+            (kerninfo.aper_base + offset) >> PAGE_SHIFT,
                    size, vma->vm_page_prot)) {


don't find the correct place to fix :(

conftest.sh << there you can play a little but starting X i just got a blank screen... (well that time i forgot to add '>> PAGE_SHIFT')

i just have to reboot.. which i do not want...

my patch (do not ask me what i did :()
Code:

--- usr/src/nv/nv-linux.h       2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/nv-linux.h       2004-09-28 10:31:25.994607728 +0200
@@ -563,17 +563,17 @@
 #endif
 
 /*
- * Linux 2.5 introduced the five argument version of remap_page_range, all
+ * Linux 2.5 introduced the five argument version of remap_pfn_range, all
  * relevant releases to date use it. This version was backported to 2.4
  * without means to identify the change, hence this hack.
  */
 #if defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(vma, x)
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(vma, x)
 #elif defined(REMAP_PAGE_RANGE_4)
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(x)
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(x)
 #else
-#warning "conftest.sh failed, assuming old Linux 2.4 remap_page_range(4)!"
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(x)
+#warning "conftest.sh failed, assuming old Linux 2.4 remap_pfn_range(4)!"
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(x)
 #endif
 
 #if defined(pmd_offset_map)
--- usr/src/nv/conftest.sh      2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/conftest.sh      2004-09-28 10:33:48.176992720 +0200
@@ -31,7 +31,7 @@
         echo "#include <linux/mm.h>
         int do_test_remap_page_range(void) {
            pgprot_t pgprot;
-           remap_page_range(NULL, 0L, 0L, 0L, pgprot);
+           remap_pfn_range(NULL, 0L, 0L >> PAGE_SHIFT, 0L, pgprot);
         }" > conftest$$.c
 
         $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
@@ -46,7 +46,7 @@
         echo "#include <linux/mm.h>
         int do_test_remap_page_range(void) {
            pgprot_t pgprot;
-           remap_page_range(0L, 0L, 0L, pgprot);
+           remap_pfn_range(0L, 0L, 0L, pgprot);
         }" > conftest$$.c
 
         $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Sep 28, 2004 10:15 am    Post subject: Reply with quote

ok, new patch and im on mm4 running X with nvidia driver :D

my patch, someone cleans this up? ;)
Code:

--- usr/src/nv/nv-linux.h       2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/nv-linux.h       2004-09-28 10:31:25.994607728 +0200
@@ -563,17 +563,17 @@
 #endif
 
 /*
- * Linux 2.5 introduced the five argument version of remap_page_range, all
+ * Linux 2.5 introduced the five argument version of remap_pfn_range, all
  * relevant releases to date use it. This version was backported to 2.4
  * without means to identify the change, hence this hack.
  */
 #if defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(vma, x)
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(vma, x)
 #elif defined(REMAP_PAGE_RANGE_4)
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(x)
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(x)
 #else
-#warning "conftest.sh failed, assuming old Linux 2.4 remap_page_range(4)!"
-#define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(x)
+#warning "conftest.sh failed, assuming old Linux 2.4 remap_pfn_range(4)!"
+#define NV_REMAP_PAGE_RANGE(x...)    remap_pfn_range(x)
 #endif
 
 #if defined(pmd_offset_map)
--- usr/src/nv/conftest.sh      2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/conftest.sh      2004-09-28 10:33:48.176992720 +0200
@@ -31,7 +31,7 @@
         echo "#include <linux/mm.h>
         int do_test_remap_page_range(void) {
            pgprot_t pgprot;
-           remap_page_range(NULL, 0L, 0L, 0L, pgprot);
+           remap_pfn_range(NULL, 0L, 0L >> PAGE_SHIFT, 0L, pgprot);
         }" > conftest$$.c
 
         $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
@@ -46,7 +46,7 @@
         echo "#include <linux/mm.h>
         int do_test_remap_page_range(void) {
            pgprot_t pgprot;
-           remap_page_range(0L, 0L, 0L, pgprot);
+           remap_pfn_range(0L, 0L, 0L, pgprot);
         }" > conftest$$.c
 
         $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
--- usr/src/nv/nv.c     2004-09-28 11:48:22.849672352 +0200
+++ usr/src/nv/nv.c.new 2004-09-28 12:09:40.219482624 +0200
@@ -1768,7 +1768,7 @@
 
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
         if (NV_REMAP_PAGE_RANGE(vma->vm_start,
-                             NV_VMA_OFFSET(vma),
+                             NV_VMA_OFFSET(vma) >> PAGE_SHIFT,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
@@ -1787,7 +1787,7 @@
 
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
         if (NV_REMAP_PAGE_RANGE(vma->vm_start,
-                             NV_VMA_OFFSET(vma),
+                             NV_VMA_OFFSET(vma) >> PAGE_SHIFT,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
             return -EAGAIN;
@@ -1904,7 +1904,7 @@
         while (pages--)
         {
             page = (unsigned long) at->page_table[i++].phys_addr;
-            if (NV_REMAP_PAGE_RANGE(start, page, PAGE_SIZE, vma->vm_page_prot))
+            if (NV_REMAP_PAGE_RANGE(start, page >> PAGE_SHIFT, PAGE_SIZE, vma->vm_page_prot))
                 return -EAGAIN;
             start += PAGE_SIZE;
             pos += PAGE_SIZE;
--- usr/src/nv/os-agp.c 2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/os-agp.c.new     2004-09-28 12:12:54.743910416 +0200
@@ -331,10 +331,10 @@
     agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
 
 #if defined(NVCPU_IA64)
-    err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
+    err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr >> PAGE_SHIFT,
                        agp_data->num_pages << PAGE_SHIFT, vma->vm_page_prot);
 #else
-    err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr,
+    err = NV_REMAP_PAGE_RANGE(vma->vm_start, (size_t) agp_addr >> PAGE_SHIFT,
                        agp_data->num_pages << PAGE_SHIFT, PAGE_SHARED);
 #endif
         
--- usr/src/nv/os-interface.c   2004-07-27 17:33:20.000000000 +0200
+++ usr/src/nv/os-interface.c.new       2004-09-28 12:14:14.207830064 +0200
@@ -1088,7 +1088,7 @@
     vma = (struct vm_area_struct *) *priv;
 
     if (NV_REMAP_PAGE_RANGE(vma->vm_start,
-                start & PAGE_MASK, size_bytes, PAGE_SHARED))
+                start & PAGE_MASK >> PAGE_SHIFT, size_bytes, PAGE_SHARED))
         return NULL;
 
     return (void *)(NV_UINTPTR_T) vma->vm_start;

http://geki.ath.cx/remap_pfn_range.patch
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Sep 28, 2004 11:02 am    Post subject: Reply with quote

got a hardlock on disk I/O. either mm4 or nvidia driver needs improvement (better patch ;) )
Back to top
View user's profile Send private message
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Tue Sep 28, 2004 12:50 pm    Post subject: Reply with quote

using the latest mm4, nvidia still doesnt work. vmalloc error is fixed, however thers another new error, which I cant remember now.
_________________
There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Sep 28, 2004 1:07 pm    Post subject: Reply with quote

did u try with my patch? http://geki.ath.cx/nvidia-kernel-1.0.6111-r1.tar.bz2
Back to top
View user's profile Send private message
fallow
Bodhisattva
Bodhisattva


Joined: 08 Jan 2004
Posts: 2208
Location: Poland

PostPosted: Tue Sep 28, 2004 6:44 pm    Post subject: Reply with quote

geki wrote:
did u try with my patch? http://geki.ath.cx/nvidia-kernel-1.0.6111-r1.tar.bz2


I`ve tried...
reset after startx :( , black screen sometimes.... :
doesn`t work here.

also tried with and without this
Code:

--- l/include/linux/pm.h        2004-08-21 22:04:54.518914848 -0700
+++ linux-fixed/include/linux/pm.h      2004-08-21 22:05:12.440190400 -0700
@@ -36,6 +36,7 @@
 {
        PM_SUSPEND, /* enter D1-D3 */
        PM_RESUME,  /* enter D0 */
+       PM_SAVE_STATE,  /* save device's state */
 } pm_request_t;
 
 /*

greetings :)
_________________
"Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard ;)
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Tue Sep 28, 2004 6:51 pm    Post subject: Reply with quote

working for one on 5900xt, another one with same card does not... oO

and 5900 ultra (here) works, what gfx card u have?
Back to top
View user's profile Send private message
DaMouse
Apprentice
Apprentice


Joined: 18 Jul 2003
Posts: 233

PostPosted: Tue Sep 28, 2004 8:02 pm    Post subject: Reply with quote

I've been out of linux for a few days now but i'll be back in soon and work on getting my nvidia card running under mm4 :)

-DaMouse
_________________
I am the dark lord DaMouse I eat souls and wear the dressing gown of evil.
Back to top
View user's profile Send private message
Gentii
Guru
Guru


Joined: 01 Feb 2004
Posts: 306

PostPosted: Wed Sep 29, 2004 10:35 am    Post subject: Reply with quote

Well, happy to hear that I'm not alone. I'm getting exactly the same problem as fallow.
After startx, either reboot or black screen, so I've to reboot myself :p
Back to top
View user's profile Send private message
soliad
n00b
n00b


Joined: 09 May 2004
Posts: 42
Location: France

PostPosted: Wed Sep 29, 2004 6:41 pm    Post subject: Reply with quote

So I tried to make a patch for the remap_pfn_range and it seems to work.
There is the patch :

Code:
diff -u nv.old/conftest.sh nv/conftest.sh
--- nv.old/conftest.sh  2004-09-29 19:54:22.000000000 +0200
+++ nv/conftest.sh      2004-09-29 20:30:04.223302760 +0200
@@ -59,9 +59,10 @@
         else
           #
           # We couldn't determine the number of arguments expected by the
-          # remap_page_range function.
+          # remap_page_range function. Assuming new remap_pfn_range
           #
-          exit 1
+         echo "6"
+          exit 0
         fi
     ;;

diff -u nv.old/Makefile.kbuild nv/Makefile.kbuild
--- nv.old/Makefile.kbuild      2004-09-29 19:54:22.000000000 +0200
+++ nv/Makefile.kbuild  2004-09-29 20:30:43.544325056 +0200
@@ -171,6 +171,19 @@
   endif
 endif

+ifeq ($(PATCHLEVEL), 6)
+  REMAP_PAGE_RANGE := $(shell $(CONFTEST) remap_page_range)
+
+  ifeq ($(REMAP_PAGE_RANGE), 5)
+    EXTRA_CFLAGS += -DREMAP_PAGE_RANGE_5
+  endif
+
+  ifeq ($(REMAP_PAGE_RANGE), 6)
+    EXTRA_CFLAGS += -DREMAP_PAGE_RANGE_PFN
+  endif
+endif
+
+
 ifeq ($(PATCHLEVEL), 4)
   ifeq ($(shell $(CONFTEST) change_page_attr), 1)
     EXTRA_CFLAGS += -DNV_CHANGE_PAGE_ATTR_PRESENT
diff -u nv.old/nv-linux.h nv/nv-linux.h
--- nv.old/nv-linux.h   2004-09-29 19:54:22.000000000 +0200
+++ nv/nv-linux.h       2004-09-29 20:07:13.000000000 +0200
@@ -566,8 +566,11 @@
  * Linux 2.5 introduced the five argument version of remap_page_range, all
  * relevant releases to date use it. This version was backported to 2.4
  * without means to identify the change, hence this hack.
+ * Linux 2.6 also introduced a remap_page_range replacement remap_pfn_range.
  */
-#if defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
+#if defined(KERNEL_2_6) && defined(REMAP_PAGE_RANGE_PFN)
+#define NV_REMAP_PAGE_RANGE(x, y, z...)    remap_pfn_range(vma, x, y >> PAGE_SHIFT, z)
+#elif defined(KERNEL_2_6) || defined(REMAP_PAGE_RANGE_5)
 #define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(vma, x)
 #elif defined(REMAP_PAGE_RANGE_4)
 #define NV_REMAP_PAGE_RANGE(x...)    remap_page_range(x)


I have tried to keep the generic way to handle which function to use, so it can work on previous 2.6 kernel as well as on 2.4.
The name of variables may be obvious but it's working.

It 's given without waranty but it works for me so I hope it will help you.
(And sorry for my englisg).
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Wed Sep 29, 2004 8:06 pm    Post subject: Reply with quote

your patch is cleaner :) and works, too :)

by the way are you using a unpatched mm4?
Back to top
View user's profile Send private message
soliad
n00b
n00b


Joined: 09 May 2004
Posts: 42
Location: France

PostPosted: Wed Sep 29, 2004 9:42 pm    Post subject: Reply with quote

i'm using the mm4 version of portage (mm-sources-2.6.9-rc2-mm4)
Back to top
View user's profile Send private message
nbensa
l33t
l33t


Joined: 10 Jul 2002
Posts: 799
Location: Buenos Aires, Argentina

PostPosted: Thu Sep 30, 2004 6:02 am    Post subject: Reply with quote

soliad wrote:
So I tried to make a patch for the remap_pfn_range and it seems to work.
There is the patch :


Well, your patch didn't work here. It still compiles with remap_page_range :(

Code:
$ uname -a
Linux venkman 2.6.9-rc2-mm4-VP-S7 #11 Thu Sep 30 01:20:40 ART 2004 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
Back to top
View user's profile Send private message
soliad
n00b
n00b


Joined: 09 May 2004
Posts: 42
Location: France

PostPosted: Thu Sep 30, 2004 6:32 am    Post subject: Reply with quote

Maybe your kernel have a patch to handle remap_page_range so the test detect remap_page_range.
I think I have to rewrite the conftest part to seek for remap_pfn_range function in the kernel, so it can be more efficient.
I will do that afterwork.
Back to top
View user's profile Send private message
oggialli
Guru
Guru


Joined: 27 May 2004
Posts: 389
Location: Finland, near Tampere

PostPosted: Thu Sep 30, 2004 9:26 am    Post subject: Reply with quote

So actually, what are the preferred steps to perform in order to use one of these patches. I'm gonna use 2.6.9-rc2-mm4 now.
_________________
IBM Thinkpad T42P - Gentoo Linux
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Thu Sep 30, 2004 10:19 am    Post subject: Reply with quote

oggialli wrote:
So actually, what are the preferred steps to perform in order to use one of these patches. I'm gonna use 2.6.9-rc2-mm4 now.


get DaMouse' latest overlay and add soliad's patch :) then you have a 50% chance that it works or unpatch 6 patches of mm which did that function renaming ;) and use DaMouse's overlay...

these 6 patches have *remap* (i think) in their naming.... have a look on broken-out of latest mm
Back to top
View user's profile Send private message
oggialli
Guru
Guru


Joined: 27 May 2004
Posts: 389
Location: Finland, near Tampere

PostPosted: Thu Sep 30, 2004 11:40 am    Post subject: Reply with quote

Yeah, but i meant from the basics, ie what commands to use and how ... epatch, i guess ? Never had to use things like that although my system is very experimental ;)
_________________
IBM Thinkpad T42P - Gentoo Linux
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Thu Sep 30, 2004 11:45 am    Post subject: Reply with quote

updated with soliad's patch - anyone may try this one...
geki wrote:
did u try with my patch? http://geki.ath.cx/nvidia-kernel-1.0.6111-r1.tar.bz2
Back to top
View user's profile Send private message
oggialli
Guru
Guru


Joined: 27 May 2004
Posts: 389
Location: Finland, near Tampere

PostPosted: Thu Sep 30, 2004 12:27 pm    Post subject: Reply with quote

Can anybody tell me steptostep how to apply ebuild patches, I currently don't know where to get started in this thing ;)
_________________
IBM Thinkpad T42P - Gentoo Linux
Back to top
View user's profile Send private message
chickaroo
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2004
Posts: 102
Location: #!/usr/bin/girl

PostPosted: Thu Sep 30, 2004 12:35 pm    Post subject: Reply with quote

geki wrote:
http://geki.ath.cx/nvidia-kernel-1.0.6111-r1.tar.bz2


loaded modules fine... i startx and my pc reboots LOL
i'll just stick to reversing the patches... i posted my fixes here
_________________
Registered Linux user #364515 (Jun, 2004)
Back to top
View user's profile Send private message
chickaroo
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2004
Posts: 102
Location: #!/usr/bin/girl

PostPosted: Thu Sep 30, 2004 12:39 pm    Post subject: Reply with quote

oggialli wrote:
Can anybody tell me steptostep how to apply ebuild patches, I currently don't know where to get started in this thing ;)


just extract the tar in /usr/portage/ and emerge
_________________
Registered Linux user #364515 (Jun, 2004)
Back to top
View user's profile Send private message
oggialli
Guru
Guru


Joined: 27 May 2004
Posts: 389
Location: Finland, near Tampere

PostPosted: Thu Sep 30, 2004 12:46 pm    Post subject: Reply with quote

Ok, thanks, never guessed it to be that simple ;) What's the fuss about "his and his" patches to ebuilds ?
_________________
IBM Thinkpad T42P - Gentoo Linux
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum