aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/mmu_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/mmu_context.h')
-rw-r--r--arch/powerpc/include/asm/mmu_context.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
index 0381394a425b..6ee8195a2ffb 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -21,9 +21,12 @@ struct mm_iommu_table_group_mem_t;
21 21
22extern int isolate_lru_page(struct page *page); /* from internal.h */ 22extern int isolate_lru_page(struct page *page); /* from internal.h */
23extern bool mm_iommu_preregistered(struct mm_struct *mm); 23extern bool mm_iommu_preregistered(struct mm_struct *mm);
24extern long mm_iommu_get(struct mm_struct *mm, 24extern long mm_iommu_new(struct mm_struct *mm,
25 unsigned long ua, unsigned long entries, 25 unsigned long ua, unsigned long entries,
26 struct mm_iommu_table_group_mem_t **pmem); 26 struct mm_iommu_table_group_mem_t **pmem);
27extern long mm_iommu_newdev(struct mm_struct *mm, unsigned long ua,
28 unsigned long entries, unsigned long dev_hpa,
29 struct mm_iommu_table_group_mem_t **pmem);
27extern long mm_iommu_put(struct mm_struct *mm, 30extern long mm_iommu_put(struct mm_struct *mm,
28 struct mm_iommu_table_group_mem_t *mem); 31 struct mm_iommu_table_group_mem_t *mem);
29extern void mm_iommu_init(struct mm_struct *mm); 32extern void mm_iommu_init(struct mm_struct *mm);
@@ -32,15 +35,23 @@ extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(struct mm_struct *mm,
32 unsigned long ua, unsigned long size); 35 unsigned long ua, unsigned long size);
33extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup_rm( 36extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup_rm(
34 struct mm_struct *mm, unsigned long ua, unsigned long size); 37 struct mm_struct *mm, unsigned long ua, unsigned long size);
35extern struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm, 38extern struct mm_iommu_table_group_mem_t *mm_iommu_get(struct mm_struct *mm,
36 unsigned long ua, unsigned long entries); 39 unsigned long ua, unsigned long entries);
37extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem, 40extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem,
38 unsigned long ua, unsigned int pageshift, unsigned long *hpa); 41 unsigned long ua, unsigned int pageshift, unsigned long *hpa);
39extern long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem, 42extern long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem,
40 unsigned long ua, unsigned int pageshift, unsigned long *hpa); 43 unsigned long ua, unsigned int pageshift, unsigned long *hpa);
41extern void mm_iommu_ua_mark_dirty_rm(struct mm_struct *mm, unsigned long ua); 44extern void mm_iommu_ua_mark_dirty_rm(struct mm_struct *mm, unsigned long ua);
45extern bool mm_iommu_is_devmem(struct mm_struct *mm, unsigned long hpa,
46 unsigned int pageshift, unsigned long *size);
42extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem); 47extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem);
43extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem); 48extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem);
49#else
50static inline bool mm_iommu_is_devmem(struct mm_struct *mm, unsigned long hpa,
51 unsigned int pageshift, unsigned long *size)
52{
53 return false;
54}
44#endif 55#endif
45extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm); 56extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm);
46extern void set_context(unsigned long id, pgd_t *pgd); 57extern void set_context(unsigned long id, pgd_t *pgd);
@@ -217,13 +228,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
217#endif 228#endif
218} 229}
219 230
220static inline int arch_dup_mmap(struct mm_struct *oldmm, 231#ifdef CONFIG_PPC_BOOK3E_64
221 struct mm_struct *mm)
222{
223 return 0;
224}
225
226#ifndef CONFIG_PPC_BOOK3S_64
227static inline void arch_exit_mmap(struct mm_struct *mm) 232static inline void arch_exit_mmap(struct mm_struct *mm)
228{ 233{
229} 234}
@@ -247,6 +252,7 @@ static inline void arch_bprm_mm_init(struct mm_struct *mm,
247#ifdef CONFIG_PPC_MEM_KEYS 252#ifdef CONFIG_PPC_MEM_KEYS
248bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, 253bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write,
249 bool execute, bool foreign); 254 bool execute, bool foreign);
255void arch_dup_pkeys(struct mm_struct *oldmm, struct mm_struct *mm);
250#else /* CONFIG_PPC_MEM_KEYS */ 256#else /* CONFIG_PPC_MEM_KEYS */
251static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, 257static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
252 bool write, bool execute, bool foreign) 258 bool write, bool execute, bool foreign)
@@ -259,6 +265,7 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
259#define thread_pkey_regs_save(thread) 265#define thread_pkey_regs_save(thread)
260#define thread_pkey_regs_restore(new_thread, old_thread) 266#define thread_pkey_regs_restore(new_thread, old_thread)
261#define thread_pkey_regs_init(thread) 267#define thread_pkey_regs_init(thread)
268#define arch_dup_pkeys(oldmm, mm)
262 269
263static inline u64 pte_to_hpte_pkey_bits(u64 pteflags) 270static inline u64 pte_to_hpte_pkey_bits(u64 pteflags)
264{ 271{
@@ -267,5 +274,12 @@ static inline u64 pte_to_hpte_pkey_bits(u64 pteflags)
267 274
268#endif /* CONFIG_PPC_MEM_KEYS */ 275#endif /* CONFIG_PPC_MEM_KEYS */
269 276
277static inline int arch_dup_mmap(struct mm_struct *oldmm,
278 struct mm_struct *mm)
279{
280 arch_dup_pkeys(oldmm, mm);
281 return 0;
282}
283
270#endif /* __KERNEL__ */ 284#endif /* __KERNEL__ */
271#endif /* __ASM_POWERPC_MMU_CONTEXT_H */ 285#endif /* __ASM_POWERPC_MMU_CONTEXT_H */