diff options
Diffstat (limited to 'kernel/arch/powerpc/include/asm/pgtable-ppc64.h')
-rw-r--r-- | kernel/arch/powerpc/include/asm/pgtable-ppc64.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/arch/powerpc/include/asm/pgtable-ppc64.h b/kernel/arch/powerpc/include/asm/pgtable-ppc64.h index 43e6ad424..88d27e325 100644 --- a/kernel/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/kernel/arch/powerpc/include/asm/pgtable-ppc64.h @@ -135,7 +135,19 @@ #define pte_iterate_hashed_end() } while(0) #ifdef CONFIG_PPC_HAS_HASH_64K -#define pte_pagesize_index(mm, addr, pte) get_slice_psize(mm, addr) +/* + * We expect this to be called only for user addresses or kernel virtual + * addresses other than the linear mapping. + */ +#define pte_pagesize_index(mm, addr, pte) \ + ({ \ + unsigned int psize; \ + if (is_kernel_addr(addr)) \ + psize = MMU_PAGE_4K; \ + else \ + psize = get_slice_psize(mm, addr); \ + psize; \ + }) #else #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K #endif |