public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* nonlinear vma problem in uml
@ 2007-03-02 23:06 Miklos Szeredi
  2007-03-05 20:22 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2007-03-02 23:06 UTC (permalink / raw)
  To: jdike; +Cc: linux-kernel, user-mode-linux

_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@suse.cz>
---

Index: linux/include/asm-um/pgtable-2level.h
===================================================================
--- linux.orig/include/asm-um/pgtable-2level.h	2007-03-02 23:03:15.000000000 +0100
+++ linux/include/asm-um/pgtable-2level.h	2007-03-02 23:03:26.000000000 +0100
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-05 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-02 23:06 nonlinear vma problem in uml Miklos Szeredi
2007-03-05 20:22 ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox