Skip to content

Commit 0a17bba

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/ipmmu-vmsa: Update to {map,unmap}_pages
Update map/unmap to the new multi-page interfaces, which is dead easy since we just pass them through to io-pgtable anyway. Since these are domain ops now, the domain is inherently valid (not to mention that container_of() wouldn't return NULL anyway), so garbage-collect that check in the process. Signed-off-by: Robin Murphy <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/ad859ccc24720d72f8eafd03817c1fc11255ddc1.1668100209.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 8b35cdc commit 0a17bba

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/iommu/ipmmu-vmsa.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -659,22 +659,22 @@ static void ipmmu_detach_device(struct iommu_domain *io_domain,
659659
}
660660

661661
static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova,
662-
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
662+
phys_addr_t paddr, size_t pgsize, size_t pgcount,
663+
int prot, gfp_t gfp, size_t *mapped)
663664
{
664665
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
665666

666-
if (!domain)
667-
return -ENODEV;
668-
669-
return domain->iop->map(domain->iop, iova, paddr, size, prot, gfp);
667+
return domain->iop->map_pages(domain->iop, iova, paddr, pgsize, pgcount,
668+
prot, gfp, mapped);
670669
}
671670

672671
static size_t ipmmu_unmap(struct iommu_domain *io_domain, unsigned long iova,
673-
size_t size, struct iommu_iotlb_gather *gather)
672+
size_t pgsize, size_t pgcount,
673+
struct iommu_iotlb_gather *gather)
674674
{
675675
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
676676

677-
return domain->iop->unmap(domain->iop, iova, size, gather);
677+
return domain->iop->unmap_pages(domain->iop, iova, pgsize, pgcount, gather);
678678
}
679679

680680
static void ipmmu_flush_iotlb_all(struct iommu_domain *io_domain)
@@ -877,8 +877,8 @@ static const struct iommu_ops ipmmu_ops = {
877877
.default_domain_ops = &(const struct iommu_domain_ops) {
878878
.attach_dev = ipmmu_attach_device,
879879
.detach_dev = ipmmu_detach_device,
880-
.map = ipmmu_map,
881-
.unmap = ipmmu_unmap,
880+
.map_pages = ipmmu_map,
881+
.unmap_pages = ipmmu_unmap,
882882
.flush_iotlb_all = ipmmu_flush_iotlb_all,
883883
.iotlb_sync = ipmmu_iotlb_sync,
884884
.iova_to_phys = ipmmu_iova_to_phys,

0 commit comments

Comments
 (0)