Skip to content

Commit

Permalink
[PATCH] uml: fix pte bit collision
Browse files Browse the repository at this point in the history
_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>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Mar 29, 2007
1 parent d40f6d7 commit 602ed87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/asm-um/pgtable-2level.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ static inline void pgd_mkuptodate(pgd_t pgd) { }
((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

0 comments on commit 602ed87

Please sign in to comment.