Skip to contentSkip to conversation

x86/iommu: improve logging message

PATCH In review Roger Pau Monne 3 participants 3 messages Sep 27, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/iommu: improve logging message

Switch to using pd and also print the pfn that failed.

No functional change intended.

---
 xen/drivers/passthrough/x86/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/drivers/passthrough/x86/iommu.c +2 -2
index 47a3e55213..7107b11757 100644
@@ -200,8 +200,8 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
                            IOMMUF_readable | IOMMUF_writable, &flush_flags);
 
         if ( rc )
-            printk(XENLOG_WARNING " d%d: IOMMU mapping failed: %d\n",
-                   d->domain_id, rc);
+            printk(XENLOG_WARNING "%pd: identity %smapping of %lx failed: %d\n",
+                   d, !paging_mode_translate(d) ? "IOMMU " : "", pfn, rc);
 
         if (!(i & 0xfffff))
             process_pending_softirqs();
Signature · 7 lines
2.23.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 5 lines · Roger Pau Monne

Switch to using pd and also print the pfn that failed.

No functional change intended.

Nevertheless, ...

xen/drivers/passthrough/x86/iommu.c void __hwdom_init arch_iommu_hwdom_init(struct domain *d) · line 204

Quoted 10 lines
xen/drivers/passthrough/x86/iommu.c +2 -2
@@ -200,8 +200,8 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
                            IOMMUF_readable | IOMMUF_writable, &flush_flags);
 
         if ( rc )
-            printk(XENLOG_WARNING " d%d: IOMMU mapping failed: %d\n",
-                   d->domain_id, rc);
+            printk(XENLOG_WARNING "%pd: identity %smapping of %lx failed: %d\n",
+                   d, !paging_mode_translate(d) ? "IOMMU " : "", pfn, rc);

... have you observed this getting logged? If so, how many of them did you see? IOW I wonder whether logging every occurrence of this may be overly verbose.

As an aside I also think that we need to urgently make this use larger page sizes where suitable.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel