From: "Jan Beulich" Subject: [PATCH] x86: don't deliver NMI to PVH Dom0 Date: Thu, 11 Dec 2014 10:47:21 +0000 Message-ID: <54898449020000780004EDDD@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEADF3A29.0__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xz1HL-0004Pl-OF for xen-devel@lists.xenproject.org; Thu, 11 Dec 2014 10:47:27 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartEADF3A29.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... 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 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -3168,7 +3168,6 @@ static void nmi_mce_softirq(void) int cpu =3D smp_processor_id(); struct softirq_trap *st =3D &per_cpu(softirq_trap, cpu); =20 - BUG_ON(st =3D=3D NULL); BUG_ON(st->vcpu =3D=3D NULL); =20 /* Set the tmp value unconditionally, so that @@ -3233,7 +3232,7 @@ static void nmi_hwdom_report(unsigned in { struct domain *d =3D hardware_domain; =20 - if ( (d =3D=3D NULL) || (d->vcpu =3D=3D NULL) || (d->vcpu[0] =3D=3D = NULL) ) + if ( !d || !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme = */ ) return; =20 set_bit(reason_idx, nmi_reason(d)); @@ -3674,7 +3673,6 @@ int send_guest_trap(struct domain *d, ui =20 if ( !test_and_set_bool(v->mce_pending) ) { st->domain =3D d; - st->vcpu =3D v; st->processor =3D v->processor; =20 /* not safe to wake up a vcpu here */ --=__PartEADF3A29.0__= Content-Type: text/plain; name="x86-PVH-suppress-NMI.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-PVH-suppress-NMI.patch" x86: don't deliver NMI to PVH Dom0=0A=0A... for the time being: The = mechanism used depends on the domain's use=0Aof the IRET hypercall.=0A=0AAl= so drop two bogus code lines spotted while going through the involved=0Acod= e paths: Addresses of per-CPU variables can't possibly be NULL, and=0Athe = setting of st->vcpu in send_guest_trap()'s MCE case is redundant=0Awith an = earlier cmpxchgptr().=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/traps.c=0A+++ b/xen/arch/x86/traps.c=0A@@ -3168,7 = +3168,6 @@ static void nmi_mce_softirq(void)=0A int cpu =3D smp_process= or_id();=0A struct softirq_trap *st =3D &per_cpu(softirq_trap, = cpu);=0A =0A- BUG_ON(st =3D=3D NULL);=0A BUG_ON(st->vcpu =3D=3D = NULL);=0A =0A /* Set the tmp value unconditionally, so that=0A@@ = -3233,7 +3232,7 @@ static void nmi_hwdom_report(unsigned in=0A {=0A = struct domain *d =3D hardware_domain;=0A =0A- if ( (d =3D=3D NULL) || = (d->vcpu =3D=3D NULL) || (d->vcpu[0] =3D=3D NULL) )=0A+ if ( !d || = !d->vcpu || !d->vcpu[0] || !is_pv_domain(d) /* PVH fixme */ )=0A = return;=0A =0A set_bit(reason_idx, nmi_reason(d));=0A@@ -3674,7 = +3673,6 @@ int send_guest_trap(struct domain *d, ui=0A =0A if ( = !test_and_set_bool(v->mce_pending) ) {=0A st->domain =3D = d;=0A- st->vcpu =3D v;=0A st->processor =3D = v->processor;=0A =0A /* not safe to wake up a vcpu here = */=0A --=__PartEADF3A29.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartEADF3A29.0__=--