Subject: fix ls store access with 64k mappings From: Benjamin Herrenschmidt This is also part of the latest patch posted to cbe-oss-dev. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Arnd Bergmann Index: linux-2.6/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux-2.6.orig/arch/powerpc/mm/hash_utils_64.c +++ linux-2.6/arch/powerpc/mm/hash_utils_64.c @@ -698,6 +698,15 @@ int hash_page(unsigned long ea, unsigned } #endif /* CONFIG_HUGETLB_PAGE */ +#ifndef CONFIG_PPC_64K_PAGES + /* If we use 4K pages and our psize is not 4K, then we are hitting + * a special driver mapping, we need to align the address before + * we fetch the PTE + */ + if (psize != MMU_PAGE_4K) + ea &= ~((1ul << mmu_psize_defs[psize].shift) - 1); +#endif /* CONFIG_PPC_64K_PAGES */ + /* Get PTE and page size from page tables */ ptep = find_linux_pte(pgdir, ea); if (ptep == NULL || !pte_present(*ptep)) {