diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2018-04-16 14:27:20 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-05-15 15:29:11 +0300 |
commit | 1c7ec8a40aa7796a5a996bd985899c93dacaaa35 (patch) | |
tree | b5f5e37f8bd3beb644ff28255724a18d22ffcd9c /arch/powerpc/mm | |
parent | 702346768c68a95be29f5819e8445a3eff30dac0 (diff) | |
download | linux-1c7ec8a40aa7796a5a996bd985899c93dacaaa35.tar.xz |
powerpc/mm/book3s64/4k: Switch 4k pagesize config to use pagetable fragment
4K config use one full page at level 4 of the pagetable. Add support for single
fragment allocation in pagetable fragment code and and use that for 4K config.
This makes both 4k and 64k use the same code path. Later we will switch pmd to
use the page table fragment code. This is done only for 64bit platforms which
is using page table fragment support.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/mmu_context_book3s64.c | 10 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable-book3s64.c | 11 |
2 files changed, 8 insertions, 13 deletions
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c index b75194dff64c..87ee78973a35 100644 --- a/arch/powerpc/mm/mmu_context_book3s64.c +++ b/arch/powerpc/mm/mmu_context_book3s64.c @@ -159,9 +159,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) mm->context.id = index; -#ifdef CONFIG_PPC_64K_PAGES mm->context.pte_frag = NULL; -#endif #ifdef CONFIG_SPAPR_TCE_IOMMU mm_iommu_init(mm); #endif @@ -192,7 +190,6 @@ static void destroy_contexts(mm_context_t *ctx) spin_unlock(&mmu_context_lock); } -#ifdef CONFIG_PPC_64K_PAGES static void destroy_pagetable_page(struct mm_struct *mm) { int count; @@ -213,13 +210,6 @@ static void destroy_pagetable_page(struct mm_struct *mm) } } -#else -static inline void destroy_pagetable_page(struct mm_struct *mm) -{ - return; -} -#endif - void destroy_context(struct mm_struct *mm) { #ifdef CONFIG_SPAPR_TCE_IOMMU diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c index e4e1b2d4ca27..fc42cccb96c7 100644 --- a/arch/powerpc/mm/pgtable-book3s64.c +++ b/arch/powerpc/mm/pgtable-book3s64.c @@ -225,7 +225,7 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, asm volatile("eieio; tlbsync; ptesync" : : : "memory"); } EXPORT_SYMBOL_GPL(mmu_partition_table_set_entry); -#ifdef CONFIG_PPC_64K_PAGES + static pte_t *get_pte_from_cache(struct mm_struct *mm) { void *pte_frag, *ret; @@ -264,7 +264,14 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel) return NULL; } + ret = page_address(page); + /* + * if we support only one fragment just return the + * allocated page. + */ + if (PTE_FRAG_NR == 1) + return ret; spin_lock(&mm->page_table_lock); /* * If we find pgtable_page set, we return @@ -291,8 +298,6 @@ pte_t *pte_fragment_alloc(struct mm_struct *mm, unsigned long vmaddr, int kernel return __alloc_for_ptecache(mm, kernel); } -#endif /* CONFIG_PPC_64K_PAGES */ - void pte_fragment_free(unsigned long *table, int kernel) { struct page *page = virt_to_page(table); |