Bugzilla – Attachment 49567 Details for
Bug 115800
nvidia: XEN support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
nv-fix-gartaddr-xen.diff
nv-fix-gartaddr-xen.diff (text/plain), 5.05 KB, created by
Kurt Garloff
on 2005-09-12 08:12:19 UTC
(
hide
)
Description:
nv-fix-gartaddr-xen.diff
Filename:
MIME Type:
Creator:
Kurt Garloff
Created:
2005-09-12 08:12:19 UTC
Size:
5.05 KB
patch
obsolete
>diff -uNrp NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-linux.h NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv-linux.h >--- NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-linux.h 2005-07-29 22:30:43.000000000 +0200 >+++ NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv-linux.h 2005-09-12 10:10:00.019875543 +0200 >@@ -118,6 +118,18 @@ > #define AGPGART > #include <linux/agp_backend.h> > #include <linux/agpgart.h> >+#include <asm/agp.h> >+#endif >+#ifndef phys_to_gart >+#define phys_to_gart(x) virt_to_bus(phys_to_virt(x)) >+#define gart_to_phys(x) virt_to_phys(bus_to_virt(x)) >+#define virt_to_gart(x) virt_to_bus(x) >+#define gart_to_virt(x) bus_to_virt(x) >+#else >+#ifndef virt_to_gart >+#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x))) >+#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x))) >+#endif > #endif > > #if defined(NVCPU_X86) || defined(NVCPU_X86_64) >@@ -637,14 +649,14 @@ typedef void irqreturn_t; > > #if defined(NV_REMAP_PFN_RANGE_PRESENT) > #define NV_REMAP_PAGE_RANGE(from, offset, x...) \ >- remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x) >+ io_remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x) > #elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT) >-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(vma, x) >+#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(vma, x) > #elif defined(NV_REMAP_PAGE_RANGE_4_PRESENT) >-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x) >+#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(x) > #else > #warning "conftest.sh failed, assuming remap_page_range(4)!" >-#define NV_REMAP_PAGE_RANGE(x...) remap_page_range(x) >+#define NV_REMAP_PAGE_RANGE(x...) io_remap_page_range(x) > #endif > > >@@ -1054,7 +1066,7 @@ static inline int nv_sg_map_buffer( > sg_ptr->offset = (unsigned long)base & ~PAGE_MASK; > sg_ptr->length = num_pages * PAGE_SIZE; > >- if (virt_to_phys(base) & ~dev->dma_mask) >+ if (virt_to_gart(base) & ~dev->dma_mask) > { > if (nv_remap_count + sg_ptr->length > nv_remap_limit) > { >@@ -1135,7 +1147,7 @@ static inline int nv_sg_load( > page_ptr->orig_phys_addr = page_ptr->phys_addr; > page_ptr->phys_addr = page_ptr->dma_addr; > page_ptr->orig_virt_addr = page_ptr->virt_addr; >- page_ptr->virt_addr = (unsigned long) __va(page_ptr->dma_addr); >+ page_ptr->virt_addr = gart_to_virt(page_ptr->dma_addr); > } > #endif > >diff -uNrp NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-vm.c NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv-vm.c >--- NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv-vm.c 2005-07-29 22:30:43.000000000 +0200 >+++ NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv-vm.c 2005-09-08 02:33:51.000000000 +0200 >@@ -151,7 +151,7 @@ int nv_vm_malloc_pages( > /* point page_ptr at the start of the actual page list */ > nv_pte_t *page_ptr = *at->page_table; > unsigned int i, j; >- unsigned long virt_addr = 0, phys_addr; >+ unsigned long virt_addr = 0, phys_addr, gart_addr; > #if defined(NV_SG_MAP_BUFFERS) > nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); > struct pci_dev *dev = nvl->dev; >@@ -238,6 +238,7 @@ int nv_vm_malloc_pages( > } > > phys_addr = nv_get_kern_phys_address(virt_addr); >+ gart_addr = phys_to_gart(phys_addr); > if (phys_addr == 0) > { > nv_printf(NV_DBG_ERRORS, >@@ -251,7 +252,7 @@ int nv_vm_malloc_pages( > page_ptr = at->page_table[i]; > page_ptr->phys_addr = phys_addr; > page_ptr->virt_addr = virt_addr; >- page_ptr->dma_addr = page_ptr->phys_addr; >+ page_ptr->dma_addr = gart_addr; > > #if defined(NV_SG_MAP_BUFFERS) > if (!NV_ALLOC_MAPPING_CONTIG(at->flags)) >diff -uNrp NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv.c NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv.c >--- NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv.orig/nv.c 2005-07-29 22:30:43.000000000 +0200 >+++ NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv.c 2005-09-12 10:09:18.802027642 +0200 >@@ -35,7 +35,13 @@ static struct pm_dev *apm_nv_dev[NV_MAX_ > > int nv_pat_enabled = 0; > >+#ifdef CONFIG_XEN >+static int nv_enable_xen=0; >+NV_MODULE_PARAMETER(nv_enable_xen); >+static int nv_disable_pat = 1; >+#else > static int nv_disable_pat = 0; >+#endif > NV_MODULE_PARAMETER(nv_disable_pat); > > /* >@@ -751,8 +757,10 @@ static inline void __nv_disable_caches(u > unsigned long cr0 = read_cr0(); > write_cr0(((cr0 & (0xdfffffff)) | 0x40000000)); > wbinvd(); >+#ifndef CONFIG_XEN > *cr4 = read_cr4(); > if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80); >+#endif > __flush_tlb(); > } > >@@ -762,7 +770,9 @@ static inline void __nv_enable_caches(un > wbinvd(); > __flush_tlb(); > write_cr0((cr0 & 0x9fffffff)); >+#ifndef CONFIG_XEN > if (cr4 & 0x80) write_cr4(cr4); >+#endif > } > > static int __check_pat_support() >@@ -993,6 +1003,11 @@ static int __init nvidia_init_module(voi > nv_printf(NV_DBG_ERRORS, "NVRM: No NVIDIA graphics adapter found!\n"); > return -ENODEV; > } >+#ifdef CONFIG_XEN >+ printk("NVIDIA driver not yet supported on xen, override with nv_enable_xen=1\n"); >+ if (!nv_enable_xen) >+ return -ENODEV; >+#endif > > memset(nv_linux_devices, 0, sizeof(nv_linux_devices)); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 115800
:
49159
|
49160
|
49511
|
49567
|
49575