[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] VT-d: make print_vtd_entries() less verbose



commit c5e95f86cfcce97c558510ba764e60fa2c09db43
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Feb 9 11:00:39 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Feb 9 11:00:39 2017 +0100

    VT-d: make print_vtd_entries() less verbose
    
    Especially printing virtual addresses of mappings of the individual
    pages seems rather useless here - this mostly obfuscates the important
    numbers, and hinders comparing two printouts. Printing the page table
    level indexes isn't very useful either, as the immediately following
    lines will print the indexes again as part of printing the raw entries.
    
    Take the opportunity and also
    - adjust some format specifiers,
    - widen (zero-pad) array indexes to their nominal width.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/utils.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/utils.c 
b/xen/drivers/passthrough/vtd/utils.c
index fdc768e..85e0f41 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -95,8 +95,8 @@ void print_vtd_entries(struct iommu *iommu, int bus, int 
devfn, u64 gmfn)
     u64 *l, val;
     u32 l_index, level;
 
-    printk("print_vtd_entries: iommu %p dev %04x:%02x:%02x.%u gmfn 
%"PRIx64"\n",
-           iommu, iommu->intel->drhd->segment, bus,
+    printk("print_vtd_entries: iommu #%u dev %04x:%02x:%02x.%u gmfn 
%"PRI_gfn"\n",
+           iommu->index, iommu->intel->drhd->segment, bus,
            PCI_SLOT(devfn), PCI_FUNC(devfn), gmfn);
 
     if ( iommu->root_maddr == 0 )
@@ -112,12 +112,11 @@ void print_vtd_entries(struct iommu *iommu, int bus, int 
devfn, u64 gmfn)
         return;
     }
 
-    printk("    root_entry = %p\n", root_entry);
-    printk("    root_entry[%x] = %"PRIx64"\n", bus, root_entry[bus].val);
+    printk("    root_entry[%02x] = %"PRIx64"\n", bus, root_entry[bus].val);
     if ( !root_present(root_entry[bus]) )
     {
         unmap_vtd_domain_page(root_entry);
-        printk("    root_entry[%x] not present\n", bus);
+        printk("    root_entry[%02x] not present\n", bus);
         return;
     }
 
@@ -130,14 +129,13 @@ void print_vtd_entries(struct iommu *iommu, int bus, int 
devfn, u64 gmfn)
         return;
     }
 
-    printk("    context = %p\n", ctxt_entry);
     val = ctxt_entry[devfn].lo;
-    printk("    context[%x] = %"PRIx64"_%"PRIx64"\n",
+    printk("    context[%02x] = %"PRIx64"_%"PRIx64"\n",
            devfn, ctxt_entry[devfn].hi, val);
     if ( !context_present(ctxt_entry[devfn]) )
     {
         unmap_vtd_domain_page(ctxt_entry);
-        printk("    ctxt_entry[%x] not present\n", devfn);
+        printk("    ctxt_entry[%02x] not present\n", devfn);
         return;
     }
 
@@ -153,22 +151,19 @@ void print_vtd_entries(struct iommu *iommu, int bus, int 
devfn, u64 gmfn)
     do
     {
         l = map_vtd_domain_page(val);
-        printk("    l%d = %p\n", level, l);
         if ( l == NULL )
         {
-            printk("    l%d == NULL\n", level);
+            printk("    l%u == NULL\n", level);
             break;
         }
         l_index = get_level_index(gmfn, level);
-        printk("    l%d_index = %x\n", level, l_index);
-
         pte.val = l[l_index];
         unmap_vtd_domain_page(l);
-        printk("    l%d[%x] = %"PRIx64"\n", level, l_index, pte.val);
+        printk("    l%u[%03x] = %"PRIx64"\n", level, l_index, pte.val);
 
         if ( !dma_pte_present(pte) )
         {
-            printk("    l%d[%x] not present\n", level, l_index);
+            printk("    l%u[%03x] not present\n", level, l_index);
             break;
         }
         if ( dma_pte_superpage(pte) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.