Commit ba9bee7f authored by Vasant Hegde's avatar Vasant Hegde Committed by Joerg Roedel
Browse files

iommu/amd: Do not allocate io_pgtable_ops for passthrough domain



In passthrough mode we do not use IOMMU page table. Hence we don't need
to allocate io_pgtable_ops.

Signed-off-by: default avatarVasant Hegde <vasant.hegde@amd.com>
Reviewed-by: default avatarSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20230105091728.42469-1-vasant.hegde@amd.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent b7bfaa76
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2072,6 +2072,10 @@ static struct protection_domain *protection_domain_alloc(unsigned int type)
	if (ret)
		goto out_err;

	/* No need to allocate io pgtable ops in passthrough mode */
	if (type == IOMMU_DOMAIN_IDENTITY)
		return domain;

	pgtbl_ops = alloc_io_pgtable_ops(pgtable, &domain->iop.pgtbl_cfg, domain);
	if (!pgtbl_ops) {
		domain_id_free(domain->id);