Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 163332 Details for
Bug 235231
x11-drivers/nvidia-drivers doesn't compile with kernel 2.6.27-rc3-git5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 2.6.27-rc1 and nvidia 177.13
NVIDIA_2.6.27.patch (text/plain), 12.54 KB, created by
Fabio Catarinella
on 2008-08-19 21:54:25 UTC
(
hide
)
Description:
Patch for 2.6.27-rc1 and nvidia 177.13
Filename:
MIME Type:
Creator:
Fabio Catarinella
Created:
2008-08-19 21:54:25 UTC
Size:
12.54 KB
patch
obsolete
>2008-08-02 Vallimar <boo@hoo.org> > > * Makefile.kbuild: Added workaround for GPL symbols. > >2008-07-27 Cats <cats@cats.com> > > * os-interface.c (os_kill_process): Turned into a stub that just returns RM_OK. > >2008-07-27 Cats <cats@cats.com> > > Fix build finishing without doing anything. > Relevant patch: kbuild-remove-final-references-to-deprecated-unreferenced-topdir.patch > * Makefile.kbuild: Change TOPDIR to srctree. > > Fix asm/semaphore.h -> linux/semaphore.h error/warning. > Relevant commit: 2351ec533ed0dd56052ab96988d2161d5ecc8ed9 > * nv-linux.h: Include linux/semaphore.h instead of asm/semaphore.h. > > Fix missing kill_proc() error. > Relevant commit: 19b0cfcca41dd772065671ad0584e1cea0f3fd13 > * os-interface.c (os_kill_process): Replace call to kill_proc() with kill_proc_info(). > > Fix 'too many parameters' errors for on_each_cpu() and smp_call_function(). > Relevant commits: 8691e5a8f691cc2a4fda0651e8d307aaba0e7d68, 15c8b6c1aaaf1c4edd67e2f02e4d8e1bd1a51c0d > * conftest.sh: Add test for on_each_cpu argument count. > * Makefile.kbuild: Add on_each_cpu to COMPILE_TESTS. > * nv-linux.h: Add NV_ON_EACH_CPU() and NV_SMP_CALL_FUNCTION() macros. > * nv-linux.h (nv_execute_on_all_cpus): Replace on_each_cpu() with NV_ON_EACH_CPU(). > * nv-linux.h (nv_execute_on_all_cpus): Replace smp_call_function() with NV_SMP_CALL_FUNCTION(). > * nv.c (nv_kern_cpu_callback): Likewise. > * os-interface.c (ipi_handler): Likewise. > > >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/Makefile.kbuild NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/Makefile.kbuild >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/Makefile.kbuild 2008-06-10 20:13:15.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/Makefile.kbuild 2008-08-02 09:58:24.000000000 -0400 >@@ -63,7 +63,7 @@ > # set this conditional of a kernel-level instance. > # > >-ifdef TOPDIR >+ifdef srctree > obj-m := $(MODULE_NAME).o > endif > >@@ -75,6 +75,10 @@ > EXTRA_CFLAGS += -I$(src) > EXTRA_CFLAGS += -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wpointer-arith -Wno-multichar -Werror -mcmodel=kernel -mno-red-zone -MD $(DEFINES) $(INCLUDES) -Wsign-compare -Wno-cast-qual -Wno-error > >+PV_CPU := $(shell grep "D pv_cpu_ops" /boot/System.map-$(shell uname -r) | colrm 9) >+PV_LOCK := $(shell grep "D pv_lock_ops" /boot/System.map-$(shell uname -r) | colrm 9) >+EXTRA_LDFLAGS := >+ > # > # We rely on these two definitions below; if they aren't set, we set them to > # reasonable defaults (Linux 2.4's KBUILD, and top-level passes will not set >@@ -129,7 +133,7 @@ > # a top-level run). > # > >-TOPDIR ?= $(KERNEL_SOURCES) >+srctree ?= $(KERNEL_SOURCES) > PATCHLEVEL ?= $(shell $(CONFTEST) kernel_patch_level) > > # >@@ -186,7 +190,8 @@ > acpi_device_ops \ > acpi_device_id \ > acquire_console_sem \ >- kmem_cache_create >+ kmem_cache_create \ >+ on_each_cpu > else > COMPILE_TESTS = \ > remap_page_range \ >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/conftest.sh NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/conftest.sh >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/conftest.sh 2008-06-10 20:13:15.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/conftest.sh 2008-08-02 09:42:44.000000000 -0400 >@@ -32,7 +32,7 @@ > # > echo "#include <linux/autoconf.h> > #ifdef CONFIG_XEN >- #error CONFIG_XEN defined! >+ /*#error CONFIG_XEN defined!*/ > #endif > " > conftest$$.c > >@@ -51,6 +51,8 @@ > fi > fi > fi >+ >+ XEN_PRESENT=0 > } > > build_cflags() { >@@ -774,6 +776,61 @@ > fi > ;; > >+ on_each_cpu) >+ # >+ # Determine if the on_each_cpu() function is >+ # present and how many arguments it takes. >+ # >+ echo "$CONFTEST_PREAMBLE >+ #include <linux/smp.h> >+ int conftest_on_each_cpu(void) { >+ return on_each_cpu(); >+ }" > 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 "#undef NV_ON_EACH_CPU_PRESENT" >> conftest.h >+ return >+ fi >+ >+ echo "$CONFTEST_PREAMBLE >+ #include <linux/smp.h> >+ int conftest_on_each_cpu(void (*func) (void *info), void *info) { >+ return on_each_cpu(func, info, 0, 0); >+ }" > 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 "#define NV_ON_EACH_CPU_PRESENT" >> conftest.h >+ echo "#define NV_ON_EACH_CPU_ARGUMENT_COUNT 4 " >> conftest.h >+ return >+ fi >+ >+ echo "$CONFTEST_PREAMBLE >+ #include <linux/smp.h> >+ int conftest_on_each_cpu(void (*func) (void *info), void *info) { >+ return on_each_cpu(func, info, 0); >+ }" > 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 "#define NV_ON_EACH_CPU_PRESENT" >> conftest.h >+ echo "#define NV_ON_EACH_CPU_ARGUMENT_COUNT 3 " >> conftest.h >+ return >+ else >+ echo "#error on_each_cpu() conftest failed!" >> conftest.h >+ fi >+ ;; >+ > esac > } > >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv-linux.h NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv-linux.h >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv-linux.h 2008-06-10 20:13:14.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv-linux.h 2008-08-02 09:42:44.000000000 -0400 >@@ -104,15 +104,10 @@ > #endif > > #include <linux/spinlock.h> >-#include <asm/semaphore.h> >+#include <linux/semaphore.h> > #include <linux/completion.h> > #include <linux/highmem.h> > >-#ifdef CONFIG_XEN >-#include <asm/maddr.h> >-#include <xen/interface/memory.h> >-#endif >- > #ifdef CONFIG_PROC_FS > #include <linux/proc_fs.h> > #endif >@@ -144,7 +139,7 @@ > #include <linux/agpgart.h> > #endif > >-#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) && !defined(CONFIG_XEN) >+#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) > #define NV_ENABLE_PAT_SUPPORT > #endif > >@@ -656,6 +651,20 @@ > > #endif /* !defined NVWATCH */ > >+#if defined(NV_ON_EACH_CPU_PRESENT) >+#if (NV_ON_EACH_CPU_ARGUMENT_COUNT == 4) >+#define NV_ON_EACH_CPU(func, info, retry, wait) on_each_cpu(func, info, retry, wait) >+#define NV_SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, retry, wait) >+#elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3) >+#define NV_ON_EACH_CPU(func, info, retry, wait) on_each_cpu(func, info, wait) >+#define NV_SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, wait) >+#else >+#error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!" >+#endif >+#else >+#error "NV_ON_EACH_CPU() undefined (on_each_cpu() unavailable)!" >+#endif >+ > static inline int nv_execute_on_all_cpus(void (*func)(void *info), void *info) > { > int ret = 0; >@@ -665,13 +674,13 @@ > #if defined(preempt_disable) > preempt_disable(); > #endif >- ret = smp_call_function(func, info, 1, 1); >+ ret = NV_SMP_CALL_FUNCTION(func, info, 1, 1); > func(info); > #if defined(preempt_enable) > preempt_enable(); > #endif > #else >- ret = on_each_cpu(func, info, 1, 1); >+ ret = NV_ON_EACH_CPU(func, info, 1, 1); > #endif > return ret; > } >@@ -727,11 +736,7 @@ > #define NV_TASK_STRUCT_RLIM(current) ((current)->rlim) > #endif > >-#ifdef CONFIG_XEN >-#define NV_GET_DMA_ADDRESS(phys_addr) phys_to_machine(phys_addr) >-#else > #define NV_GET_DMA_ADDRESS(phys_addr) (phys_addr) >-#endif > > #define NV_GET_PAGE_STRUCT(phys_page) virt_to_page(__va(phys_page)) > #define NV_VMA_PGOFF(vma) ((vma)->vm_pgoff) >@@ -884,7 +889,7 @@ > #else > #error "NV_REMAP_PAGE_RANGE() undefined!" > #endif >-#if !defined(CONFIG_XEN) >+#if 1 > #define NV_IO_REMAP_PAGE_RANGE(from, offset, x...) \ > NV_REMAP_PAGE_RANGE(from, offset, x) > #else >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv-vm.c NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv-vm.c >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv-vm.c 2008-06-10 20:13:14.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv-vm.c 2008-08-02 09:42:44.000000000 -0400 >@@ -312,7 +312,7 @@ > #endif > > #if (defined(KERNEL_2_4) || defined(NV_CPA_DF_LIST_BUG) || \ >- (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))) && !defined(CONFIG_XEN) >+ (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))) > #define NV_CPA_NEEDS_FLUSHING 1 > #endif > >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv.c NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv.c >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/nv.c 2008-06-10 20:13:14.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/nv.c 2008-08-02 09:42:44.000000000 -0400 >@@ -1296,14 +1296,14 @@ > if (get_cpu() == cpu) > __nv_setup_pat_entries(NULL); > else >- smp_call_function(__nv_setup_pat_entries, hcpu, 1, 1); >+ NV_SMP_CALL_FUNCTION(__nv_setup_pat_entries, hcpu, 1, 1); > put_cpu(); > break; > case CPU_DOWN_PREPARE: > if (get_cpu() == cpu) > __nv_restore_pat_entries(NULL); > else >- smp_call_function(__nv_restore_pat_entries, hcpu, 1, 1); >+ NV_SMP_CALL_FUNCTION(__nv_restore_pat_entries, hcpu, 1, 1); > put_cpu(); > break; > } >@@ -2040,17 +2040,6 @@ > goto failed; > } > >-#if defined(CONFIG_XEN) && defined(NVCPU_X86) >- if (HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL) > 0xfffff) >- { >- nv_printf(NV_DBG_ERRORS, >- "NVRM: Systems with system memory mapped above the 4GB boundary\n" >- "NVRM: are not supported when using x86 Xen kernels.\n"); >- rc = -EIO; >- goto failed; >- } >-#endif >- > if (!rm_init_adapter(sp, nv)) > { > free_irq(nv->interrupt_line, (void *) nvl); >@@ -2063,20 +2052,6 @@ > nvl->tasklet.data = (unsigned long) nv; > tasklet_enable(&nvl->tasklet); > >-#if defined(CONFIG_XEN) >- if ((nvl->dev->dma_mask <= 0xffffffff) && >- (HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL) > 0xfffff)) >- { >- NV_SHUTDOWN_ADAPTER(sp, nv, nvl); >- nv_printf(NV_DBG_ERRORS, >- "NVRM: GPUs incapable of addressing more than 4GB of memory\n" >- "NVRM: are not supported when using Xen kernels on systems with\n" >- "NVRM: system memory mapped above the 4GB boundary.\n"); >- rc = -EIO; >- goto failed; >- } >-#endif >- > nv->flags |= NV_FLAG_OPEN; > } > >@@ -3944,7 +3919,7 @@ > U032 config > ) > { >-#if !defined(CONFIG_XEN) >+#if 1 > RM_STATUS status = RM_ERROR; > static int old_error = 0; > nv_stack_t *sp = NULL; >diff -ur NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/os-interface.c NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/os-interface.c >--- NVIDIA-Linux-x86_64-177.13-pkg2/usr/src/nv/os-interface.c 2008-06-10 20:13:14.000000000 -0400 >+++ NVIDIA-Linux-x86_64-177.13-pkg2-fix/usr/src/nv/os-interface.c 2008-08-02 09:42:44.000000000 -0400 >@@ -48,7 +48,7 @@ > #endif > local_bh_disable(); > atomic_set(&os_smp_barrier, 1); >- ret = smp_call_function(ipi_handler, NULL, 1, 0); >+ ret = NV_SMP_CALL_FUNCTION(ipi_handler, NULL, 1, 0); > #endif > return (ret == 0) ? RM_OK : RM_ERROR; > } >@@ -609,7 +609,7 @@ > if (jiffies) > { > // if we have at least 1 full jiffy to wait, give up the cpu >-#if !defined(CONFIG_XEN) >+#if 1 > // but first, make sure we haven't raised the irql level on > // this cpu (most likely holding a lock). I'm seeing cases > // where we give up the cpu with raised irql, and never get >@@ -623,7 +623,7 @@ > #endif > /* give up the cpu */ > current->state = TASK_INTERRUPTIBLE; >-#if !defined(CONFIG_XEN) >+#if 1 > } > else > { >@@ -700,7 +700,7 @@ > U032 sig > ) > { >- return kill_proc(pid, sig, 1) ? RM_ERR_OPERATING_SYSTEM : RM_OK; >+ return RM_OK; > } > > /*******************************************************************************/ >@@ -1394,7 +1394,7 @@ > * If you prefer to manually grant the necessary capability and > * adjust the resource limit, disable the lines below. > */ >-#if !defined(CONFIG_XEN) && !defined(CONFIG_X86_4G) >+#if !defined(CONFIG_X86_4G) > struct rlimit *rlim = NV_TASK_STRUCT_RLIM(current); > rlim[RLIMIT_MEMLOCK].rlim_cur = RLIM_INFINITY; > cap_raise(current->cap_effective, CAP_IPC_LOCK);
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 235231
: 163332