From: Vasant Hegde <vasant.hegde@amd.com>
To: <iommu@lists.linux.dev>, <joro@8bytes.org>
Cc: <will@kernel.org>, <robin.murphy@arm.com>,
<suravee.suthikulpanit@amd.com>,
Vasant Hegde <vasant.hegde@amd.com>
Subject: [PATCH 1/7] iommu/amd: Log IOMMU control register in event log path
Date: Tue, 25 Feb 2025 10:53:39 +0000 [thread overview]
Message-ID: <20250225105345.52143-2-vasant.hegde@amd.com> (raw)
In-Reply-To: <20250225105345.52143-1-vasant.hegde@amd.com>
Useful for debugging ILLEGAL_DEV_TABLE_ENTRY events as some of the
DTE settings depends on Control register settings.
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
---
drivers/iommu/amd/iommu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index b48a72bd7b23..797c8612966a 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -868,7 +868,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
int type, devid, flags, tag;
volatile u32 *event = __evt;
int count = 0;
- u64 address;
+ u64 address, ctrl;
u32 pasid;
retry:
@@ -878,6 +878,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
(event[1] & EVENT_DOMID_MASK_LO);
flags = (event[1] >> EVENT_FLAGS_SHIFT) & EVENT_FLAGS_MASK;
address = (u64)(((u64)event[3]) << 32) | event[2];
+ ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET);
if (type == 0) {
/* Did we hit the erratum? */
@@ -899,6 +900,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
dev_err(dev, "Event logged [ILLEGAL_DEV_TABLE_ENTRY device=%04x:%02x:%02x.%x pasid=0x%05x address=0x%llx flags=0x%04x]\n",
iommu->pci_seg->id, PCI_BUS_NUM(devid), PCI_SLOT(devid), PCI_FUNC(devid),
pasid, address, flags);
+ dev_err(dev, "Control Reg : 0x%llx\n", ctrl);
dump_dte_entry(iommu, devid);
break;
case EVENT_TYPE_DEV_TAB_ERR:
--
2.31.1
next prev parent reply other threads:[~2025-02-25 10:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 10:53 [PATCH 0/7] iommu/amd: Trivial fixes Vasant Hegde
2025-02-25 10:53 ` Vasant Hegde [this message]
2025-02-25 14:26 ` [PATCH 1/7] iommu/amd: Log IOMMU control register in event log path Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 2/7] iommu/amd: Remove unused variable Vasant Hegde
2025-02-25 14:26 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 3/7] iommu/amd/pgtbl_v2: Improve error handling Vasant Hegde
2025-02-25 14:27 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 4/7] iommu/amd: Remove outdated comment Vasant Hegde
2025-02-25 14:27 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 5/7] iommu/amd: Fix header file Vasant Hegde
2025-02-25 14:28 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 6/7] iommu/amd: Remove unused forward declaration Vasant Hegde
2025-02-25 14:28 ` Jason Gunthorpe
2025-02-25 10:53 ` [PATCH 7/7] iommu/amd: Make protection_domain as static Vasant Hegde
2025-02-25 14:29 ` Jason Gunthorpe
2025-02-25 14:40 ` Vasant Hegde
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=20250225105345.52143-2-vasant.hegde@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=will@kernel.org \
/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