Lines Matching refs:pages

23 	struct iopt_pages *pages;
42 if (!iter->area->pages) {
65 !iter->area->pages) {
187 * The area takes a slice of the pages from start_bytes to start_byte + length
190 struct iopt_pages *pages, unsigned long iova,
196 if ((iommu_prot & IOMMU_WRITE) && !pages->writable)
212 if (WARN_ON(area->pages_node.last >= pages->npages))
216 * The area is inserted with a NULL pages indicating it is not fully
263 (uintptr_t)elm->pages->uptr + elm->start_byte, length);
278 * Areas are created with a NULL pages so that the IOVA space is
283 rc = iopt_insert_area(iopt, elm->area, elm->pages, iova,
298 WARN_ON(area->pages);
315 if (elm->pages)
316 iopt_put_pages(elm->pages);
329 rc = iopt_area_fill_domains(elm->area, elm->pages);
339 iopt_area_unfill_domains(undo_elm->area, undo_elm->pages);
364 * area->pages must be set inside the domains_rwsem to ensure
368 elm->area->pages = elm->pages;
369 elm->pages = NULL;
390 * page tables this will pin the pages and load them into the domain at iova.
406 elm.pages = iopt_alloc_pages(uptr, length, iommu_prot & IOMMU_WRITE);
407 if (IS_ERR(elm.pages))
408 return PTR_ERR(elm.pages);
410 elm.pages->account_mode == IOPT_PAGES_ACCOUNT_USER)
411 elm.pages->account_mode = IOPT_PAGES_ACCOUNT_MM;
412 elm.start_byte = uptr - elm.pages->uptr;
420 if (elm.pages)
421 iopt_put_pages(elm.pages);
451 elm->pages = area->pages;
453 kref_get(&elm->pages->kref);
477 * The domains_rwsem must be held in read mode any time any area->pages
487 struct iopt_pages *pages;
490 if (!area->pages) {
506 * without the pages->mutex.
524 pages = area->pages;
525 area->pages = NULL;
528 iopt_area_unfill_domains(area, pages);
530 iopt_put_pages(pages);
715 struct iopt_pages *pages = area->pages;
717 if (!pages)
720 mutex_lock(&pages->mutex);
725 mutex_unlock(&pages->mutex);
734 struct iopt_pages *pages = area->pages;
736 if (!pages)
739 mutex_lock(&pages->mutex);
740 interval_tree_remove(&area->pages_node, &pages->domains_itree);
743 iopt_area_unfill_domain(area, pages, domain);
744 mutex_unlock(&pages->mutex);
768 struct iopt_pages *pages = area->pages;
770 if (!pages)
773 mutex_lock(&pages->mutex);
776 mutex_unlock(&pages->mutex);
783 &pages->domains_itree);
785 mutex_unlock(&pages->mutex);
793 struct iopt_pages *pages = area->pages;
797 if (!pages)
799 mutex_lock(&pages->mutex);
802 &pages->domains_itree);
805 iopt_area_unfill_domain(area, pages, domain);
806 mutex_unlock(&pages->mutex);
1003 struct iopt_pages *pages = area->pages;
1013 if (!pages || area->prevent_access)
1030 mutex_lock(&pages->mutex);
1042 * huge pages.
1050 rc = iopt_insert_area(iopt, lhs, area->pages, start_iova,
1057 rc = iopt_insert_area(iopt, rhs, area->pages, new_start,
1068 interval_tree_remove(&area->pages_node, &pages->domains_itree);
1069 interval_tree_insert(&lhs->pages_node, &pages->domains_itree);
1070 interval_tree_insert(&rhs->pages_node, &pages->domains_itree);
1074 lhs->pages = area->pages;
1076 rhs->pages = area->pages;
1077 kref_get(&rhs->pages->kref);
1079 mutex_unlock(&pages->mutex);
1082 * No change to domains or accesses because the pages hasn't been
1092 mutex_unlock(&pages->mutex);
1142 /* Won't do it if domains already have pages mapped in them */