Lines Matching refs:txwin
219 struct pseries_vas_window *txwin = data; in pseries_vas_fault_thread_fn() local
224 while (atomic_read(&txwin->pending_faults)) { in pseries_vas_fault_thread_fn()
225 rc = h_get_nx_fault(txwin->vas_win.winid, (u64)virt_to_phys(&crb)); in pseries_vas_fault_thread_fn()
227 tsk_ref = &txwin->vas_win.task_ref; in pseries_vas_fault_thread_fn()
231 atomic_dec(&txwin->pending_faults); in pseries_vas_fault_thread_fn()
248 struct pseries_vas_window *txwin = data; in pseries_vas_irq_handler() local
254 atomic_inc(&txwin->pending_faults); in pseries_vas_irq_handler()
262 static int allocate_setup_window(struct pseries_vas_window *txwin, in allocate_setup_window() argument
267 rc = h_allocate_vas_window(txwin, domain, wintype, DEF_WIN_CREDS); in allocate_setup_window()
275 txwin->fault_virq = irq_create_mapping(NULL, txwin->fault_irq); in allocate_setup_window()
276 if (!txwin->fault_virq) { in allocate_setup_window()
277 pr_err("Failed irq mapping %d\n", txwin->fault_irq); in allocate_setup_window()
282 txwin->name = kasprintf(GFP_KERNEL, "vas-win-%d", in allocate_setup_window()
283 txwin->vas_win.winid); in allocate_setup_window()
284 if (!txwin->name) { in allocate_setup_window()
289 rc = request_threaded_irq(txwin->fault_virq, in allocate_setup_window()
292 txwin->name, txwin); in allocate_setup_window()
295 txwin->vas_win.winid, txwin->fault_virq, rc); in allocate_setup_window()
299 txwin->vas_win.wcreds_max = DEF_WIN_CREDS; in allocate_setup_window()
303 kfree(txwin->name); in allocate_setup_window()
305 irq_dispose_mapping(txwin->fault_virq); in allocate_setup_window()
307 h_deallocate_vas_window(txwin->vas_win.winid); in allocate_setup_window()
311 static inline void free_irq_setup(struct pseries_vas_window *txwin) in free_irq_setup() argument
313 free_irq(txwin->fault_virq, txwin); in free_irq_setup()
314 kfree(txwin->name); in free_irq_setup()
315 irq_dispose_mapping(txwin->fault_virq); in free_irq_setup()
324 struct pseries_vas_window *txwin; in vas_allocate_window() local
327 txwin = kzalloc(sizeof(*txwin), GFP_KERNEL); in vas_allocate_window()
328 if (!txwin) in vas_allocate_window()
390 txwin->pid = mfspr(SPRN_PID); in vas_allocate_window()
411 rc = allocate_setup_window(txwin, (u64 *)&domain[0], in vas_allocate_window()
424 rc = h_modify_vas_window(txwin); in vas_allocate_window()
426 rc = get_vas_user_win_ref(&txwin->vas_win.task_ref); in vas_allocate_window()
430 txwin->win_type = cop_feat_caps->win_type; in vas_allocate_window()
451 list_add(&txwin->win_list, &caps->list); in vas_allocate_window()
455 vas_user_win_add_mm_context(&txwin->vas_win.task_ref); in vas_allocate_window()
456 return &txwin->vas_win; in vas_allocate_window()
460 put_vas_user_win_ref(&txwin->vas_win.task_ref); in vas_allocate_window()
469 free_irq_setup(txwin); in vas_allocate_window()
470 h_deallocate_vas_window(txwin->vas_win.winid); in vas_allocate_window()
479 kfree(txwin); in vas_allocate_window()