summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/mmu.h
diff options
context:
space:
mode:
authorRam Pai2018-01-19 02:50:41 +0100
committerMichael Ellerman2018-01-20 12:59:05 +0100
commit087003e9ef7c1c5bec932387e47511429eff2a54 (patch)
treefcd8cdc6a20be99816dcf9741b26215c1a69f27d /arch/powerpc/include/asm/mmu.h
parentpowerpc: Handle exceptions caused by pkey violation (diff)
downloadkernel-qcow2-linux-087003e9ef7c1c5bec932387e47511429eff2a54.tar.gz
kernel-qcow2-linux-087003e9ef7c1c5bec932387e47511429eff2a54.tar.xz
kernel-qcow2-linux-087003e9ef7c1c5bec932387e47511429eff2a54.zip
powerpc: introduce get_mm_addr_key() helper
get_mm_addr_key() helper returns the pkey associated with an address corresponding to a given mm_struct. Signed-off-by: Ram Pai <linuxram@us.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/mmu.h')
-rw-r--r--arch/powerpc/include/asm/mmu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 6364f5c2cc3e..bb38312cff28 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -260,6 +260,15 @@ static inline bool early_radix_enabled(void)
}
#endif
+#ifdef CONFIG_PPC_MEM_KEYS
+extern u16 get_mm_addr_key(struct mm_struct *mm, unsigned long address);
+#else
+static inline u16 get_mm_addr_key(struct mm_struct *mm, unsigned long address)
+{
+ return 0;
+}
+#endif /* CONFIG_PPC_MEM_KEYS */
+
#endif /* !__ASSEMBLY__ */
/* The kernel use the constants below to index in the page sizes array.