Skip to contentSkip to conversation

powerpc: implementation for arch_vma_access_permitted()

RFC Superseded Ram Pai 1 participant 1 message Jul 30, 2017 PowerPC

v7 of 14 Superseded Latest is v14 →

lore
Share & tools
lore

Ram Pai

author
#0 lore raw

RFC v7 19/25 powerpc: implementation for arch_vma_access_permitted()

This patch provides the implementation for arch_vma_access_permitted(). Returns true if the requested access is allowed by pkey associated with the vma.

---
 arch/powerpc/include/asm/mmu_context.h |    5 +++-
 arch/powerpc/mm/pkeys.c                |   43 ++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/mmu_context.h +4 -1
index 2eb7f80..a1cfcca 100644
@@ -175,6 +175,10 @@ static inline void arch_bprm_mm_init(struct mm_struct *mm,
 {
 }
 
+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS
+bool arch_vma_access_permitted(struct vm_area_struct *vma,
+			bool write, bool execute, bool foreign);
+#else /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */
 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
 		bool write, bool execute, bool foreign)
 {
@@ -182,7 +186,6 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
 	return true;
 }
 
-#ifndef CONFIG_PPC64_MEMORY_PROTECTION_KEYS
 #define pkey_initialize()
 #define pkey_mm_init(mm)
 
arch/powerpc/mm/pkeys.c +43 -0

46 lines not on this page · raw message

Signature · 1 line
1.7.1