From b0c55c62537f5ac59c7c78bb51b1e196c4073e86 Mon Sep 17 00:00:00 2001 From: hawk Date: Fri, 3 Mar 2006 17:19:20 +0000 Subject: [PATCH] - patch that works around a bug in some Linux kernels' implementation of the change_page_attr() interface function with respect to the handling of large pages and the no-execute page protection feature. This bug can lead to system reboots Changed files: NVIDIA_kernel-1.0-7174-1321905.diff -> 1.1 --- NVIDIA_kernel-1.0-7174-1321905.diff | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 NVIDIA_kernel-1.0-7174-1321905.diff diff --git a/NVIDIA_kernel-1.0-7174-1321905.diff b/NVIDIA_kernel-1.0-7174-1321905.diff new file mode 100644 index 0000000..67a1c0a --- /dev/null +++ b/NVIDIA_kernel-1.0-7174-1321905.diff @@ -0,0 +1,24 @@ +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; -- 2.44.0