From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: don't deliver NMI to PVH Dom0 Date: Thu, 11 Dec 2014 11:41:48 +0000 Message-ID: <548982FC.5040107@citrix.com> References: <54898449020000780004EDDD@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xz280-0007Gp-JS for xen-devel@lists.xenproject.org; Thu, 11 Dec 2014 11:41:52 +0000 In-Reply-To: <54898449020000780004EDDD@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org On 11/12/14 10:47, Jan Beulich wrote: > ... for the time being: The mechanism used depends on the domain's use > of the IRET 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 Reviewed-by: Andrew Cooper > > --- 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 in > { > 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, ui > > 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 */