Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107547 - patch from nvidia for 7676 and amd64
Summary: patch from nvidia for 7676 and amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High enhancement (vote)
Assignee: X11 External Driver Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-28 16:35 UTC by Volker Hemmann
Modified: 2005-10-28 00:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for amd64/emt64 from nvidia on the nvidia-forum (NVIDIA_kernel-1.0-7676-1359015.diff,3.22 KB, patch)
2005-09-29 08:54 UTC, Volker Hemmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Hemmann 2005-09-28 16:35:56 UTC
Hi,    
three weeks ago, on the nvidia linux forum nvidia posted this patch, which I did not find when 
I grepped the portage tree for it.   
Are there reasons, why it should or should not be add to the ebuild?   
  
http://www.nvnews.net/vbulletin/showthread.php?t=56150   
   
NVIDIA_kernel-1.0-7676-1359015.diff.txt:   
diff -ru usr/src/nv/Makefile.kbuild usr/src/nv.1359015/Makefile.kbuild   
--- usr/src/nv/Makefile.kbuild	2005-07-29 22:51:12.000000000 +0200   
+++ usr/src/nv.1359015/Makefile.kbuild	2005-09-06 23:15:03.788036912 +0200   
@@ -222,6 +222,10 @@   
     EXTRA_CFLAGS += -DNV_VMAP_4_PRESENT   
 endif   
    
+ifeq ($(shell $(CONFTEST) supported_pte_mask), 1)   
+  EXTRA_CFLAGS += -DNV_SUPPORTED_PTE_MASK_PRESENT   
+endif   
+   
 #   
 # Miscellaneous NVIDIA kernel module build support targets. They are needed   
 # to satisfy KBUILD requirements and to support NVIDIA specifics.   
diff -ru usr/src/nv/Makefile.nvidia usr/src/nv.1359015/Makefile.nvidia   
--- usr/src/nv/Makefile.nvidia	2005-07-29 22:51:12.000000000 +0200   
+++ usr/src/nv.1359015/Makefile.nvidia	2005-09-06 23:15:03.788036912 +0200   
@@ -85,6 +85,10 @@   
     DEFINES += -DNV_VMAP_4_PRESENT   
 endif   
    
+ifeq ($(shell $(CONFTEST) supported_pte_mask), 1)   
+  EXTRA_CFLAGS += -DNV_SUPPORTED_PTE_MASK_PRESENT   
+endif   
+   
 DEFINES+=$(EXTRA_DEFINES)   
    
 # allow build parameters to be passed in through the environment   
diff -ru usr/src/nv/conftest.sh usr/src/nv.1359015/conftest.sh   
--- usr/src/nv/conftest.sh	2005-07-29 22:51:12.000000000 +0200   
+++ usr/src/nv.1359015/conftest.sh	2005-09-06 23:15:03.789036760 +0200   
@@ -537,7 +537,8 @@   
    
     vmap_arg_count)   
         #   
-        # Determine, if vmap() is present, and how many arguments it takes   
+        # Determine, if vmap() is present, and how many arguments   
+        # it takes.   
         #   
    
         echo "#include <linux/vmalloc.h>   
@@ -567,4 +568,30 @@   
         else   
             exit 1  # there ain't no vmap()   
         fi   
+    ;;   
+   
+    supported_pte_mask)   
+        #   
+        # Determine if the i386/x86_64 __supported_pte_mask symbol   
+        # is available.   
+        #   
+   
+        echo "#include <asm/pgtable.h>   
+        #include <asm/page.h>   
+        void nv___suported_pte_mask_test() {   
+            pgprot_t prot = __pgprot(0);   
+            pgprot_val(prot) &= __supported_pte_mask;   
+        }" > conftest$$.c   
+   
+        $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1   
+        rm -f conftest$$.c   
+   
+        if [ -f conftest$$.o ]; then   
+            rm -f conftest$$.o   
+            echo 1   
+        else   
+            echo 0   
+        fi   
+    ;;   
+   
 esac   
diff -ru usr/src/nv/nv-linux.h usr/src/nv.1359015/nv-linux.h   
--- usr/src/nv/nv-linux.h	2005-07-29 22:51:12.000000000 +0200   
+++ usr/src/nv.1359015/nv-linux.h	2005-09-06 23:16:43.998802560 +0200   
@@ -980,7 +980,11 @@   
         if (nv_use_cpa)   
         {   
             struct page *page = virt_to_page(__va(page_ptr->phys_addr));   
-            change_page_attr(page, 1, PAGE_KERNEL_NOCACHE);   
+            pgprot_t prot = PAGE_KERNEL_NOCACHE;   
+#if defined(NV_SUPPORTED_PTE_MASK_PRESENT)   
+            pgprot_val(prot) &= __supported_pte_mask;   
+#endif   
+            change_page_attr(page, 1, prot);   
         }   
     }   
 static inline void NV_SET_PAGE_ATTRIB_CACHED(nv_pte_t *page_ptr)   
@@ -988,7 +992,11 @@   
         if (nv_use_cpa)   
         {   
             struct page *page = virt_to_page(__va(page_ptr->phys_addr));   
-            change_page_attr(page, 1, PAGE_KERNEL);   
+            pgprot_t prot = PAGE_KERNEL;   
+#if defined(NV_SUPPORTED_PTE_MASK_PRESENT)   
+            pgprot_val(prot) &= __supported_pte_mask;   
+#endif   
+            change_page_attr(page, 1, prot);   
         }   
     }   
 #else   
   
I don't have problems - I am just curious ;) 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-09-29 03:54:50 UTC
Please don't inline, attach instead.
Comment 2 Volker Hemmann 2005-09-29 08:54:29 UTC
Created attachment 69496 [details, diff]
patch for amd64/emt64 from nvidia on the nvidia-forum
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2005-10-28 00:44:04 UTC
This should be fixed in 7676-r1.  Please repoen if that is not the case.