Skip to contentSkip to conversation

VT-d: Adjust diagnostics in set_msi_source_id()

PATCH In review Andrew Cooper 2 participants 3 messages Mar 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VT-d: Adjust diagnostics in set_msi_source_id()

Use %pd, and state what the unknown is. As it's an enum, it's a signed type.

Also drop one piece of trailing whitespace.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
xen/drivers/passthrough/vtd/intremap.c +5 -5
index 81394ef45299..9272a2511398 100644
@@ -485,15 +485,15 @@ static int set_msi_source_id(const struct pci_dev *pdev,
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "d%d: no upstream bridge for %pp\n",
-                    pdev->domain->domain_id, &pdev->sbdf);
+                    "%pd: no upstream bridge for %pp\n",
+                    pdev->domain, &pdev->sbdf);
             return -ENXIO;
         }
         break;
 
     default:
-        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
-                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
+        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
+                pdev->domain, &pdev->sbdf, pdev->type);
         return -EOPNOTSUPP;
     }
 
@@ -751,7 +751,7 @@ void disable_intremap(struct vtd_iommu *iommu)
                   !(sts & DMA_GSTS_IRES), sts);
 
     /* If we are disabling Interrupt Remapping, make sure we dont stay in
-     * Extended Interrupt Mode, as this is unaffected by the Interrupt 
+     * Extended Interrupt Mode, as this is unaffected by the Interrupt
      * Remapping flag in each DMAR Global Control Register.
      * Specifically, local apics in xapic mode do not like interrupts delivered
      * in x2apic mode.  Any code turning interrupt remapping back on will set
Signature · 1 line
2.39.5
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrew Cooper

Use %pd, and state what the unknown is. As it's an enum, it's a signed type.

Also drop one piece of trailing whitespace.

Quoted 18 lines

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
xen/drivers/passthrough/vtd/intremap.c +1 -2
index 81394ef45299..9272a2511398 100644
@@ -485,15 +485,15 @@ static int set_msi_source_id(const struct pci_dev *pdev,
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "d%d: no upstream bridge for %pp\n",
-                    pdev->domain->domain_id, &pdev->sbdf);
+                    "%pd: no upstream bridge for %pp\n",

xen/drivers/passthrough/vtd/intremap.c static int set_msi_source_id(const struct pci_dev *pdev, · line 496

Quoted 10 lines
xen/drivers/passthrough/vtd/intremap.c +3 -2
+                    pdev->domain, &pdev->sbdf);
             return -ENXIO;
         }
         break;
 
     default:
-        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
-                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
+        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
+                pdev->domain, &pdev->sbdf, pdev->type);

Would be nice to have a pdev_type_to_str() or similar helper.

Thanks, Roger.

#2 lore raw
Quoted 7 lines · Roger Pau Monné
Quoted 5 lines · Andrew Cooper

Use %pd, and state what the unknown is. As it's an enum, it's a signed type.

Also drop one piece of trailing whitespace.

Thanks.

Quoted 24 lines
Quoted 24 lines

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/drivers/passthrough/vtd/intremap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
xen/drivers/passthrough/vtd/intremap.c +2 -2
index 81394ef45299..9272a2511398 100644
@@ -485,15 +485,15 @@ static int set_msi_source_id(const struct pci_dev *pdev,
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "d%d: no upstream bridge for %pp\n",
-                    pdev->domain->domain_id, &pdev->sbdf);
+                    "%pd: no upstream bridge for %pp\n",
+                    pdev->domain, &pdev->sbdf);
             return -ENXIO;
         }
         break;
 
Quoted 6 lines

xen/drivers/passthrough/vtd/intremap.c static int set_msi_source_id(const struct pci_dev *pdev, · line 496

Quoted 5 lines
xen/drivers/passthrough/vtd/intremap.c +2 -2
     default:
-        dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): %pp\n",
-                pdev->domain->domain_id, pdev->type, &pdev->sbdf);
+        dprintk(XENLOG_WARNING VTDPREFIX, "%pd: %pp unknown device type %d\n",
+                pdev->domain, &pdev->sbdf, pdev->type);

Would be nice to have a pdev_type_to_str() or similar helper.

In this case, I think we'd only get UNKNOWN out of it, based on what else the switch() handles.

~Andrew