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

[Xen-devel] [PATCH 1/2] x86/vmx: Print the problematic MSR if a vmentry fails



Sample error looks like:

  (XEN) Failed vm entry (exit reason 0x80000022) caused by MSR loading (entry 
13).
  (XEN)   msr 0000068a, val 1fff800000102af0, (mbz 0)
  (XEN) ************* VMCS Area **************

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Jun Nakajima <jun.nakajima@xxxxxxxxx>
CC: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index b9102ce..38cbcea 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3104,8 +3104,23 @@ static void vmx_failed_vmentry(unsigned int exit_reason,
         printk("caused by invalid guest state (%ld).\n", exit_qualification);
         break;
     case EXIT_REASON_MSR_LOADING:
-        printk("caused by MSR entry %ld loading.\n", exit_qualification);
+    {
+        unsigned long idx = exit_qualification - 1;
+        struct vmx_msr_entry *msr;
+
+        printk("caused by MSR loading (entry %ld).\n", idx);
+
+        if ( idx > (PAGE_SIZE / sizeof(*msr)) )
+            printk("  Entry out of range\n");
+        else
+        {
+            msr = &curr->arch.hvm_vmx.msr_area[idx];
+
+            printk("  msr %08x, val %016"PRIx64", (mbz %#x)\n",
+                   msr->index, msr->data, msr->mbz);
+        }
         break;
+    }
     case EXIT_REASON_MCE_DURING_VMENTRY:
         printk("caused by machine check.\n");
         HVMTRACE_0D(MCE);
-- 
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®.