Lines Matching +full:elm +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-only
6 #include "iommu-pages.h"
7 #include <linux/dma-mapping.h>
11 #define IOPTDESC_MATCH(pg_elm, elm) \ argument
13 offsetof(struct ioptdesc, elm))
32 * iommu_alloc_pages_node_sz - Allocate a zeroed page of a given size from
34 * @nid: memory NUMA node id
71 iopt->incoherent = false; in iommu_alloc_pages_node_sz()
74 * All page allocations that should be reported to as "iommu-pagetables" in iommu_alloc_pages_node_sz()
76 * allocations of page-tables and other per-iommu_domain configuration in iommu_alloc_pages_node_sz()
96 WARN_ON_ONCE(iopt->incoherent); in __iommu_free_desc()
98 mod_node_page_state(folio_pgdat(folio), NR_IOMMU_PAGES, -pgcnt); in __iommu_free_desc()
99 lruvec_stat_mod_folio(folio, NR_SECONDARY_PAGETABLE, -pgcnt); in __iommu_free_desc()
104 * iommu_free_pages - free pages
118 * iommu_put_pages_list - free a list of pages.
129 list_for_each_entry_safe(iopt, tmp, &list->pages, iopt_freelist_elm) in iommu_put_pages_list()
135 * iommu_pages_start_incoherent - Setup the page for cache incoherent operation
151 if (WARN_ON(iopt->incoherent)) in iommu_pages_start_incoherent()
152 return -EINVAL; in iommu_pages_start_incoherent()
161 return -EINVAL; in iommu_pages_start_incoherent()
171 return -EOPNOTSUPP; in iommu_pages_start_incoherent()
175 iopt->incoherent = 1; in iommu_pages_start_incoherent()
181 * iommu_pages_start_incoherent_list - Make a list of pages incoherent
195 list_for_each_entry(cur, &list->pages, iopt_freelist_elm) { in iommu_pages_start_incoherent_list()
196 if (WARN_ON(cur->incoherent)) in iommu_pages_start_incoherent_list()
209 * iommu_pages_stop_incoherent_list - Undo incoherence across a list
222 list_for_each_entry(cur, &list->pages, iopt_freelist_elm) { in iommu_pages_stop_incoherent_list()
225 if (!cur->incoherent) in iommu_pages_stop_incoherent_list()
229 cur->incoherent = 0; in iommu_pages_stop_incoherent_list()
235 * iommu_pages_free_incoherent - Free an incoherent page
245 if (iopt->incoherent) { in iommu_pages_free_incoherent()
248 iopt->incoherent = 0; in iommu_pages_free_incoherent()