All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH trivial] iommu/amd: Do not allocate io_pgtable_ops for passthrough domain
@ 2023-01-05  9:17 Vasant Hegde
  2023-01-13 16:02 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Vasant Hegde @ 2023-01-05  9:17 UTC (permalink / raw)
  To: iommu, joro; +Cc: suravee.suthikulpanit, Vasant Hegde

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

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 drivers/iommu/amd/iommu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index acc5e5e4f9e2..5aa54249387e 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2079,6 +2079,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);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH trivial] iommu/amd: Do not allocate io_pgtable_ops for passthrough domain
  2023-01-05  9:17 [PATCH trivial] iommu/amd: Do not allocate io_pgtable_ops for passthrough domain Vasant Hegde
@ 2023-01-13 16:02 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2023-01-13 16:02 UTC (permalink / raw)
  To: Vasant Hegde; +Cc: iommu, suravee.suthikulpanit

On Thu, Jan 05, 2023 at 09:17:28AM +0000, Vasant Hegde wrote:
>  drivers/iommu/amd/iommu.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-13 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05  9:17 [PATCH trivial] iommu/amd: Do not allocate io_pgtable_ops for passthrough domain Vasant Hegde
2023-01-13 16:02 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.