aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/pgtable.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2017-02-09 15:20:06 +0000
committerJames Hogan <james.hogan@imgtec.com>2017-02-13 18:57:31 +0000
commitf700a420088624671ed955bf818c17012bb57bca (patch)
treeedb0148c355db8c8f02b550181a250e94e8c93db /arch/mips/mm/pgtable.c
parent98e58b01e1671e5784c67972ec1b58a8997f784e (diff)
parent7170bdc777556dad87f92e6a73a6cc557bf3290e (diff)
downloadkernel_replicant_linux-f700a420088624671ed955bf818c17012bb57bca.tar.gz
kernel_replicant_linux-f700a420088624671ed955bf818c17012bb57bca.tar.bz2
kernel_replicant_linux-f700a420088624671ed955bf818c17012bb57bca.zip
Merge tag 'mips_kvm_4.11_1' into mips-for-linux-next
MIPS dependencies for KVM Miscellaneous MIPS architecture changes depended on by the MIPS KVM changes in the KVM tree. - Move pgd_alloc() out of header. - Exports so KVM can access page table management and TLBEX functions. - Add return errors to protected cache ops.
Diffstat (limited to 'arch/mips/mm/pgtable.c')
-rw-r--r--arch/mips/mm/pgtable.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
new file mode 100644
index 000000000000..05560b042d82
--- /dev/null
+++ b/arch/mips/mm/pgtable.c
@@ -0,0 +1,25 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/export.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <asm/pgalloc.h>
+
+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;
+}
+EXPORT_SYMBOL_GPL(pgd_alloc);