Commit 602ed87e authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds

[PATCH] uml: fix pte bit collision

_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: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Acked-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d40f6d71
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment