[for-4.13] xen/passthrough: Render domains with %pd in the 'Q' debug handler
diff mbox series

Message ID 20191113134417.17299-1-andrew.cooper3@citrix.com
State New
Headers show
Series
  • [for-4.13] xen/passthrough: Render domains with %pd in the 'Q' debug handler
Related show

Commit Message

Andrew Cooper Nov. 13, 2019, 1:44 p.m. UTC
IOMMUs are owned by DOM_XEN, and with XSA-302, DOM_IO is used for
quarantined domains.  Use %pd in the printk to render the system
domains more intelligently.

Before:
  (XEN) 0000:00:01.0 - dom 0   - node 0   - MSIs < >
  (XEN) 0000:00:00.0 - dom 0   - node 0   - MSIs < >
  (XEN) 0000:80:00.2 - dom 32754 - node 1   - MSIs < >
  (XEN) 0000:a0:00.2 - dom 32754 - node 1   - MSIs < >
  (XEN) 0000:c0:00.2 - dom 32754 - node 1   - MSIs < >
  (XEN) 0000:e0:00.2 - dom 32754 - node 1   - MSIs < >
  (XEN) 0000:00:00.2 - dom 32754 - node 0   - MSIs < >
  (XEN) 0000:20:00.2 - dom 32754 - node 0   - MSIs < >
  (XEN) 0000:40:00.2 - dom 32754 - node 0   - MSIs < >
  (XEN) 0000:60:00.2 - dom 32754 - node 0   - MSIs < >

After:
  (XEN) 0000:00:01.0 - d0 - node 0   - MSIs < >
  (XEN) 0000:00:00.0 - d0 - node 0   - MSIs < >
  (XEN) 0000:80:00.2 - d[XEN] - node 1   - MSIs < >
  (XEN) 0000:a0:00.2 - d[XEN] - node 1   - MSIs < >
  (XEN) 0000:c0:00.2 - d[XEN] - node 1   - MSIs < >
  (XEN) 0000:e0:00.2 - d[XEN] - node 1   - MSIs < >
  (XEN) 0000:00:00.2 - d[XEN] - node 0   - MSIs < >
  (XEN) 0000:20:00.2 - d[XEN] - node 0   - MSIs < >
  (XEN) 0000:40:00.2 - d[XEN] - node 0   - MSIs < >
  (XEN) 0000:60:00.2 - d[XEN] - node 0   - MSIs < >

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Juergen Gross <jgross@suse.com>

4.13 nice-to-have.  Not strictly required, but it is a low risk change which
improves diagnostics.
---
 xen/drivers/passthrough/pci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jan Beulich Nov. 13, 2019, 2:28 p.m. UTC | #1
On 13.11.2019 14:44, Andrew Cooper wrote:
> IOMMUs are owned by DOM_XEN, and with XSA-302, DOM_IO is used for
> quarantined domains.  Use %pd in the printk to render the system
> domains more intelligently.
> 
> Before:
>   (XEN) 0000:00:01.0 - dom 0   - node 0   - MSIs < >
>   (XEN) 0000:00:00.0 - dom 0   - node 0   - MSIs < >
>   (XEN) 0000:80:00.2 - dom 32754 - node 1   - MSIs < >
>   (XEN) 0000:a0:00.2 - dom 32754 - node 1   - MSIs < >
>   (XEN) 0000:c0:00.2 - dom 32754 - node 1   - MSIs < >
>   (XEN) 0000:e0:00.2 - dom 32754 - node 1   - MSIs < >
>   (XEN) 0000:00:00.2 - dom 32754 - node 0   - MSIs < >
>   (XEN) 0000:20:00.2 - dom 32754 - node 0   - MSIs < >
>   (XEN) 0000:40:00.2 - dom 32754 - node 0   - MSIs < >
>   (XEN) 0000:60:00.2 - dom 32754 - node 0   - MSIs < >
> 
> After:
>   (XEN) 0000:00:01.0 - d0 - node 0   - MSIs < >
>   (XEN) 0000:00:00.0 - d0 - node 0   - MSIs < >
>   (XEN) 0000:80:00.2 - d[XEN] - node 1   - MSIs < >
>   (XEN) 0000:a0:00.2 - d[XEN] - node 1   - MSIs < >
>   (XEN) 0000:c0:00.2 - d[XEN] - node 1   - MSIs < >
>   (XEN) 0000:e0:00.2 - d[XEN] - node 1   - MSIs < >
>   (XEN) 0000:00:00.2 - d[XEN] - node 0   - MSIs < >
>   (XEN) 0000:20:00.2 - d[XEN] - node 0   - MSIs < >
>   (XEN) 0000:40:00.2 - d[XEN] - node 0   - MSIs < >
>   (XEN) 0000:60:00.2 - d[XEN] - node 0   - MSIs < >
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Juergen Gross Nov. 13, 2019, 2:31 p.m. UTC | #2
On 13.11.19 14:44, Andrew Cooper wrote:
> IOMMUs are owned by DOM_XEN, and with XSA-302, DOM_IO is used for
> quarantined domains.  Use %pd in the printk to render the system
> domains more intelligently.
> 
> Before:
>    (XEN) 0000:00:01.0 - dom 0   - node 0   - MSIs < >
>    (XEN) 0000:00:00.0 - dom 0   - node 0   - MSIs < >
>    (XEN) 0000:80:00.2 - dom 32754 - node 1   - MSIs < >
>    (XEN) 0000:a0:00.2 - dom 32754 - node 1   - MSIs < >
>    (XEN) 0000:c0:00.2 - dom 32754 - node 1   - MSIs < >
>    (XEN) 0000:e0:00.2 - dom 32754 - node 1   - MSIs < >
>    (XEN) 0000:00:00.2 - dom 32754 - node 0   - MSIs < >
>    (XEN) 0000:20:00.2 - dom 32754 - node 0   - MSIs < >
>    (XEN) 0000:40:00.2 - dom 32754 - node 0   - MSIs < >
>    (XEN) 0000:60:00.2 - dom 32754 - node 0   - MSIs < >
> 
> After:
>    (XEN) 0000:00:01.0 - d0 - node 0   - MSIs < >
>    (XEN) 0000:00:00.0 - d0 - node 0   - MSIs < >
>    (XEN) 0000:80:00.2 - d[XEN] - node 1   - MSIs < >
>    (XEN) 0000:a0:00.2 - d[XEN] - node 1   - MSIs < >
>    (XEN) 0000:c0:00.2 - d[XEN] - node 1   - MSIs < >
>    (XEN) 0000:e0:00.2 - d[XEN] - node 1   - MSIs < >
>    (XEN) 0000:00:00.2 - d[XEN] - node 0   - MSIs < >
>    (XEN) 0000:20:00.2 - d[XEN] - node 0   - MSIs < >
>    (XEN) 0000:40:00.2 - d[XEN] - node 0   - MSIs < >
>    (XEN) 0000:60:00.2 - d[XEN] - node 0   - MSIs < >
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

Patch
diff mbox series

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 18a7dc7224..8e501a79a8 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1349,10 +1349,9 @@  static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 
     list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
     {
-        printk("%04x:%02x:%02x.%u - dom %-3d - node %-3d - MSIs < ",
+        printk("%04x:%02x:%02x.%u - %pd - node %-3d - MSIs < ",
                pseg->nr, pdev->bus,
-               PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn),
-               pdev->domain ? pdev->domain->domain_id : -1,
+               PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), pdev->domain,
                (pdev->node != NUMA_NO_NODE) ? pdev->node : -1);
         list_for_each_entry ( msi, &pdev->msi_list, list )
                printk("%d ", msi->irq);