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

[Xen-changelog] [xen stable-4.5] x86/hvm: fix the unknown nested vmexit reason 80000021 bug



commit 56fe488893759c7a134c4a69a63840095ac3552d
Author:     Liang Li <liang.z.li@xxxxxxxxx>
AuthorDate: Tue Apr 21 09:16:06 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 21 09:16:06 2015 +0200

    x86/hvm: fix the unknown nested vmexit reason 80000021 bug
    
    This bug will be trigged when NMI happen in the L2 guest. The current
    code handles the NMI incorrectly. According to Intel SDM 31.7.1.2
    (Resuming Guest Software after Handling an Exception), If bit 31 of the
    IDT-vectoring information fields is set, and the virtual NMIs VM-execution
    control is 1, while bits 10:8 in the IDT-vectoring information field is
    2, bit 3 in the interruptibility-state field should be cleared to avoid
    the next VM entry fail.
    
    Signed-off-by: Liang Li <liang.z.li@xxxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: f7708796db463410a97b5fa3dd5902f6e8a1d102
    master date: 2015-04-10 11:35:46 -0400
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f40f89d..8584f1f 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2606,7 +2606,8 @@ static void vmx_idtv_reinject(unsigned long idtv_info)
          * Clear NMI-blocking interruptibility info if an NMI delivery faulted.
          * Re-delivery will re-set it (see SDM 3B 25.7.1.2).
          */
-        if ( (idtv_info & INTR_INFO_INTR_TYPE_MASK) == (X86_EVENTTYPE_NMI<<8) )
+        if ( cpu_has_vmx_vnmi && ((idtv_info & INTR_INFO_INTR_TYPE_MASK) ==
+                                 (X86_EVENTTYPE_NMI<<8)) )
         {
             unsigned long intr_info;
 
@@ -2757,8 +2758,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
     hvm_maybe_deassert_evtchn_irq();
 
     __vmread(IDT_VECTORING_INFO, &idtv_info);
-    if ( !nestedhvm_vcpu_in_guestmode(v) && 
-         exit_reason != EXIT_REASON_TASK_SWITCH )
+    if ( exit_reason != EXIT_REASON_TASK_SWITCH )
         vmx_idtv_reinject(idtv_info);
 
     switch ( exit_reason )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

_______________________________________________
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®.