[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070327182749.GA8411@c2.user-mode-linux.org>
Date: Tue, 27 Mar 2007 14:27:49 -0400
From: Jeff Dike <jdike@...toit.com>
To: Andrew Morton <akpm@...l.org>
Cc: Miklos Szeredi <mszeredi@...e.cz>,
LKML <linux-kernel@...r.kernel.org>,
uml-devel <user-mode-linux-devel@...ts.sourceforge.net>
Subject: [PATCH 4/6] UML - Fix pte bit collision
From: Miklos Szeredi <mszeredi@...e.cz>
_PAGE_PROTNONE conflicts with the lowest bit of pgoff. This causes
all sorts of weirdness when nonlinear mappings are used.
Took me a good half day to track this down.
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
Signed-off-by: Jeff Dike <jdike@...ux.intel.com>
--
include/asm-um/pgtable-2level.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6.21-mm/include/asm-um/pgtable-2level.h
===================================================================
--- linux-2.6.21-mm.orig/include/asm-um/pgtable-2level.h 2007-03-27 12:34:31.000000000 -0400
+++ linux-2.6.21-mm/include/asm-um/pgtable-2level.h 2007-03-27 12:52:12.000000000 -0400
@@ -45,12 +45,12 @@ static inline void pgd_mkuptodate(pgd_t
((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
/*
- * Bits 0 through 3 are taken
+ * Bits 0 through 4 are taken
*/
-#define PTE_FILE_MAX_BITS 28
+#define PTE_FILE_MAX_BITS 27
-#define pte_to_pgoff(pte) (pte_val(pte) >> 4)
+#define pte_to_pgoff(pte) (pte_val(pte) >> 5)
-#define pgoff_to_pte(off) ((pte_t) { ((off) << 4) + _PAGE_FILE })
+#define pgoff_to_pte(off) ((pte_t) { ((off) << 5) + _PAGE_FILE })
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists