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

[Xen-devel] [PATCH 3/3] x86/pvh: Print the PVH start info more concisely



The current rendering of PVH start info in unnecessarily verbose, and doesn't
clearly separate decimal and hex numbers.

All addresses are expected to be below the 4G boundary, so drop 8 redundant
zeroes on all physical addresses.  Properly prefix all hex numbers, and fold
related information onto the same line.

Before:
  (XEN) PVH start info: (pa 0000ffc0)
  (XEN)   version:    1
  (XEN)   flags:      0
  (XEN)   nr_modules: 1
  (XEN)   modlist_pa: 000000000000ff80
  (XEN)   cmdline_pa: 000000000000ffa0
  (XEN)   cmdline:    'console=pv,xen'
  (XEN)   rsdp_pa:    00000000fc009000
  (XEN)     mod[0].pa:         0000000000599000
  (XEN)     mod[0].size:       0000000001204224
  (XEN)     mod[0].cmdline_pa: 0000000000000000

After:
  (XEN) PVH start info: (pa 0x0000ffc0)
  (XEN)   version 1, flags 0
  (XEN)   cmdline 0x0000ffa0 'console=pv,xen'
  (XEN)   rsdp    0xfc009000
  (XEN)   modlist 0x0000ff80, nr 1
  (XEN)     mod0 pa 0x005f4000, sz 0x00126000, cmdline 0x00000000

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>
---
 xen/arch/x86/guest/pvh-boot.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/guest/pvh-boot.c b/xen/arch/x86/guest/pvh-boot.c
index 01f1376..0845f0f 100644
--- a/xen/arch/x86/guest/pvh-boot.c
+++ b/xen/arch/x86/guest/pvh-boot.c
@@ -123,28 +123,29 @@ void __init pvh_print_info(void)
     const struct hvm_modlist_entry *entry;
     unsigned int i;
 
-    ASSERT(pvh_info->magic == XEN_HVM_START_MAGIC_VALUE);
-
-    printk("PVH start info: (pa %08x)\n", pvh_start_info_pa);
-    printk("  version:    %u\n", pvh_info->version);
-    printk("  flags:      %#"PRIx32"\n", pvh_info->flags);
-    printk("  nr_modules: %u\n", pvh_info->nr_modules);
-    printk("  modlist_pa: %016"PRIx64"\n", pvh_info->modlist_paddr);
-    printk("  cmdline_pa: %016"PRIx64"\n", pvh_info->cmdline_paddr);
+    printk("PVH start info: (pa 0x%08x)\n", pvh_start_info_pa);
+    printk("  version %u, flags %#x\n", pvh_info->version, pvh_info->flags);
+
+    printk("  cmdline 0x%08"PRIx64, pvh_info->cmdline_paddr);
     if ( pvh_info->cmdline_paddr )
-        printk("  cmdline:    '%s'\n", (char *)__va(pvh_info->cmdline_paddr));
-    printk("  rsdp_pa:    %016"PRIx64"\n", pvh_info->rsdp_paddr);
+        printk(" '%s'", (char *)__va(pvh_info->cmdline_paddr));
+    printk("\n");
+
+    printk("  rsdp    0x%08"PRIx64"\n", pvh_info->rsdp_paddr);
+
+    printk("  modlist 0x%08"PRIx64", nr %u\n",
+           pvh_info->modlist_paddr, pvh_info->nr_modules);
 
     entry = __va(pvh_info->modlist_paddr);
     for ( i = 0; i < pvh_info->nr_modules; i++ )
     {
-        printk("    mod[%u].pa:         %016"PRIx64"\n", i, entry[i].paddr);
-        printk("    mod[%u].size:       %016"PRIu64"\n", i, entry[i].size);
-        printk("    mod[%u].cmdline_pa: %016"PRIx64"\n",
-               i, entry[i].cmdline_paddr);
+        printk("    mod%u pa 0x%08"PRIx64", sz 0x%08"PRIx64", cmdline 0x%08" 
PRIx64,
+               i, entry[i].paddr, entry[i].size, entry[i].cmdline_paddr);
+
         if ( entry[i].cmdline_paddr )
-            printk("    mod[%1u].cmdline:    '%s'\n", i,
-                   (char *)__va(entry[i].cmdline_paddr));
+            printk(" '%s'\n", (char *)__va(entry[i].cmdline_paddr));
+
+        printk("\n");
     }
 }
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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