4level support for ppc64
PATCH 11/17 4level support for ppc64
4level support for ppc64
ppc64 works with 3 levels (thanks to dwmw2)
Signed-off-by Andi Kleen <[email protected]>
arch/ppc64/kernel/eeh.c +1 -1
@@ -342,7 +342,7 @@ static inline unsigned long eeh_token_topte_t *ptep;unsigned long pa; - ptep =find_linux_pte (ioremap_mm.pgd, token); + ptep =find_linux_pte ((pgd_t *)ioremap_mm.pml4, token);if (!ptep)return token; pa =pte_pfn (*ptep) <<PAGE_SHIFT ;
arch/ppc64/kernel/process.c +1 -1
@@ -58,7 +58,7 @@ struct task_struct *last_task_used_altiv#endif struct mm_struct ioremap_mm = { - .pgd = ioremap_dir, + .pml4 = (pml4_t *)ioremap_dir, .mm_users =ATOMIC_INIT (2 ), .mm_count =ATOMIC_INIT (1 ), .cpu_vm_mask =CPU_MASK_ALL ,
arch/ppc64/mm/hash_utils.c +1 -1
@@ -315,7 +315,7 @@ int hash_page(unsigned long ea, unsignedbreak ; } - pgdir = mm->pgd; + pgdir = (pgd_t *)mm->pml4;if (pgdir ==NULL )return 1 ;
arch/ppc64/mm/hugetlbpage.c +3 -3
@@ -91,7 +91,7 @@ static hugepte_t *hugepte_alloc(struct mBUG_ON (!in_hugepage_area (mm->context, addr)); - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr); pmd =pmd_alloc (mm, pgd, addr);/* We shouldn't find a (normal) PTE page pointer here */
@@ -107,7 +107,7 @@ static hugepte_t *hugepte_offset(structBUG_ON (!in_hugepage_area (mm->context, addr)); - pgd =pgd_offset (mm, addr); + pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);if (pgd_none (*pgd))return NULL ;
@@ -189,7 +189,7 @@ static int prepare_low_seg_for_htlb(struspin_lock (&mm->page_table_lock); tlb =tlb_gather_mmu (mm,0 );for (addr = start; addr < end; addr +=PMD_SIZE ) { -pgd_t *pgd =pgd_offset (mm, addr); +pgd_t *pgd =pml4_pgd_offset (pml4_offset (mm, addr), addr);pmd_t *pmd;struct page *page;pte_t *pte;
arch/ppc64/mm/init.c +6 -1
@@ -853,7 +853,7 @@ void update_mmu_cache(struct vm_area_strif (!pte_young (pte))return ; - pgdir = vma->vm_mm->pgd; + pgdir = (pgd_t *)vma->vm_mm->pml4;if (pgdir ==NULL )return ;
@@ -904,3 +904,8 @@ void pgtable_cache_init(void)if (!zero_cache)panic ("pgtable_cache_init(): could not create zero_cache!\n" ); } + +pgd_t *__pgd_alloc (struct mm_struct *mm,pml4_t *dummy,unsigned long address) +{ +return kmem_cache_alloc (zero_cache,GFP_KERNEL ); +}
include/asm-ppc64/page.h +2 -0
@@ -236,5 +236,7 @@ extern int page_is_ram(unsigned long pfn#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) +#include <asm-generic/nopml4-page.h> +#endif /* __KERNEL__ */ #endif /* _PPC64_PAGE_H */
include/asm-ppc64/pgalloc.h +2 -6
@@ -18,12 +18,6 @@ extern kmem_cache_t *zero_cache;* 2 of the License, or (at your option) any later version. */ -static inline pgd_t * -pgd_alloc (struct mm_struct *mm) -{ -return kmem_cache_alloc (zero_cache,GFP_KERNEL ); -} -static inline void pgd_free (pgd_t *pgd) {
@@ -107,4 +101,6 @@ void __pte_free_tlb(struct mmu_gather *t#define check_pgt_cache () do { } while (0) +#include <asm-generic/nopml4-pgalloc.h> +#endif /* _PPC64_PGALLOC_H */
include/asm-ppc64/pgtable.h +4 -6
@@ -38,7 +38,7 @@#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) -#define USER_PTRS_PER_PGD (1024) +#define USER_PGDS_IN_LAST_PML4 (1024)#define FIRST_USER_PGD_NR 0#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
@@ -235,7 +235,7 @@ int hash_huge_page(struct mm_struct *mm,/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */ #define pgd_index (address) (((address) >> (PGDIR_SHIFT)) & 0x7ff) -#define pgd_offset (mm, address) ((mm)->pgd + pgd_index(address)) +#define pgd_index_k (address) pgd_index(address)/* Find an entry in the second-level page table.. */ #define pmd_offset (dir,addr) \
@@ -250,10 +250,6 @@ int hash_huge_page(struct mm_struct *mm,#define pte_unmap (pte) do { } while(0)#define pte_unmap_nested (pte) do { } while(0) -/* to find an entry in a kernel page-table-directory */ -/* This now only contains the vmalloc pages */ -#define pgd_offset_k (address) pgd_offset(&init_mm, address) -/* to find an entry in the ioremap page-table-directory */ #define pgd_offset_i (address) (ioremap_pgd + pgd_index(address))
@@ -558,4 +554,6 @@ static inline pte_t *find_linux_pte(pgd_#define __HAVE_ARCH_PTE_SAME#include <asm-generic/pgtable.h> +#include <asm-generic/nopml4-pgtable.h> +#endif /* _PPC64_PGTABLE_H */