Commit dbec10e5 authored by Michael Ellerman's avatar Michael Ellerman

mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h

Consolidate the pkey handling by providing a common empty definition
of vma_pkey() in pkeys.h when CONFIG_ARCH_HAS_PKEYS=n.

This also removes another entanglement of pkeys.h and
asm/mmu_context.h.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarRam Pai <linuxram@us.ibm.com>
Reviewed-by: default avatarDave Hansen <dave.hansen@intel.com>
parent cd419a51
...@@ -250,11 +250,6 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, ...@@ -250,11 +250,6 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
#define thread_pkey_regs_restore(new_thread, old_thread) #define thread_pkey_regs_restore(new_thread, old_thread)
#define thread_pkey_regs_init(thread) #define thread_pkey_regs_init(thread)
static inline int vma_pkey(struct vm_area_struct *vma)
{
return 0;
}
static inline u64 pte_to_hpte_pkey_bits(u64 pteflags) static inline u64 pte_to_hpte_pkey_bits(u64 pteflags)
{ {
return 0x0UL; return 0x0UL;
......
...@@ -296,11 +296,6 @@ static inline int vma_pkey(struct vm_area_struct *vma) ...@@ -296,11 +296,6 @@ static inline int vma_pkey(struct vm_area_struct *vma)
return (vma->vm_flags & vma_pkey_mask) >> VM_PKEY_SHIFT; return (vma->vm_flags & vma_pkey_mask) >> VM_PKEY_SHIFT;
} }
#else
static inline int vma_pkey(struct vm_area_struct *vma)
{
return 0;
}
#endif #endif
/* /*
......
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
#define PKEY_DEDICATED_EXECUTE_ONLY 0 #define PKEY_DEDICATED_EXECUTE_ONLY 0
#define ARCH_VM_PKEY_FLAGS 0 #define ARCH_VM_PKEY_FLAGS 0
static inline int vma_pkey(struct vm_area_struct *vma)
{
return 0;
}
static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
{ {
return (pkey == 0); return (pkey == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment