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

[Xen-devel] [PATCH] x86/svm: Improve segment register printing in svm_vmcb_dump()



This makes it more succinct and easier to read.

Before:
  (XEN) H_CR3 = 0x000000042a0ec000 CleanBits = 0
  (XEN) CS: sel=0x0008, attr=0x029b, limit=0xffffffff, base=0x0000000000000000
  (XEN) DS: sel=0x0033, attr=0x0cf3, limit=0xffffffff, base=0x0000000000000000
  (XEN) SS: sel=0x0018, attr=0x0c93, limit=0xffffffff, base=0x0000000000000000
  (XEN) ES: sel=0x0033, attr=0x0cf3, limit=0xffffffff, base=0x0000000000000000
  (XEN) FS: sel=0x0033, attr=0x0cf3, limit=0xffffffff, base=0x0000000000000000
  (XEN) GS: sel=0x0033, attr=0x0cf3, limit=0xffffffff, base=0x0000000000000000
  (XEN) GDTR: sel=0x0000, attr=0x0000, limit=0x00000067, base=0x000000000010d100
  (XEN) LDTR: sel=0x0000, attr=0x0000, limit=0x00000000, base=0x0000000000000000
  (XEN) IDTR: sel=0x0000, attr=0x0000, limit=0x00000fff, base=0x0000000000110900
  (XEN) TR: sel=0x0038, attr=0x0089, limit=0x00000067, base=0x000000000010d020

After:
  (XEN) H_CR3 = 0x000000042a0ec000 CleanBits = 0
  (XEN)        sel  attr  limit   base
  (XEN)   CS: 0008 0029b ffffffff 0000000000000000
  (XEN)   DS: 0033 00cf3 ffffffff 0000000000000000
  (XEN)   SS: 0018 00c93 ffffffff 0000000000000000
  (XEN)   ES: 0033 00cf3 ffffffff 0000000000000000
  (XEN)   FS: 0033 00cf3 ffffffff 0000000000000000
  (XEN)   GS: 0033 00cf3 ffffffff 0000000000000000
  (XEN) GDTR: 0000 00000 00000067 000000000010d100
  (XEN) LDTR: 0000 00000 00000000 0000000000000000
  (XEN) IDTR: 0000 00000 00000fff 0000000000110900
  (XEN)   TR: 0038 00089 00000067 000000000010d020

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
CC: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
---
 xen/arch/x86/hvm/svm/svmdebug.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c
index ded5d19..f85f70a 100644
--- a/xen/arch/x86/hvm/svm/svmdebug.c
+++ b/xen/arch/x86/hvm/svm/svmdebug.c
@@ -20,11 +20,10 @@
 #include <asm/msr-index.h>
 #include <asm/hvm/svm/svmdebug.h>
 
-static void svm_dump_sel(const char *name, svm_segment_register_t *s)
+static void svm_dump_sel(const char *name, const svm_segment_register_t *s)
 {
-    printk("%s: sel=0x%04x, attr=0x%04x, limit=0x%08x, base=0x%016llx\n", 
-           name, s->sel, s->attr.bytes, s->limit,
-           (unsigned long long)s->base);
+    printk("%s: %04x %05x %08x %016"PRIx64"\n",
+           name, s->sel, s->attr.bytes, s->limit, s->base);
 }
 
 /* This function can directly access fields which are covered by clean bits. */
@@ -79,16 +78,17 @@ void svm_vmcb_dump(const char *from, struct vmcb_struct 
*vmcb)
            (unsigned long long)vmcb->_h_cr3, vmcb->cleanbits.bytes);
 
     /* print out all the selectors */
-    svm_dump_sel("CS", &vmcb->cs);
-    svm_dump_sel("DS", &vmcb->ds);
-    svm_dump_sel("SS", &vmcb->ss);
-    svm_dump_sel("ES", &vmcb->es);
-    svm_dump_sel("FS", &vmcb->fs);
-    svm_dump_sel("GS", &vmcb->gs);
+    printk("       sel  attr  limit   base\n");
+    svm_dump_sel("  CS", &vmcb->cs);
+    svm_dump_sel("  DS", &vmcb->ds);
+    svm_dump_sel("  SS", &vmcb->ss);
+    svm_dump_sel("  ES", &vmcb->es);
+    svm_dump_sel("  FS", &vmcb->fs);
+    svm_dump_sel("  GS", &vmcb->gs);
     svm_dump_sel("GDTR", &vmcb->gdtr);
     svm_dump_sel("LDTR", &vmcb->ldtr);
     svm_dump_sel("IDTR", &vmcb->idtr);
-    svm_dump_sel("TR", &vmcb->tr);
+    svm_dump_sel("  TR", &vmcb->tr);
 }
 
 bool_t
-- 
2.1.4


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

 


Rackspace

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