Lines Matching refs:pinned_pages
324 struct scif_pinned_pages *pinned_pages = window->pinned_pages; in scif_destroy_window() local
340 j = atomic_sub_return(1, &pinned_pages->ref_count); in scif_destroy_window()
351 scif_destroy_pinned_pages(window->pinned_pages); in scif_destroy_window()
547 scif_pinned_pages_t pin = window->pinned_pages; in scif_iommu_map()
600 pin = window->pinned_pages; in scif_map_window()
734 if ((!!(window->pinned_pages->map_flags & SCIF_MAP_KERNEL)) && in scif_unregister_window()
1328 struct scif_pinned_pages *pinned_pages; in __scif_pin_pages() local
1356 pinned_pages = scif_create_pinned_pages(nr_pages, prot); in __scif_pin_pages()
1357 if (!pinned_pages) in __scif_pin_pages()
1366 pinned_pages->pages[i] = in __scif_pin_pages()
1369 pinned_pages->pages[i] = in __scif_pin_pages()
1372 pinned_pages->nr_pages = nr_pages; in __scif_pin_pages()
1373 pinned_pages->map_flags = SCIF_MAP_KERNEL; in __scif_pin_pages()
1393 pinned_pages->nr_pages = 0; in __scif_pin_pages()
1398 pinned_pages->nr_pages = get_user_pages( in __scif_pin_pages()
1402 pinned_pages->pages, in __scif_pin_pages()
1405 if (nr_pages != pinned_pages->nr_pages) { in __scif_pin_pages()
1406 if (pinned_pages->nr_pages < 0) in __scif_pin_pages()
1407 pinned_pages->nr_pages = 0; in __scif_pin_pages()
1413 for (i = 0; i < pinned_pages->nr_pages; i++) { in __scif_pin_pages()
1414 if (pinned_pages->pages[i]) in __scif_pin_pages()
1416 pinned_pages->pages[i]); in __scif_pin_pages()
1423 pinned_pages->map_flags = 0; in __scif_pin_pages()
1426 if (pinned_pages->nr_pages < nr_pages) { in __scif_pin_pages()
1432 atomic_set(&pinned_pages->ref_count, 1); in __scif_pin_pages()
1433 *pages = pinned_pages; in __scif_pin_pages()
1440 scif_destroy_pinned_pages(pinned_pages); in __scif_pin_pages()
1454 int scif_unpin_pages(scif_pinned_pages_t pinned_pages) in scif_unpin_pages() argument
1458 if (!pinned_pages || SCIFEP_MAGIC != pinned_pages->magic) in scif_unpin_pages()
1461 ret = atomic_sub_return(1, &pinned_pages->ref_count); in scif_unpin_pages()
1475 err = scif_destroy_pinned_pages(pinned_pages); in scif_unpin_pages()
1490 scif_pinned_pages_t pinned_pages, in scif_register_pinned_pages() argument
1504 len = pinned_pages->nr_pages << PAGE_SHIFT; in scif_register_pinned_pages()
1525 if (!atomic_add_unless(&pinned_pages->ref_count, 1, 0)) in scif_register_pinned_pages()
1532 atomic_sub(1, &pinned_pages->ref_count); in scif_register_pinned_pages()
1537 window = scif_create_window(ep, pinned_pages->nr_pages, in scif_register_pinned_pages()
1540 atomic_sub(1, &pinned_pages->ref_count); in scif_register_pinned_pages()
1545 window->pinned_pages = pinned_pages; in scif_register_pinned_pages()
1546 window->nr_pages = pinned_pages->nr_pages; in scif_register_pinned_pages()
1547 window->prot = pinned_pages->prot; in scif_register_pinned_pages()
1594 scif_pinned_pages_t pinned_pages; in scif_register() local
1671 &pinned_pages); in scif_register()
1678 window->pinned_pages = pinned_pages; in scif_register()
1679 window->prot = pinned_pages->prot; in scif_register()