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

[Xen-devel] [PATCH] x86/VT-x: Align segment table columns when dumping a VMCS



This makes it more succinct and easier to read.

Before:
  (XEN) Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000
  (XEN) CS: sel=0x0008, attr=0x0c09b, limit=0xffffffff, base=0x0000000000000000
  (XEN) DS: sel=0x0010, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000
  (XEN) SS: sel=0x0010, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000
  (XEN) ES: sel=0x0010, attr=0x0c093, limit=0xffffffff, base=0x0000000000000000
  (XEN) FS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
  (XEN) GS: sel=0x0000, attr=0x00093, limit=0x0000ffff, base=0x0000000000000000
  (XEN) GDTR:                           limit=0x00000017, 
base=0x0000000000102eb8
  (XEN) LDTR: sel=0x0000, attr=0x00082, limit=0x0000ffff, 
base=0x0000000000000000
  (XEN) IDTR:                           limit=0x0000ffff, 
base=0x0000000000000000
  (XEN) TR: sel=0x0000, attr=0x0008b, limit=0x0000ffff, base=0x0000000000000000
  (XEN) EFER = 0x0000000000000000  PAT = 0x0007040600070406

After:
  (XEN) Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000
  (XEN)        sel  attr  limit   base
  (XEN)   CS: 0008 0c09b ffffffff 0000000000000000
  (XEN)   DS: 0010 0c093 ffffffff 0000000000000000
  (XEN)   SS: 0010 0c093 ffffffff 0000000000000000
  (XEN)   ES: 0010 0c093 ffffffff 0000000000000000
  (XEN)   FS: 0000 00093 0000ffff 0000000000000000
  (XEN)   GS: 0000 00093 0000ffff 0000000000000000
  (XEN) GDTR:            00000017 0000000000102eb8
  (XEN) LDTR: 0000 00082 0000ffff 0000000000000000
  (XEN) IDTR:            0000ffff 0000000000000000
  (XEN)   TR: 0000 0008b 0000ffff 0000000000000000
  (XEN) EFER = 0x0000000000000000  PAT = 0x0007040600070406

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Jun Nakajima <jun.nakajima@xxxxxxxxx>
CC: Eddie Dong <eddie.dong@xxxxxxxxx>
CC: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 355d1b5..877ec10 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1639,8 +1639,7 @@ static void vmx_dump_sel(char *name, uint32_t selector)
     attr = vmr(selector + (GUEST_ES_AR_BYTES - GUEST_ES_SELECTOR));
     limit = vmr(selector + (GUEST_ES_LIMIT - GUEST_ES_SELECTOR));
     base = vmr(selector + (GUEST_ES_BASE - GUEST_ES_SELECTOR));
-    printk("%s: sel=0x%04x, attr=0x%05x, limit=0x%08x, base=0x%016"PRIx64"\n",
-           name, sel, attr, limit, base);
+    printk("%s: %04x %05x %08x %016"PRIx64"\n", name, sel, attr, limit, base);
 }
 
 static void vmx_dump_sel2(char *name, uint32_t lim)
@@ -1649,8 +1648,7 @@ static void vmx_dump_sel2(char *name, uint32_t lim)
     uint64_t base;
     limit = vmr(lim);
     base = vmr(lim + (GUEST_GDTR_BASE - GUEST_GDTR_LIMIT));
-    printk("%s:                           limit=0x%08x, base=0x%016"PRIx64"\n",
-           name, limit, base);
+    printk("%s:            %08x %016"PRIx64"\n", name, limit, base);
 }
 
 void vmcs_dump_vcpu(struct vcpu *v)
@@ -1695,16 +1693,17 @@ void vmcs_dump_vcpu(struct vcpu *v)
     printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
            vmr(GUEST_SYSENTER_ESP),
            vmr32(GUEST_SYSENTER_CS), vmr(GUEST_SYSENTER_EIP));
-    vmx_dump_sel("CS", GUEST_CS_SELECTOR);
-    vmx_dump_sel("DS", GUEST_DS_SELECTOR);
-    vmx_dump_sel("SS", GUEST_SS_SELECTOR);
-    vmx_dump_sel("ES", GUEST_ES_SELECTOR);
-    vmx_dump_sel("FS", GUEST_FS_SELECTOR);
-    vmx_dump_sel("GS", GUEST_GS_SELECTOR);
+    printk("       sel  attr  limit   base\n");
+    vmx_dump_sel("  CS", GUEST_CS_SELECTOR);
+    vmx_dump_sel("  DS", GUEST_DS_SELECTOR);
+    vmx_dump_sel("  SS", GUEST_SS_SELECTOR);
+    vmx_dump_sel("  ES", GUEST_ES_SELECTOR);
+    vmx_dump_sel("  FS", GUEST_FS_SELECTOR);
+    vmx_dump_sel("  GS", GUEST_GS_SELECTOR);
     vmx_dump_sel2("GDTR", GUEST_GDTR_LIMIT);
     vmx_dump_sel("LDTR", GUEST_LDTR_SELECTOR);
     vmx_dump_sel2("IDTR", GUEST_IDTR_LIMIT);
-    vmx_dump_sel("TR", GUEST_TR_SELECTOR);
+    vmx_dump_sel("  TR", GUEST_TR_SELECTOR);
     if ( (vmexit_ctl & (VM_EXIT_SAVE_GUEST_PAT | VM_EXIT_SAVE_GUEST_EFER)) ||
          (vmentry_ctl & (VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER)) )
         printk("EFER = 0x%016lx  PAT = 0x%016lx\n", efer, vmr(GUEST_PAT));
-- 
1.7.10.4


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


 


Rackspace

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