diff options
author | 2025-05-12 07:14:50 +0000 | |
---|---|---|
committer | 2025-05-23 07:05:50 +0200 | |
commit | 406251a408f51a5ff1b7d41a1d590b35aff5b0fa (patch) | |
tree | d716f298306265b38a75425765f58ac306849669 | |
parent | Linux 6.15-rc7 (diff) | |
download | wireguard-linux-406251a408f51a5ff1b7d41a1d590b35aff5b0fa.tar.xz wireguard-linux-406251a408f51a5ff1b7d41a1d590b35aff5b0fa.zip |
xen: swiotlb: Wire up map_resource callback
When running Xen on iMX8QXP, an Arm SoC without IOMMU, DMA performed via
its eDMA v3 DMA engine fail with a mapping error.
The eDMA performs DMA between RAM and MMIO space, and it's the MMIO side
that cannot be mapped.
MMIO->RAM DMA access cannot be bounce buffered if it would straddle a page
boundary and on Xen the MMIO space is 1:1 mapped for Arm, and x86 PV Dom0.
Cases where MMIO space is not 1:1 mapped, such as x86 PVH Dom0, requires an
IOMMU present to deal with the mapping.
Considering the above the map_resource callback can just be wired to the
existing dma_direct_map_resource() function.
There is nothing to do for unmap so the unmap callback is not needed.
Signed-off-by: John Ernberg <john.ernberg@actia.se>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <20250512071440.3726697-1-john.ernberg@actia.se>
Signed-off-by: Juergen Gross <jgross@suse.com>
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index ef56a2500ed6..da1a7d3d377c 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -426,4 +426,5 @@ const struct dma_map_ops xen_swiotlb_dma_ops = { .alloc_pages_op = dma_common_alloc_pages, .free_pages = dma_common_free_pages, .max_mapping_size = swiotlb_max_mapping_size, + .map_resource = dma_direct_map_resource, }; |