diff options
Diffstat (limited to 'arch/powerpc/include/asm/mmu_context.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu_context.h | 32 |
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 | ||
22 | extern int isolate_lru_page(struct page *page); /* from internal.h */ | 22 | extern int isolate_lru_page(struct page *page); /* from internal.h */ |
23 | extern bool mm_iommu_preregistered(struct mm_struct *mm); | 23 | extern bool mm_iommu_preregistered(struct mm_struct *mm); |
24 | extern long mm_iommu_get(struct mm_struct *mm, | 24 | extern 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); |
27 | extern 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); | ||
27 | extern long mm_iommu_put(struct mm_struct *mm, | 30 | extern 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); |
29 | extern void mm_iommu_init(struct mm_struct *mm); | 32 | extern 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); |
33 | extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup_rm( | 36 | extern 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); |
35 | extern struct mm_iommu_table_group_mem_t *mm_iommu_find(struct mm_struct *mm, | 38 | extern 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); |
37 | extern long mm_iommu_ua_to_hpa(struct mm_iommu_table_group_mem_t *mem, | 40 | extern 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); |
39 | extern long mm_iommu_ua_to_hpa_rm(struct mm_iommu_table_group_mem_t *mem, | 42 | extern 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); |
41 | extern void mm_iommu_ua_mark_dirty_rm(struct mm_struct *mm, unsigned long ua); | 44 | extern void mm_iommu_ua_mark_dirty_rm(struct mm_struct *mm, unsigned long ua); |
45 | extern bool mm_iommu_is_devmem(struct mm_struct *mm, unsigned long hpa, | ||
46 | unsigned int pageshift, unsigned long *size); | ||
42 | extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem); | 47 | extern long mm_iommu_mapped_inc(struct mm_iommu_table_group_mem_t *mem); |
43 | extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem); | 48 | extern void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem); |
49 | #else | ||
50 | static 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 |
45 | extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm); | 56 | extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm); |
46 | extern void set_context(unsigned long id, pgd_t *pgd); | 57 | extern 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 | ||
220 | static 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 | ||
227 | static inline void arch_exit_mmap(struct mm_struct *mm) | 232 | static 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 |
248 | bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, | 253 | bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, |
249 | bool execute, bool foreign); | 254 | bool execute, bool foreign); |
255 | void arch_dup_pkeys(struct mm_struct *oldmm, struct mm_struct *mm); | ||
250 | #else /* CONFIG_PPC_MEM_KEYS */ | 256 | #else /* CONFIG_PPC_MEM_KEYS */ |
251 | static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, | 257 | static 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 | ||
263 | static inline u64 pte_to_hpte_pkey_bits(u64 pteflags) | 270 | static 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 | ||
277 | static 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 */ |