Lines Matching refs:vinst
35 base = window->vinst->paste_base_addr; in vas_win_paste_addr()
36 shift = window->vinst->paste_win_id_shift; in vas_win_paste_addr()
51 pbaddr = window->vinst->hvwc_bar_start; in get_hvwc_mmio_bar()
61 pbaddr = window->vinst->uwc_bar_start; in get_uwc_mmio_bar()
78 name = kasprintf(GFP_KERNEL, "window-v%d-w%d", txwin->vinst->vas_id, in map_paste_region()
525 struct vas_instance *vinst = window->vinst; in vas_window_free() local
534 vas_release_window_id(&vinst->ida, winid); in vas_window_free()
537 static struct pnv_vas_window *vas_window_alloc(struct vas_instance *vinst) in vas_window_alloc() argument
542 winid = vas_assign_window_id(&vinst->ida); in vas_window_alloc()
550 window->vinst = vinst; in vas_window_alloc()
562 vas_release_window_id(&vinst->ida, winid); in vas_window_alloc()
582 static struct pnv_vas_window *get_user_rxwin(struct vas_instance *vinst, in get_user_rxwin() argument
590 if (vinst->vas_id != vasid) in get_user_rxwin()
593 rxwin = vinst->windows[winid]; in get_user_rxwin()
607 static struct pnv_vas_window *get_vinst_rxwin(struct vas_instance *vinst, in get_vinst_rxwin() argument
612 mutex_lock(&vinst->mutex); in get_vinst_rxwin()
615 rxwin = get_user_rxwin(vinst, pswid); in get_vinst_rxwin()
617 rxwin = vinst->rxwin[cop] ?: ERR_PTR(-EINVAL); in get_vinst_rxwin()
622 mutex_unlock(&vinst->mutex); in get_vinst_rxwin()
642 static void set_vinst_win(struct vas_instance *vinst, in set_vinst_win() argument
647 mutex_lock(&vinst->mutex); in set_vinst_win()
654 WARN_ON_ONCE(vinst->rxwin[window->vas_win.cop]); in set_vinst_win()
655 vinst->rxwin[window->vas_win.cop] = window; in set_vinst_win()
658 WARN_ON_ONCE(vinst->windows[id] != NULL); in set_vinst_win()
659 vinst->windows[id] = window; in set_vinst_win()
661 mutex_unlock(&vinst->mutex); in set_vinst_win()
671 struct vas_instance *vinst = window->vinst; in clear_vinst_win() local
673 mutex_lock(&vinst->mutex); in clear_vinst_win()
676 WARN_ON_ONCE(!vinst->rxwin[window->vas_win.cop]); in clear_vinst_win()
677 vinst->rxwin[window->vas_win.cop] = NULL; in clear_vinst_win()
680 WARN_ON_ONCE(vinst->windows[id] != window); in clear_vinst_win()
681 vinst->windows[id] = NULL; in clear_vinst_win()
683 mutex_unlock(&vinst->mutex); in clear_vinst_win()
754 if (rxwin->vinst->virq) in init_winctx_for_rxwin()
755 winctx->irq_port = rxwin->vinst->irq_port; in init_winctx_for_rxwin()
858 struct vas_instance *vinst; in vas_rx_win_open() local
865 vinst = find_vas_instance(vasid); in vas_rx_win_open()
866 if (!vinst) { in vas_rx_win_open()
872 rxwin = vas_window_alloc(vinst); in vas_rx_win_open()
887 set_vinst_win(vinst, rxwin); in vas_rx_win_open()
956 if (txwin->vinst->virq) in init_winctx_for_txwin()
957 winctx->fault_win_id = txwin->vinst->fault_win->vas_win.winid; in init_winctx_for_txwin()
963 if (txwin->vinst->virq) in init_winctx_for_txwin()
964 winctx->irq_port = txwin->vinst->irq_port; in init_winctx_for_txwin()
967 encode_pswid(txwin->vinst->vas_id, in init_winctx_for_txwin()
1002 struct vas_instance *vinst; in vas_tx_win_open() local
1017 vinst = find_vas_instance(vasid); in vas_tx_win_open()
1018 if (!vinst) { in vas_tx_win_open()
1023 rxwin = get_vinst_rxwin(vinst, cop, attr->pswid); in vas_tx_win_open()
1029 txwin = vas_window_alloc(vinst); in vas_tx_win_open()
1066 if (!vinst->virq) { in vas_tx_win_open()
1077 set_vinst_win(vinst, txwin); in vas_tx_win_open()
1361 struct pnv_vas_window *vas_pswid_to_window(struct vas_instance *vinst, in vas_pswid_to_window() argument
1386 window = vinst->windows[winid]; in vas_pswid_to_window()
1390 winid, pswid, vinst); in vas_pswid_to_window()