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 <robin.murphy@arm.com> Acked-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/ad859ccc24720d72f8eafd03817c1fc11255ddc1.1668100209.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
committed by
Joerg Roedel
parent
8b35cdcf9b
commit
0a17bbab23
@@ -659,22 +659,22 @@ static void ipmmu_detach_device(struct iommu_domain *io_domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova,
|
static int ipmmu_map(struct iommu_domain *io_domain, unsigned long iova,
|
||||||
phys_addr_t paddr, size_t size, int prot, gfp_t gfp)
|
phys_addr_t paddr, size_t pgsize, size_t pgcount,
|
||||||
|
int prot, gfp_t gfp, size_t *mapped)
|
||||||
{
|
{
|
||||||
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
|
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
|
||||||
|
|
||||||
if (!domain)
|
return domain->iop->map_pages(domain->iop, iova, paddr, pgsize, pgcount,
|
||||||
return -ENODEV;
|
prot, gfp, mapped);
|
||||||
|
|
||||||
return domain->iop->map(domain->iop, iova, paddr, size, prot, gfp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t ipmmu_unmap(struct iommu_domain *io_domain, unsigned long iova,
|
static size_t ipmmu_unmap(struct iommu_domain *io_domain, unsigned long iova,
|
||||||
size_t size, struct iommu_iotlb_gather *gather)
|
size_t pgsize, size_t pgcount,
|
||||||
|
struct iommu_iotlb_gather *gather)
|
||||||
{
|
{
|
||||||
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
|
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
|
||||||
|
|
||||||
return domain->iop->unmap(domain->iop, iova, size, gather);
|
return domain->iop->unmap_pages(domain->iop, iova, pgsize, pgcount, gather);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipmmu_flush_iotlb_all(struct iommu_domain *io_domain)
|
static void ipmmu_flush_iotlb_all(struct iommu_domain *io_domain)
|
||||||
@@ -877,8 +877,8 @@ static const struct iommu_ops ipmmu_ops = {
|
|||||||
.default_domain_ops = &(const struct iommu_domain_ops) {
|
.default_domain_ops = &(const struct iommu_domain_ops) {
|
||||||
.attach_dev = ipmmu_attach_device,
|
.attach_dev = ipmmu_attach_device,
|
||||||
.detach_dev = ipmmu_detach_device,
|
.detach_dev = ipmmu_detach_device,
|
||||||
.map = ipmmu_map,
|
.map_pages = ipmmu_map,
|
||||||
.unmap = ipmmu_unmap,
|
.unmap_pages = ipmmu_unmap,
|
||||||
.flush_iotlb_all = ipmmu_flush_iotlb_all,
|
.flush_iotlb_all = ipmmu_flush_iotlb_all,
|
||||||
.iotlb_sync = ipmmu_iotlb_sync,
|
.iotlb_sync = ipmmu_iotlb_sync,
|
||||||
.iova_to_phys = ipmmu_iova_to_phys,
|
.iova_to_phys = ipmmu_iova_to_phys,
|
||||||
|
Reference in New Issue
Block a user