From nobody Mon Feb 9 17:23:45 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 158193830376222.845851621364318; Mon, 17 Feb 2020 03:18:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j3ePK-0006bf-89; Mon, 17 Feb 2020 11:17:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j3ePJ-0006ba-6d for xen-devel@lists.xenproject.org; Mon, 17 Feb 2020 11:17:45 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1e455010-5177-11ea-bfcd-12813bfff9fa; Mon, 17 Feb 2020 11:17:44 +0000 (UTC) X-Inumbo-ID: 1e455010-5177-11ea-bfcd-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1581938264; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FV/TMnSmgfHBpkUWVZPWz/LX4LCctWW2dzYLExVsyoA=; b=G1d0ZHd5Xb3gtAfnAS64u2eQvu2IYG/Mdb4CKlSHseXMWpTyWSMaVkWq tZJpgpUrfLbJ4lZ84knhPnZ+UYaUCMmqmJZwFhBQnRU2ovJxOgxTotm7p jfKEgkRWP/mOoMG2vQrrTR8LrTvKSKT59bhMJn6loz044mN1pimGfO9lx E=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: tk+nmZ7os2LlsQjuzO89MDdHmiIW7ZQlBjdEcm+Bw0mE8gQlOCOqepx0bEINP/NGjEjB4zgfky /6Ijz71ypmzgTWztm6r6ecC/shWpt7dC5g0VPMyyhuvDD1Neo9QLIGnkR7A0/c86FZXnzjJu5E 9gNrGFVr32EdrQbpZqTSMrjwbjkClC+QCRLPQGAlI5IHK25fiyefsDzOqVufyQndpbQpNf2YA6 WHFYtcQZ5zL9vrufJr2DJ5xXcicsoqQtsGbuALQQ+l7+0+kAa1LbegTT//JMrpeQvW7OJLo7o7 1e0= X-SBRS: 2.7 X-MesageID: 12922760 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,452,1574139600"; d="scan'208";a="12922760" From: Andrew Cooper To: Xen-devel Date: Mon, 17 Feb 2020 11:17:38 +0000 Message-ID: <20200217111740.7298-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200217111740.7298-1-andrew.cooper3@citrix.com> References: <20200217111740.7298-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/3] x86/nmi: Corrections and improvements to do_nmi_stats() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The hardware domain doesn't necessarily have the domid 0. Render v instead, adjusting the strings to avoid printing trailing whitespace. Rename i to cpu, and use separate booleans for pending/masked. Drop the unnecessary domain local variable. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/nmi.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index a5c6bdd0ce..638677a5fe 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -587,25 +587,25 @@ static void do_nmi_trigger(unsigned char key) =20 static void do_nmi_stats(unsigned char key) { - int i; - struct domain *d; - struct vcpu *v; + const struct vcpu *v; + unsigned int cpu; + bool pend, mask; =20 printk("CPU\tNMI\n"); - for_each_online_cpu ( i ) - printk("%3d\t%3d\n", i, nmi_count(i)); + for_each_online_cpu ( cpu ) + printk("%3d\t%3d\n", cpu, nmi_count(cpu)); =20 - if ( ((d =3D hardware_domain) =3D=3D NULL) || (d->vcpu =3D=3D NULL) || - ((v =3D d->vcpu[0]) =3D=3D NULL) ) + if ( !hardware_domain || !hardware_domain->vcpu || + !(v =3D hardware_domain->vcpu[0]) ) return; =20 - i =3D v->async_exception_mask & (1 << VCPU_TRAP_NMI); - if ( v->nmi_pending || i ) - printk("dom0 vpu0: NMI %s%s\n", - v->nmi_pending ? "pending " : "", - i ? "masked " : ""); + pend =3D v->nmi_pending; + mask =3D v->async_exception_mask & (1 << VCPU_TRAP_NMI); + if ( pend || mask ) + printk("%pv: NMI%s%s\n", + v, pend ? " pending" : "", mask ? " masked" : ""); else - printk("dom0 vcpu0: NMI neither pending nor masked\n"); + printk("%pv: NMI neither pending nor masked\n", v); } =20 static __init int register_nmi_trigger(void) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel