diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-08-05 16:19:56 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-11 10:09:56 +1000 |
commit | bc033b63bbfeb6c4b4eb0a1d083c650e4a0d2af8 (patch) | |
tree | 40363a556790dc45e45f3f1823c7cca93de70dac /arch/powerpc/include/asm/mmu-hash64.h | |
parent | 8db13a0e1e87ae2741ca1677caa90e9592c4cc43 (diff) |
powerpc/mm: Fix attribute confusion with htab_bolt_mapping()
The function htab_bolt_mapping() is used to create permanent
mappings in the MMU hash table, for example, in order to create
the linear mapping of vmemmap. It's also used by early boot
ioremap (before mem_init_done).
However, the way ioremap uses it is incorrect as it passes it the
protection flags in the "linux PTE" form while htab_bolt_mapping()
expects them in the hash table format. This is made more confusing by
the fact that some of those flags are actually in the same position in
both cases.
This fixes it all by making htab_bolt_mapping() take normal linux
protection flags instead, and use a little helper to convert them to
htab flags. Callers can now use the usual PAGE_* definitions safely.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/mmu-hash64.h | 2 -
arch/powerpc/mm/hash_utils_64.c | 65 ++++++++++++++++++++--------------
arch/powerpc/mm/init_64.c | 9 +---
3 files changed, 44 insertions(+), 32 deletions(-)
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/include/asm/mmu-hash64.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu-hash64.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h index 19c7a940349..c2df53c5ceb 100644 --- a/arch/powerpc/include/asm/mmu-hash64.h +++ b/arch/powerpc/include/asm/mmu-hash64.h @@ -278,7 +278,7 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access, unsigned long trap); extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, - unsigned long pstart, unsigned long mode, + unsigned long pstart, unsigned long prot, int psize, int ssize); extern void set_huge_psize(int psize); extern void add_gpage(unsigned long addr, unsigned long page_size, |