blob: 4e592a950f1f62e6e756a4e96eb7d5094c1d97d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
diff -ru usr/src/nv/nv-vm.c usr/src/nv.1321905/nv-vm.c
--- usr/src/nv/nv-vm.c 2005-07-29 22:30:43.000000000 +0200
+++ usr/src/nv.1321905/nv-vm.c 2005-09-29 20:08:12.186906704 +0200
@@ -248,6 +248,20 @@
/* lock the page for dma purposes */
SetPageReserved(NV_GET_PAGE_STRUCT(phys_addr));
+#if defined(_PAGE_NX)
+ if ((_PAGE_NX & pgprot_val(PAGE_KERNEL)) != 0 && phys_addr < 0x400000) {
+ // Until a bug in change_page_attr() is fixed
+ // we avoid pages with physaddr < 0x400000,
+ // since splitting "jumbo" mappings results
+ // in kernel pages being mapped as PAGE_KERNEL, which
+ // may include _PAGE_NX, effectively making much of the
+ // kernel code non-executable.
+ nv_printf(NV_DBG_MEMINFO, "NVRM: nv_vm_malloc discarding page @%08x\n", phys_addr);
+ --i;
+ continue;
+ }
+#endif
+
page_ptr = at->page_table[i];
page_ptr->phys_addr = phys_addr;
page_ptr->virt_addr = virt_addr;
|