]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Fix attribute confusion with htab_bolt_mapping()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 5 Aug 2008 06:19:56 +0000 (16:19 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 11 Aug 2008 00:09:56 +0000 (10:09 +1000)
commit5655634fc3adf2c918b901e24d02611e2a0ce9d5
tree40363a556790dc45e45f3f1823c7cca93de70dac
parent9848a5cdcab4d4e7d4e49ac6d6069cb06584851a
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>
arch/powerpc/include/asm/mmu-hash64.h
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_64.c