diff -ru usr/src/nv/nv-vm.c usr/src/nv.1321905/nv-vm.c --- usr/src/nv/nv-vm.c 2005-03-22 16:19:09.000000000 +0100 +++ usr/src/nv.1321905/nv-vm.c 2005-10-23 15:43:12.860170440 +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;