summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/book3s
diff options
context:
space:
mode:
authorChristophe Leroy2019-04-26 07:59:45 +0200
committerMichael Ellerman2019-05-02 17:20:23 +0200
commit5fb84fec46015758271fcd2a746633fd4d48e619 (patch)
treec7c1f065d11ca0c65d1d706116153ece13b3c61d /arch/powerpc/include/asm/book3s
parentpowerpc/mm: split asm/hugetlb.h into dedicated subarch files (diff)
downloadkernel-qcow2-linux-5fb84fec46015758271fcd2a746633fd4d48e619.tar.gz
kernel-qcow2-linux-5fb84fec46015758271fcd2a746633fd4d48e619.tar.xz
kernel-qcow2-linux-5fb84fec46015758271fcd2a746633fd4d48e619.zip
powerpc/mm: add a helper to populate hugepd
This patchs adds a subarch helper to populate hugepd. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/book3s')
-rw-r--r--arch/powerpc/include/asm/book3s/64/hugetlb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/include/asm/book3s/64/hugetlb.h
index cbc8153d6e0e..def77a45e905 100644
--- a/arch/powerpc/include/asm/book3s/64/hugetlb.h
+++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h
@@ -100,6 +100,11 @@ static inline pte_t *hugepte_offset(hugepd_t hpd, unsigned long addr,
return hugepd_page(hpd) + idx;
}
+static inline void hugepd_populate(hugepd_t *hpdp, pte_t *new, unsigned int pshift)
+{
+ *hpdp = __hugepd(__pa(new) | HUGEPD_VAL_BITS | (shift_to_mmu_psize(pshift) << 2));
+}
+
void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
#endif