Lines Matching refs:gms
158 void gru_flush_tlb_range(struct gru_mm_struct *gms, unsigned long start,
174 gru_dbg(grudev, "gms %p, start 0x%lx, len 0x%lx, asidmap 0x%lx\n", gms,
175 start, len, gms->ms_asidmap[0]);
177 spin_lock(&gms->ms_asid_lock);
178 for_each_gru_in_bitmap(gid, gms->ms_asidmap) {
181 asids = gms->ms_asids + gid;
196 __clear_bit(gru->gs_gid, gms->ms_asidmap);
200 gms->ms_asidmap[0]);
203 spin_unlock(&gms->ms_asid_lock);
226 struct gru_mm_struct *gms = container_of(mn, struct gru_mm_struct,
230 atomic_inc(&gms->ms_range_active);
231 gru_dbg(grudev, "gms %p, start 0x%lx, end 0x%lx, act %d\n", gms,
232 start, end, atomic_read(&gms->ms_range_active));
233 gru_flush_tlb_range(gms, start, end - start);
240 struct gru_mm_struct *gms = container_of(mn, struct gru_mm_struct,
244 (void)atomic_dec_and_test(&gms->ms_range_active);
246 wake_up_all(&gms->ms_wait_queue);
247 gru_dbg(grudev, "gms %p, start 0x%lx, end 0x%lx\n", gms, start, end);
253 struct gru_mm_struct *gms = container_of(mn, struct gru_mm_struct,
257 gru_flush_tlb_range(gms, address, PAGE_SIZE);
258 gru_dbg(grudev, "gms %p, address 0x%lx\n", gms, address);
263 struct gru_mm_struct *gms = container_of(mn, struct gru_mm_struct,
266 gms->ms_released = 1;
267 gru_dbg(grudev, "gms %p\n", gms);
300 struct gru_mm_struct *gms;
306 gms = container_of(mn, struct gru_mm_struct, ms_notifier);
307 atomic_inc(&gms->ms_refcnt);
309 gms = kzalloc(sizeof(*gms), GFP_KERNEL);
310 if (gms) {
312 spin_lock_init(&gms->ms_asid_lock);
313 gms->ms_notifier.ops = &gru_mmuops;
314 atomic_set(&gms->ms_refcnt, 1);
315 init_waitqueue_head(&gms->ms_wait_queue);
316 err = __mmu_notifier_register(&gms->ms_notifier, current->mm);
321 gru_dbg(grudev, "gms %p, refcnt %d\n", gms,
322 atomic_read(&gms->ms_refcnt));
323 return gms;
325 kfree(gms);
329 void gru_drop_mmu_notifier(struct gru_mm_struct *gms)
331 gru_dbg(grudev, "gms %p, refcnt %d, released %d\n", gms,
332 atomic_read(&gms->ms_refcnt), gms->ms_released);
333 if (atomic_dec_return(&gms->ms_refcnt) == 0) {
334 if (!gms->ms_released)
335 mmu_notifier_unregister(&gms->ms_notifier, current->mm);
336 kfree(gms);