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

[Xen-changelog] [xen master] VMX: dump full host state



commit 954b961b797f9899a7249537460b55c573300b8b
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jan 22 12:55:56 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jan 22 12:55:56 2015 +0100

    VMX: dump full host state
    
    A few host state fields did not get dumped so far. Where suitable (to
    reduce the amount of output) make some of the dumping conditional upon
    guest settings (this isn't required for correctness as vmr() already
    uses __vmread_safe(), i.e. it is fine to access non-existing fields).
    
    Also drop casts - many of them haven't been needed anymore since the
    dropping of 32-bit support.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   49 ++++++++++++++++++------------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c5e6f88..4717a2b 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1496,34 +1496,27 @@ void vmcs_dump_vcpu(struct vcpu *v)
         printk("InterruptStatus = %04x\n", vmr16(GUEST_INTR_STATUS));
 
     printk("*** Host State ***\n");
-    printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
-           (unsigned long long)vmr(HOST_RSP),
-           (unsigned long long)vmr(HOST_RIP));
-    printk("CS=%04x DS=%04x ES=%04x FS=%04x GS=%04x SS=%04x TR=%04x\n",
-           (uint16_t)vmr(HOST_CS_SELECTOR),
-           (uint16_t)vmr(HOST_DS_SELECTOR),
-           (uint16_t)vmr(HOST_ES_SELECTOR),
-           (uint16_t)vmr(HOST_FS_SELECTOR),
-           (uint16_t)vmr(HOST_GS_SELECTOR),
-           (uint16_t)vmr(HOST_SS_SELECTOR),
-           (uint16_t)vmr(HOST_TR_SELECTOR));
-    printk("FSBase=%016llx GSBase=%016llx TRBase=%016llx\n",
-           (unsigned long long)vmr(HOST_FS_BASE),
-           (unsigned long long)vmr(HOST_GS_BASE),
-           (unsigned long long)vmr(HOST_TR_BASE));
-    printk("GDTBase=%016llx IDTBase=%016llx\n",
-           (unsigned long long)vmr(HOST_GDTR_BASE),
-           (unsigned long long)vmr(HOST_IDTR_BASE));
-    printk("CR0=%016llx CR3=%016llx CR4=%016llx\n",
-           (unsigned long long)vmr(HOST_CR0),
-           (unsigned long long)vmr(HOST_CR3),
-           (unsigned long long)vmr(HOST_CR4));
-    printk("Sysenter RSP=%016llx CS:RIP=%04x:%016llx\n",
-           (unsigned long long)vmr(HOST_SYSENTER_ESP),
-           (int)vmr(HOST_SYSENTER_CS),
-           (unsigned long long)vmr(HOST_SYSENTER_EIP));
-    printk("Host PAT = 0x%08x%08x\n",
-           (uint32_t)vmr(HOST_PAT_HIGH), (uint32_t)vmr(HOST_PAT));
+    printk("RIP = 0x%016lx (%ps)  RSP = 0x%016lx\n",
+           vmr(HOST_RIP), (void *)vmr(HOST_RIP), vmr(HOST_RSP));
+    printk("CS=%04x SS=%04x DS=%04x ES=%04x FS=%04x GS=%04x TR=%04x\n",
+           vmr16(HOST_CS_SELECTOR), vmr16(HOST_SS_SELECTOR),
+           vmr16(HOST_DS_SELECTOR), vmr16(HOST_ES_SELECTOR),
+           vmr16(HOST_FS_SELECTOR), vmr16(HOST_GS_SELECTOR),
+           vmr16(HOST_TR_SELECTOR));
+    printk("FSBase=%016lx GSBase=%016lx TRBase=%016lx\n",
+           vmr(HOST_FS_BASE), vmr(HOST_GS_BASE), vmr(HOST_TR_BASE));
+    printk("GDTBase=%016lx IDTBase=%016lx\n",
+           vmr(HOST_GDTR_BASE), vmr(HOST_IDTR_BASE));
+    printk("CR0=%016lx CR3=%016lx CR4=%016lx\n",
+           vmr(HOST_CR0), vmr(HOST_CR3), vmr(HOST_CR4));
+    printk("Sysenter RSP=%016lx CS:RIP=%04x:%016lx\n",
+           vmr(HOST_SYSENTER_ESP),
+           vmr32(HOST_SYSENTER_CS), vmr(HOST_SYSENTER_EIP));
+    if ( vmexit_ctl & (VM_EXIT_LOAD_HOST_PAT | VM_EXIT_LOAD_HOST_EFER) )
+        printk("EFER = 0x%016lx  PAT = 0x%016lx\n", vmr(HOST_EFER), 
vmr(HOST_PAT));
+    if ( vmexit_ctl & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        printk("PerfGlobCtl = 0x%016lx\n",
+               vmr(HOST_PERF_GLOBAL_CTRL));
 
     printk("*** Control State ***\n");
     printk("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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