diff options
author | Daniel Silsby <dansilsby@gmail.com> | 2019-07-15 23:40:00 +0200 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-07-21 23:30:05 +0200 |
commit | 35476311e5292ae0ef00dde5c2cccbe8514660c2 (patch) | |
tree | 863d816617c01df4e798377b2e635d2ebc7a88ae /arch/mips/mm | |
parent | MIPS: Disallow CPU_SUPPORTS_HUGEPAGES for XPA,EVA (diff) | |
download | linux-35476311e5292ae0ef00dde5c2cccbe8514660c2.tar.xz linux-35476311e5292ae0ef00dde5c2cccbe8514660c2.zip |
MIPS: Add partial 32-bit huge page support
This adds initial support for huge pages to 32-bit MIPS systems.
Systems with extended addressing enabled (EVA,XPA,Alchemy/Netlogic)
are not yet supported.
With huge pages enabled, this implementation will increase page table
memory overhead to match that of a 64-bit MIPS system. However, the
cache-friendliness of page table walks is not affected significantly.
Signed-off-by: Daniel Silsby <dansilsby@gmail.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: od@zcrc.me
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/pgtable-32.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index e2a33adc0f29..6416a531a4c3 100644 --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c @@ -12,6 +12,7 @@ #include <asm/fixmap.h> #include <asm/pgtable.h> #include <asm/pgalloc.h> +#include <asm/tlbflush.h> void pgd_init(unsigned long page) { @@ -30,6 +31,25 @@ void pgd_init(unsigned long page) } } +#if defined(CONFIG_TRANSPARENT_HUGEPAGE) +pmd_t mk_pmd(struct page *page, pgprot_t prot) +{ + pmd_t pmd; + + pmd_val(pmd) = (page_to_pfn(page) << _PFN_SHIFT) | pgprot_val(prot); + + return pmd; +} + + +void set_pmd_at(struct mm_struct *mm, unsigned long addr, + pmd_t *pmdp, pmd_t pmd) +{ + *pmdp = pmd; + flush_tlb_all(); +} +#endif /* defined(CONFIG_TRANSPARENT_HUGEPAGE) */ + void __init pagetable_init(void) { unsigned long vaddr; |