git: a408ed1c928a - stable/13 - iommu_gas: Eliminate unnecessary wrappers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Jul 2022 17:11:30 UTC
The branch stable/13 has been updated by dougm:
URL: https://cgit.FreeBSD.org/src/commit/?id=a408ed1c928a9f68637672bc4a9cc05a296bf21a
commit a408ed1c928a9f68637672bc4a9cc05a296bf21a
Author: Alan Cox <alc@FreeBSD.org>
AuthorDate: 2022-06-14 19:01:36 +0000
Commit: Doug Moore <dougm@FreeBSD.org>
CommitDate: 2022-07-06 17:10:52 +0000
iommu_gas: Eliminate unnecessary wrappers
Eliminate trivial wrappers for several iommu_gas functions that serve
no functional purpose.
Reviewed by: br, dougm, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35487
(cherry picked from commit fc2e4f15a9047bbf546cd675ed590b88e54362bd)
---
sys/dev/iommu/busdma_iommu.c | 8 ++++----
sys/dev/iommu/iommu.h | 8 --------
sys/dev/iommu/iommu_gas.c | 41 -----------------------------------------
3 files changed, 4 insertions(+), 53 deletions(-)
diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
index 81d9e6ab969a..a8ba98469345 100644
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -593,7 +593,7 @@ iommu_bus_dmamap_load_something1(struct bus_dma_tag_iommu *tag,
if (seg + 1 < tag->common.nsegments)
gas_flags |= IOMMU_MF_CANSPLIT;
- error = iommu_map(domain, &tag->common, buflen1,
+ error = iommu_gas_map(domain, &tag->common, buflen1,
offset, e_flags, gas_flags, ma + idx, &entry);
if (error != 0)
break;
@@ -1025,7 +1025,7 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1,
map = (struct bus_dmamap_iommu *)map1;
waitok = (flags & BUS_DMA_NOWAIT) != 0;
- entry = iommu_map_alloc_entry(domain, waitok ? 0 : IOMMU_PGF_WAITOK);
+ entry = iommu_gas_alloc_entry(domain, waitok ? 0 : IOMMU_PGF_WAITOK);
if (entry == NULL)
return (ENOMEM);
entry->start = start;
@@ -1033,14 +1033,14 @@ bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1,
ma = malloc(sizeof(vm_page_t) * atop(length), M_TEMP, waitok ?
M_WAITOK : M_NOWAIT);
if (ma == NULL) {
- iommu_map_free_entry(domain, entry);
+ iommu_gas_free_entry(domain, entry);
return (ENOMEM);
}
for (i = 0; i < atop(length); i++) {
ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i,
VM_MEMATTR_DEFAULT);
}
- error = iommu_map_region(domain, entry, IOMMU_MAP_ENTRY_READ |
+ error = iommu_gas_map_region(domain, entry, IOMMU_MAP_ENTRY_READ |
((flags & BUS_DMA_NOWRITE) ? 0 : IOMMU_MAP_ENTRY_WRITE),
waitok ? IOMMU_MF_CANWAIT : 0, ma);
if (error == 0) {
diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h
index dd803e84c2ee..9ef3a6470331 100644
--- a/sys/dev/iommu/iommu.h
+++ b/sys/dev/iommu/iommu.h
@@ -172,14 +172,6 @@ struct iommu_ctx *iommu_instantiate_ctx(struct iommu_unit *iommu,
device_t iommu_get_requester(device_t dev, uint16_t *rid);
int iommu_init_busdma(struct iommu_unit *unit);
void iommu_fini_busdma(struct iommu_unit *unit);
-struct iommu_map_entry *iommu_map_alloc_entry(struct iommu_domain *iodom,
- u_int flags);
-void iommu_map_free_entry(struct iommu_domain *, struct iommu_map_entry *);
-int iommu_map(struct iommu_domain *iodom,
- const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset,
- u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res);
-int iommu_map_region(struct iommu_domain *domain,
- struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma);
void iommu_gas_init_domain(struct iommu_domain *domain);
void iommu_gas_fini_domain(struct iommu_domain *domain);
diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index b6594af80cb9..a14f386c7c54 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -798,36 +798,6 @@ iommu_gas_reserve_region_extend(struct iommu_domain *domain,
return (error);
}
-struct iommu_map_entry *
-iommu_map_alloc_entry(struct iommu_domain *domain, u_int flags)
-{
- struct iommu_map_entry *res;
-
- res = iommu_gas_alloc_entry(domain, flags);
-
- return (res);
-}
-
-void
-iommu_map_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry)
-{
-
- iommu_gas_free_entry(domain, entry);
-}
-
-int
-iommu_map(struct iommu_domain *domain,
- const struct bus_dma_tag_common *common, iommu_gaddr_t size, int offset,
- u_int eflags, u_int flags, vm_page_t *ma, struct iommu_map_entry **res)
-{
- int error;
-
- error = iommu_gas_map(domain, common, size, offset, eflags, flags,
- ma, res);
-
- return (error);
-}
-
void
iommu_unmap_msi(struct iommu_ctx *ctx)
{
@@ -916,17 +886,6 @@ iommu_translate_msi(struct iommu_domain *domain, uint64_t *addr)
__func__, (uintmax_t)*addr, (uintmax_t)domain->msi_entry->end));
}
-int
-iommu_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry,
- u_int eflags, u_int flags, vm_page_t *ma)
-{
- int error;
-
- error = iommu_gas_map_region(domain, entry, eflags, flags, ma);
-
- return (error);
-}
-
SYSCTL_NODE(_hw, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "");
#ifdef INVARIANTS