mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Magnus Kalland <magnus@dolphinics.com>
To: vasant.hegde@amd.com, suravee.suthikulpanit@amd.com,
	joro@8bytes.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Cc: dhsrivas@amd.com, Magnus Kalland <magnus@dolphinics.com>
Subject: [PATCH v3 2/3] iommu/amd: Track PCIe DMA aliases in set_remap_table_entry_alias
Date: Wed, 25 Feb 2026 21:23:29 +0100	[thread overview]
Message-ID: <20260225202330.23027-3-magnus@dolphinics.com> (raw)
In-Reply-To: <20260225202330.23027-1-magnus@dolphinics.com>

Track PCIe DMA aliases in set_remap_table_entry_alias so that we can
iterate over shared IRTs by alias in iommu_flush_irt_for_aliases.

Signed-off-by: Magnus Kalland <magnus@dolphinics.com>

---
 drivers/iommu/amd/iommu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index f3193c6428c9..5dec3502c8b3 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3280,12 +3280,14 @@ static int set_remap_table_entry_alias(struct pci_dev *pdev, u16 alias,
 	struct irq_remap_table *table = data;
 	struct amd_iommu_pci_seg *pci_seg;
 	struct amd_iommu *iommu = rlookup_amd_iommu(&pdev->dev);
+	u16 devid = pci_dev_id(pdev);
 
 	if (!iommu)
 		return -EINVAL;
 
 	pci_seg = iommu->pci_seg;
 	pci_seg->irq_lookup_table[alias] = table;
+	pci_seg->alias_table[alias] = devid;
 	set_dte_irq_entry(iommu, alias, table);
 	iommu_flush_dte(pci_seg->rlookup_table[alias], alias);
 
-- 
2.43.0


  parent reply	other threads:[~2026-02-25 20:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 20:23 [PATCH v3 0/3] iommu/amd: Invalidate IRT cache for DMA aliases Magnus Kalland
2026-02-25 20:23 ` [PATCH v3 1/3] iommu/amd: Use raw spinlock for interrupt remapping tables Magnus Kalland
2026-03-30 15:23   ` Vasant Hegde
2026-03-31 13:10     ` Magnus Kalland
2026-02-25 20:23 ` Magnus Kalland [this message]
2026-02-25 20:23 ` [PATCH v3 3/3] iommu/amd: Invalidate IRT cache for DMA aliases Magnus Kalland
2026-03-30 11:18   ` Vasant Hegde
2026-03-31 12:48     ` Magnus Kalland
2026-04-01  7:44       ` Vasant Hegde
2026-04-01 10:34         ` Magnus Kalland
2026-04-01 10:46           ` Vasant Hegde
2026-04-01 11:38             ` Magnus Kalland
2026-03-06  9:22 [PATCH v3 0/3] " Magnus Kalland
2026-03-06  9:22 ` [PATCH v3 2/3] iommu/amd: Track PCIe DMA aliases in set_remap_table_entry_alias Magnus Kalland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260225202330.23027-3-magnus@dolphinics.com \
    --to=magnus@dolphinics.com \
    --cc=dhsrivas@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®