summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/pgalloc.h
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2017-02-02 02:21:35 +0100
committerJames Hogan <james.hogan@imgtec.com>2017-02-02 16:06:26 +0100
commit814f91bf3ea0962e4f802324766bf301ef6f5431 (patch)
treeb2bfe4ee5f1d342a674cbe4abb77ee12deddae63 /arch/mips/include/asm/pgalloc.h
parentLinux 4.10-rc2 (diff)
downloadlinux-814f91bf3ea0962e4f802324766bf301ef6f5431.tar.xz
linux-814f91bf3ea0962e4f802324766bf301ef6f5431.zip
MIPS: Move pgd_alloc() out of header
pgd_alloc() references init_mm which is not exported to modules. In order for KVM to be able to use pgd_alloc() to allocate GVA page tables, move pgd_alloc() into a new pgtable.c file and export it to modules. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: "Radim Krčmář" <rkrcmar@redhat.com> Cc: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org
Diffstat (limited to 'arch/mips/include/asm/pgalloc.h')
-rw-r--r--arch/mips/include/asm/pgalloc.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index a03e86969f78..a8705f6c8180 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -43,21 +43,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
* Initialize a new pgd / pmd table with invalid pointers.
*/
extern void pgd_init(unsigned long page);
-
-static inline pgd_t *pgd_alloc(struct mm_struct *mm)
-{
- pgd_t *ret, *init;
-
- ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
- if (ret) {
- init = pgd_offset(&init_mm, 0UL);
- pgd_init((unsigned long)ret);
- memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
- (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
- }
-
- return ret;
-}
+extern pgd_t *pgd_alloc(struct mm_struct *mm);
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
{