Lines Matching refs:mmn
122 void __scif_rma_destroy_tcw(struct scif_mmu_notif *mmn, in __scif_rma_destroy_tcw() argument
134 list_for_each_safe(item, tmp, &mmn->tc_reg_list) { in __scif_rma_destroy_tcw()
149 static void scif_rma_destroy_tcw(struct scif_mmu_notif *mmn, u64 start, u64 len) in scif_rma_destroy_tcw() argument
151 struct scif_endpt *ep = mmn->ep; in scif_rma_destroy_tcw()
154 __scif_rma_destroy_tcw(mmn, ep, start, len); in scif_rma_destroy_tcw()
161 struct scif_mmu_notif *mmn; in scif_rma_destroy_tcw_ep() local
164 mmn = list_entry(item, struct scif_mmu_notif, list); in scif_rma_destroy_tcw_ep()
165 scif_rma_destroy_tcw(mmn, 0, ULONG_MAX); in scif_rma_destroy_tcw_ep()
172 struct scif_mmu_notif *mmn; in __scif_rma_destroy_tcw_ep() local
176 mmn = list_entry(item, struct scif_mmu_notif, list); in __scif_rma_destroy_tcw_ep()
177 __scif_rma_destroy_tcw(mmn, ep, 0, ULONG_MAX); in __scif_rma_destroy_tcw_ep()
203 struct scif_mmu_notif *mmn; in scif_mmu_notifier_release() local
205 mmn = container_of(mn, struct scif_mmu_notif, ep_mmu_notifier); in scif_mmu_notifier_release()
206 scif_rma_destroy_tcw(mmn, 0, ULONG_MAX); in scif_mmu_notifier_release()
214 struct scif_mmu_notif *mmn; in scif_mmu_notifier_invalidate_page() local
216 mmn = container_of(mn, struct scif_mmu_notif, ep_mmu_notifier); in scif_mmu_notifier_invalidate_page()
217 scif_rma_destroy_tcw(mmn, address, PAGE_SIZE); in scif_mmu_notifier_invalidate_page()
225 struct scif_mmu_notif *mmn; in scif_mmu_notifier_invalidate_range_start() local
227 mmn = container_of(mn, struct scif_mmu_notif, ep_mmu_notifier); in scif_mmu_notifier_invalidate_range_start()
228 scif_rma_destroy_tcw(mmn, start, end - start); in scif_mmu_notifier_invalidate_range_start()
252 struct scif_mmu_notif *mmn = NULL; in scif_ep_unregister_mmu_notifier() local
257 mmn = list_entry(item, struct scif_mmu_notif, list); in scif_ep_unregister_mmu_notifier()
258 mmu_notifier_unregister(&mmn->ep_mmu_notifier, mmn->mm); in scif_ep_unregister_mmu_notifier()
260 kfree(mmn); in scif_ep_unregister_mmu_notifier()
265 static void scif_init_mmu_notifier(struct scif_mmu_notif *mmn, in scif_init_mmu_notifier() argument
268 mmn->ep = ep; in scif_init_mmu_notifier()
269 mmn->mm = mm; in scif_init_mmu_notifier()
270 mmn->ep_mmu_notifier.ops = &scif_mmu_notifier_ops; in scif_init_mmu_notifier()
271 INIT_LIST_HEAD(&mmn->list); in scif_init_mmu_notifier()
272 INIT_LIST_HEAD(&mmn->tc_reg_list); in scif_init_mmu_notifier()
278 struct scif_mmu_notif *mmn; in scif_find_mmu_notifier() local
282 mmn = list_entry(item, struct scif_mmu_notif, list); in scif_find_mmu_notifier()
283 if (mmn->mm == mm) in scif_find_mmu_notifier()
284 return mmn; in scif_find_mmu_notifier()
292 struct scif_mmu_notif *mmn in scif_add_mmu_notifier() local
293 = kzalloc(sizeof(*mmn), GFP_KERNEL); in scif_add_mmu_notifier()
295 if (!mmn) in scif_add_mmu_notifier()
298 scif_init_mmu_notifier(mmn, current->mm, ep); in scif_add_mmu_notifier()
299 if (mmu_notifier_register(&mmn->ep_mmu_notifier, in scif_add_mmu_notifier()
301 kfree(mmn); in scif_add_mmu_notifier()
304 list_add(&mmn->list, &ep->rma_info.mmn_list); in scif_add_mmu_notifier()
305 return mmn; in scif_add_mmu_notifier()
1687 struct scif_mmu_notif *mmn = NULL; in scif_rma_copy() local
1731 mmn = scif_find_mmu_notifier(current->mm, &ep->rma_info); in scif_rma_copy()
1732 if (!mmn) in scif_rma_copy()
1735 if (IS_ERR(mmn)) { in scif_rma_copy()
1737 return PTR_ERR(mmn); in scif_rma_copy()
1750 if (mmn) { in scif_rma_copy()
1752 req.head = &mmn->tc_reg_list; in scif_rma_copy()
1756 if (!mmn || err) { in scif_rma_copy()
1769 if (mmn) { in scif_rma_copy()
1772 &mmn->tc_reg_list); in scif_rma_copy()