summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2006-02-18 00:28:57 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2006-02-18 00:28:57 +0000
commit91a6df72584c6f89de6e43dc93478a74b79757ac (patch)
tree06f1f4dc9f561cc20bf8f7fa1ffe599381e77d08
parent959e71cd5a13f5fd8f8f756b96ec30aee2d34e7a (diff)
ttm: Add some comments about security- and code duplication issues for
linux kernel inclusion.
-rw-r--r--linux-core/drm_ttm.c17
-rw-r--r--linux-core/drm_vm.c14
2 files changed, 26 insertions, 5 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index e183030c..c8048d12 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -34,8 +34,15 @@
#include <asm/pgtable.h>
/*
- * Change the page protecting of an existing vma. Stolen from linux memory.c and mprotect.c
- */
+ * DAVE: The below code needs to go to the linux mm subsystem. Most of it is already there.
+ * Basically stolen from mprotect.c and rmap.c
+ * 8<----------------------------------------------------------------------------------
+ */
+
+
+#ifdef CONFIG_X86_PAE
+#error Cannot compile with CONFIG_X86_PAE. __supported_pte_mask undefined.
+#endif
void pgd_clear_bad(pgd_t * pgd)
{
@@ -144,6 +151,12 @@ static void drm_change_protection(struct vm_area_struct *vma,
}
/*
+ * 8<----------------------------------------------------------------------------------
+ * End linux mm subsystem code.
+ */
+
+
+/*
* Unmap all vma pages from vmas mapping this ttm.
*/
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index ba23db75..0010e1e5 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -44,9 +44,14 @@ static void drm_vm_ttm_close(struct vm_area_struct *vma);
static void drm_vm_ttm_open(struct vm_area_struct *vma);
/*
- * FIXME: We don't really want this. We want an exported version of the
- * mm subsystem's protection_map!
- */
+ * DAVE: The below definition is a duplication of the kernels protection_map, which is bad.
+ * Ideally if it would be possible to export a functional interface to that protection map
+ * instead:
+ *
+ * pgprot_t kernel_prot_map(u8 vm_flags);
+ *
+ * 8<----------------------------------------------------------------------------------
+ */
static pgprot_t drm_prot_map[16] = {
@@ -54,6 +59,9 @@ static pgprot_t drm_prot_map[16] = {
__S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
};
+/*
+ * 8<----------------------------------------------------------------------------------
+ */
/**
* \c nopage method for AGP virtual memory.