Lines Matching refs:mmn
117 void __scif_rma_destroy_tcw(struct scif_mmu_notif *mmn, in __scif_rma_destroy_tcw() argument
128 list_for_each_safe(item, tmp, &mmn->tc_reg_list) { in __scif_rma_destroy_tcw()
142 static void scif_rma_destroy_tcw(struct scif_mmu_notif *mmn, u64 start, u64 len) in scif_rma_destroy_tcw() argument
144 struct scif_endpt *ep = mmn->ep; in scif_rma_destroy_tcw()
147 __scif_rma_destroy_tcw(mmn, start, len); in scif_rma_destroy_tcw()
154 struct scif_mmu_notif *mmn; in scif_rma_destroy_tcw_ep() local
157 mmn = list_entry(item, struct scif_mmu_notif, list); in scif_rma_destroy_tcw_ep()
158 scif_rma_destroy_tcw(mmn, 0, ULONG_MAX); in scif_rma_destroy_tcw_ep()
165 struct scif_mmu_notif *mmn; in __scif_rma_destroy_tcw_ep() local
169 mmn = list_entry(item, struct scif_mmu_notif, list); in __scif_rma_destroy_tcw_ep()
170 __scif_rma_destroy_tcw(mmn, 0, ULONG_MAX); in __scif_rma_destroy_tcw_ep()
196 struct scif_mmu_notif *mmn; in scif_mmu_notifier_release() local
198 mmn = container_of(mn, struct scif_mmu_notif, ep_mmu_notifier); in scif_mmu_notifier_release()
199 scif_rma_destroy_tcw(mmn, 0, ULONG_MAX); in scif_mmu_notifier_release()
209 struct scif_mmu_notif *mmn; in scif_mmu_notifier_invalidate_range_start() local
211 mmn = container_of(mn, struct scif_mmu_notif, ep_mmu_notifier); in scif_mmu_notifier_invalidate_range_start()
212 scif_rma_destroy_tcw(mmn, start, end - start); in scif_mmu_notifier_invalidate_range_start()
237 struct scif_mmu_notif *mmn = NULL; in scif_ep_unregister_mmu_notifier() local
242 mmn = list_entry(item, struct scif_mmu_notif, list); in scif_ep_unregister_mmu_notifier()
243 mmu_notifier_unregister(&mmn->ep_mmu_notifier, mmn->mm); in scif_ep_unregister_mmu_notifier()
245 kfree(mmn); in scif_ep_unregister_mmu_notifier()
250 static void scif_init_mmu_notifier(struct scif_mmu_notif *mmn, in scif_init_mmu_notifier() argument
253 mmn->ep = ep; in scif_init_mmu_notifier()
254 mmn->mm = mm; in scif_init_mmu_notifier()
255 mmn->ep_mmu_notifier.ops = &scif_mmu_notifier_ops; in scif_init_mmu_notifier()
256 INIT_LIST_HEAD(&mmn->list); in scif_init_mmu_notifier()
257 INIT_LIST_HEAD(&mmn->tc_reg_list); in scif_init_mmu_notifier()
263 struct scif_mmu_notif *mmn; in scif_find_mmu_notifier() local
265 list_for_each_entry(mmn, &rma->mmn_list, list) in scif_find_mmu_notifier()
266 if (mmn->mm == mm) in scif_find_mmu_notifier()
267 return mmn; in scif_find_mmu_notifier()
274 struct scif_mmu_notif *mmn in scif_add_mmu_notifier() local
275 = kzalloc(sizeof(*mmn), GFP_KERNEL); in scif_add_mmu_notifier()
277 if (!mmn) in scif_add_mmu_notifier()
280 scif_init_mmu_notifier(mmn, current->mm, ep); in scif_add_mmu_notifier()
281 if (mmu_notifier_register(&mmn->ep_mmu_notifier, current->mm)) { in scif_add_mmu_notifier()
282 kfree(mmn); in scif_add_mmu_notifier()
285 list_add(&mmn->list, &ep->rma_info.mmn_list); in scif_add_mmu_notifier()
286 return mmn; in scif_add_mmu_notifier()
1668 struct scif_mmu_notif *mmn = NULL; in scif_rma_copy() local
1712 mmn = scif_find_mmu_notifier(current->mm, &ep->rma_info); in scif_rma_copy()
1713 if (!mmn) in scif_rma_copy()
1714 mmn = scif_add_mmu_notifier(current->mm, ep); in scif_rma_copy()
1716 if (IS_ERR(mmn)) { in scif_rma_copy()
1718 return PTR_ERR(mmn); in scif_rma_copy()
1731 if (mmn) { in scif_rma_copy()
1733 req.head = &mmn->tc_reg_list; in scif_rma_copy()
1737 if (!mmn || err) { in scif_rma_copy()
1750 if (mmn) { in scif_rma_copy()
1753 &mmn->tc_reg_list); in scif_rma_copy()