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

[Xen-changelog] [xen stable-4.5] x86: don't deliver NMI to PVH Dom0



commit 21c9fce8efbf407dc5d6bcc78bf65a1402623db9
Author:     Jan Beulich <JBeulich@xxxxxxxx>
AuthorDate: Thu Dec 11 10:47:21 2014 +0000
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CommitDate: Mon Jan 5 10:13:53 2015 -0500

    x86: don't deliver NMI to PVH Dom0
    
    ... for the time being: The mechanism used depends on the domain's use
    of the IRET hypercall - which PVH is not using.  HVM code (which PVH
    uses) will deliver an NMI if it sees v->nmi_pending however that
    temporary affinity adjustment gets undone in the HYPERVISOR_iret
    handler, yet PVH can't call that hypercall.
    
    Also drop two bogus code lines spotted while going through the involved
    code paths: Addresses of per-CPU variables can't possibly be NULL, and
    the setting of st->vcpu in send_guest_trap()'s MCE case is redundant
    with an earlier cmpxchgptr().
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/arch/x86/traps.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 10fc2ca..3cd8746 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3168,7 +3168,6 @@ static void nmi_mce_softirq(void)
     int cpu = smp_processor_id();
     struct softirq_trap *st = &per_cpu(softirq_trap, cpu);
 
-    BUG_ON(st == NULL);
     BUG_ON(st->vcpu == NULL);
 
     /* Set the tmp value unconditionally, so that
@@ -3233,7 +3232,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
-    if ( (d == NULL) || (d->vcpu == NULL) || (d->vcpu[0] == NULL) )
+    if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )
         return;
 
     set_bit(reason_idx, nmi_reason(d));
@@ -3674,7 +3673,6 @@ int send_guest_trap(struct domain *d, uint16_t vcpuid, 
unsigned int trap_nr)
 
         if ( !test_and_set_bool(v->mce_pending) ) {
                 st->domain = d;
-                st->vcpu = v;
                 st->processor = v->processor;
 
                 /* not safe to wake up a vcpu here */
--
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®.