From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 1/3] x86/nmi: Corrections and improvements to do_nmi_stats()
Date: Mon, 17 Feb 2020 11:17:38 +0000 [thread overview]
Message-ID: <20200217111740.7298-2-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20200217111740.7298-1-andrew.cooper3@citrix.com>
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 <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
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)
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;
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));
- if ( ((d = hardware_domain) == NULL) || (d->vcpu == NULL) ||
- ((v = d->vcpu[0]) == NULL) )
+ if ( !hardware_domain || !hardware_domain->vcpu ||
+ !(v = hardware_domain->vcpu[0]) )
return;
- i = 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 = v->nmi_pending;
+ mask = 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);
}
static __init int register_nmi_trigger(void)
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-02-17 11:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 11:17 [Xen-devel] [PATCH 0/3] xen: async_exception_* cleanup Andrew Cooper
2020-02-17 11:17 ` Andrew Cooper [this message]
2020-02-18 16:07 ` [Xen-devel] [PATCH 1/3] x86/nmi: Corrections and improvements to do_nmi_stats() Jan Beulich
2020-02-17 11:17 ` [Xen-devel] [PATCH 2/3] xen: Move async_exception_* infrastructure into x86 Andrew Cooper
2020-02-18 16:11 ` Jan Beulich
2020-02-18 16:23 ` Andrew Cooper
2020-02-17 11:17 ` [Xen-devel] [PATCH 3/3] xen/x86: Rename and simplify async_event_* infrastructure Andrew Cooper
2020-02-18 16:31 ` Jan Beulich
2020-02-20 18:24 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200217111740.7298-2-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.