Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 124604 Details for
Bug 158686
x11-drivers/nvidia-drivers don't compile against xen kernels
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/nvidia-drivers-100.14.11_xen.patch
nvidia-drivers-100.14.11_xen.patch (text/plain), 8.72 KB, created by
Peter Fern
on 2007-07-12 01:11:26 UTC
(
hide
)
Description:
files/nvidia-drivers-100.14.11_xen.patch
Filename:
MIME Type:
Creator:
Peter Fern
Created:
2007-07-12 01:11:26 UTC
Size:
8.72 KB
patch
obsolete
>diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/conftest.sh NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/conftest.sh >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/conftest.sh 2007-06-14 10:18:39.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/conftest.sh 2007-07-12 10:48:02.000000000 +1000 >@@ -896,65 +896,6 @@ > fi > ;; > >- xen_sanity_check) >- # >- # Check if the target kernel is a Xen kernel. If so, then exit, since >- # the driver doesn't currently work with Xen. >- # >- RET=1 >- VERBOSE=$6 >- FILE="linux/autoconf.h" >- >- if [ -n "$IGNORE_XEN_PRESENCE" ]; then >- exit 0 >- fi >- >- if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then >- # >- # We are looking at a configured source tree; verify >- # that it's not a Xen kernel. >- # >- echo "#include <linux/autoconf.h> >- #ifdef CONFIG_XEN >- #error CONFIG_XEN defined!! >- #endif >- " > conftest$$.c >- >- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 >- rm -f conftest$$.c >- >- if [ -f conftest$$.o ]; then >- rm -f conftest$$.o >- RET=0 >- fi >- else >- CONFIG=$HEADERS/../.config >- if [ -f $CONFIG ]; then >- if [ -z "$(grep "^CONFIG_XEN=y" $CONFIG)" ]; then >- RET=0 >- fi >- fi >- fi >- >- if [ "$RET" != "0" ]; then >- echo "The kernel you are installing for is a Xen kernel!"; >- echo ""; >- echo "The NVIDIA driver does not currently work on Xen kernels. If "; >- echo "you are using a stock distribution kernel, please install "; >- echo "a variant of this kernel without Xen support; if this is a "; >- echo "custom kernel, please install a standard Linux kernel. Then "; >- echo "try installing the NVIDIA kernel module again."; >- echo ""; >- if [ "$VERBOSE" = "full_output" ]; then >- echo "*** Failed Xen sanity check. Bailing out! ***"; >- echo ""; >- fi >- exit 1 >- else >- exit 0 >- fi >- ;; >- > acpi_device_ops_match) > # > # Determine if the acpi_device_ops data structure has >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/Makefile.kbuild NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/Makefile >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/Makefile.kbuild NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/Makefile.kbuild >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/Makefile.kbuild 2007-07-12 10:45:26.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/Makefile.kbuild 2007-07-12 10:46:51.000000000 +1000 >@@ -293,15 +293,12 @@ > nvidiafb-sanity-check: > @if ! $(CONFTEST) nvidiafb_sanity_check full_output; then exit 1; fi > >-xen-sanity-check: >- @if ! $(CONFTEST) xen_sanity_check full_output; then exit 1; fi >- > # > # Build the NVIDIA kernel module using Linux KBUILD. This target is used by > # the "package-install" target below. > # > >-module: cc-version-check xen-sanity-check rivafb-sanity-check nvidiafb-sanity-check >+module: cc-version-check rivafb-sanity-check nvidiafb-sanity-check > @if [ -z "$(PATCHLEVEL)" ]; then \ > echo "failed to determine PATCHLEVEL!"; \ > exit 1; \ >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv.c NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv.c 2007-06-14 10:18:38.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv.c 2007-07-12 10:54:19.000000000 +1000 >@@ -42,7 +42,11 @@ > > int nv_pat_enabled = 0; > >-#if !defined(NV_BUILD_NV_PAT_SUPPORT) >+/* >+ * disable PAT support if XEN or PREEMPT_RT is configured in kernel >+ */ >+ >+#if defined(CONFIG_XEN) || defined(CONFIG_PREEMPT_RT) || !defined(NV_BUILD_NV_PAT_SUPPORT) > static int nv_disable_pat = 1; > #else > static int nv_disable_pat = 0; >@@ -951,8 +955,10 @@ > return; > #endif > >+#if !defined(CONFIG_PREEMPT_RT) > NV_SAVE_FLAGS(eflags); > NV_CLI(); >+#endif > __nv_disable_caches(&cr4); > > NV_READ_PAT_ENTRIES(pat1, pat2); >@@ -963,7 +969,9 @@ > NV_WRITE_PAT_ENTRIES(pat1, pat2); > > __nv_enable_caches(cr4); >+#if !defined(CONFIG_PREEMPT_RT) > NV_RESTORE_FLAGS(eflags); >+#endif > } > > static void __nv_restore_pat_entries(void *info) >@@ -977,14 +985,18 @@ > return; > #endif > >+#if !defined(CONFIG_PREEMPT_RT) > NV_SAVE_FLAGS(eflags); > NV_CLI(); >+#endif > __nv_disable_caches(&cr4); > > NV_WRITE_PAT_ENTRIES(orig_pat1, orig_pat2); > > __nv_enable_caches(cr4); >+#if !defined(CONFIG_PREEMPT_RT) > NV_RESTORE_FLAGS(eflags); >+#endif > } > > #endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-linux.h NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv-linux.h >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-linux.h 2007-06-14 10:18:38.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv-linux.h 2007-07-12 10:47:05.000000000 +1000 >@@ -261,7 +261,7 @@ > * tiny, and the kernel panics when it is exhausted. try to warn the user that > * they need to boost the size of their pool. > */ >-#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32) >+#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32) && !defined(CONFIG_XEN) > #define NV_SWIOTLB 1 > #endif > >@@ -666,7 +666,11 @@ > # define NV_CLI() local_irq_disable() > # define NV_SAVE_FLAGS(eflags) local_save_flags(eflags) > # define NV_RESTORE_FLAGS(eflags) local_irq_restore(eflags) >+#if defined(CONFIG_PREEMPT_RT) >+# define NV_MAY_SLEEP() (!in_interrupt() && !in_atomic() && !in_softirq()) >+#else > # define NV_MAY_SLEEP() (!in_interrupt() && !in_atomic()) >+#endif > # define NV_MODULE_PARAMETER(x) module_param(x, int, 0) > # define NV_MODULE_STRING_PARAMETER(x) module_param(x, charp, 0) > >@@ -821,7 +825,10 @@ > #define NV_VM_INSERT_PAGE(vma, addr, page) \ > vm_insert_page(vma, addr, page) > #endif >-#if defined(NV_REMAP_PFN_RANGE_PRESENT) >+#if defined(CONFIG_XEN) >+#define NV_REMAP_PAGE_RANGE(from, offset, x...) \ >+ io_remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x) >+#elif defined(NV_REMAP_PFN_RANGE_PRESENT) > #define NV_REMAP_PAGE_RANGE(from, offset, x...) \ > remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x) > #elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT) >@@ -941,6 +948,9 @@ > __pte_value; \ > }) > >+#if !defined(CONFIG_XEN) >+#define phys_to_machine(x) x >+#endif > > #define NV_PAGE_ALIGN(addr) ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE) > #define NV_MASK_OFFSET(addr) ( (addr) & (PAGE_SIZE - 1) ) >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-vm.c NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv-vm.c >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-vm.c 2007-06-14 10:18:38.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/nv-vm.c 2007-07-12 10:47:05.000000000 +1000 >@@ -352,6 +352,9 @@ > > static void nv_flush_caches(void) > { >+#if defined(CONFIG_PREEMPT_RT) >+ if(!nv_pat_enabled) return; >+#endif > #if defined(KERNEL_2_4) > // for 2.4 kernels, just automatically flush the caches and invalidate tlbs > nv_execute_on_all_cpus(cache_flush, NULL); >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-agp.c NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/os-agp.c >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-agp.c 2007-06-14 10:18:38.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/os-agp.c 2007-07-12 10:47:05.000000000 +1000 >@@ -295,7 +295,7 @@ > > page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK); > page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr); >- page_ptr->dma_addr = page_ptr->phys_addr; >+ page_ptr->dma_addr = phys_to_machine(page_ptr->phys_addr); > } > > return RM_OK; >diff -ur NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-interface.c NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/os-interface.c >--- NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-interface.c 2007-06-14 10:18:38.000000000 +1000 >+++ NVIDIA-Linux-x86_64-100.14.11-pkg2/usr/src/nv/os-interface.c 2007-07-12 10:47:05.000000000 +1000 >@@ -552,6 +552,7 @@ > MicroSeconds = MilliSeconds * 1000; > tm_end.tv_usec = MicroSeconds; > tm_end.tv_sec = 0; >+#if !defined(CONFIG_XEN) && !defined(CONFIG_PREEMPT_RT) > NV_TIMERADD(&tm_aux, &tm_end, &tm_end); > > /* do we have a full jiffie to wait? */ >@@ -599,6 +600,7 @@ > MicroSeconds = 0; > } while ((jiffies = NV_USECS_TO_JIFFIES(MicroSeconds)) != 0); > } >+#endif > > if (MicroSeconds > 1000) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 158686
:
122719
| 124604