提交 602ed87e 编写于 作者: M Miklos Szeredi 提交者: 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: NMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Acked-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册