All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH v2 3/6] x86: track when in #MC context
Date: Tue, 18 Feb 2020 10:45:34 +0100	[thread overview]
Message-ID: <20200218094534.GO4679@Air-de-Roger> (raw)
In-Reply-To: <69fbdc2a-e64b-ff93-6392-661ca71a88a7@xen.org>

On Mon, Feb 17, 2020 at 07:29:29PM +0000, Julien Grall wrote:
> Hi Roger,
> 
> On 17/02/2020 18:43, Roger Pau Monne wrote:
> > Add helpers to track when executing in #MC context. This is modeled
> > after the in_irq helpers.
> > 
> > Note that there are no users of in_mc() introduced by the change,
> > further users will be added by followup changes.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> >   xen/arch/x86/cpu/mcheck/mce.c | 2 ++
> >   xen/include/asm-x86/hardirq.h | 5 +++++
> >   xen/include/xen/irq_cpustat.h | 1 +
> >   3 files changed, 8 insertions(+)
> > 
> > diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
> > index d61e582af3..93ed5752ac 100644
> > --- a/xen/arch/x86/cpu/mcheck/mce.c
> > +++ b/xen/arch/x86/cpu/mcheck/mce.c
> > @@ -93,7 +93,9 @@ void x86_mce_vector_register(x86_mce_vector_t hdlr)
> >   void do_machine_check(const struct cpu_user_regs *regs)
> >   {
> > +    mc_enter();
> >       _machine_check_vector(regs);
> > +    mc_exit();
> >   }
> >   /*
> > diff --git a/xen/include/asm-x86/hardirq.h b/xen/include/asm-x86/hardirq.h
> > index 34e1b49260..af3eab6a4d 100644
> > --- a/xen/include/asm-x86/hardirq.h
> > +++ b/xen/include/asm-x86/hardirq.h
> > @@ -8,6 +8,7 @@ typedef struct {
> >   	unsigned int __softirq_pending;
> >   	unsigned int __local_irq_count;
> >   	unsigned int __nmi_count;
> > +	unsigned int mc_count;
> >   	bool_t __mwait_wakeup;
> >   } __cacheline_aligned irq_cpustat_t;
> > @@ -18,6 +19,10 @@ typedef struct {
> >   #define irq_enter()	(local_irq_count(smp_processor_id())++)
> >   #define irq_exit()	(local_irq_count(smp_processor_id())--)
> > +#define in_mc() 	(mc_count(smp_processor_id()) != 0)
> > +#define mc_enter()	(mc_count(smp_processor_id())++)
> > +#define mc_exit()	(mc_count(smp_processor_id())--)
> > +
> >   void ack_bad_irq(unsigned int irq);
> >   extern void apic_intr_init(void);
> > diff --git a/xen/include/xen/irq_cpustat.h b/xen/include/xen/irq_cpustat.h
> > index 73629f6ec8..12b932fc39 100644
> > --- a/xen/include/xen/irq_cpustat.h
> > +++ b/xen/include/xen/irq_cpustat.h
> > @@ -26,5 +26,6 @@ extern irq_cpustat_t irq_stat[];
> >   #define local_irq_count(cpu)	__IRQ_STAT((cpu), __local_irq_count)
> >   #define nmi_count(cpu)		__IRQ_STAT((cpu), __nmi_count)
> >   #define mwait_wakeup(cpu)	__IRQ_STAT((cpu), __mwait_wakeup)
> > +#define mc_count(cpu)		__IRQ_STAT((cpu), mc_count)
> 
> The header is only meant to contain arch-independent IRQ stats (see comment
> a few lines above). This is unlikely to be used on Arm, so can you move this
> into an x86 specific header?

Uh, sure. Sorry for not realizing this.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-02-18  9:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 18:43 [Xen-devel] [PATCH v2 0/6] x86: fixes/improvements for scratch cpumask Roger Pau Monne
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 1/6] x86/smp: unify header includes in smp.h Roger Pau Monne
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 2/6] x86: introduce a nmi_count tracking variable Roger Pau Monne
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 3/6] x86: track when in #MC context Roger Pau Monne
2020-02-17 19:29   ` Julien Grall
2020-02-18  9:45     ` Roger Pau Monné [this message]
2020-02-18  9:48     ` Roger Pau Monné
2020-02-18 11:20       ` Julien Grall
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 4/6] x86: track when in #NMI context Roger Pau Monne
2020-02-18 10:40   ` Andrew Cooper
2020-02-18 10:59     ` Roger Pau Monné
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask Roger Pau Monne
2020-02-18 10:53   ` Andrew Cooper
2020-02-18 11:10     ` Roger Pau Monné
2020-02-18 11:21       ` Andrew Cooper
2020-02-18 11:22         ` Roger Pau Monné
2020-02-18 11:35           ` Andrew Cooper
2020-02-18 11:46             ` Roger Pau Monné
2020-02-18 13:29               ` Andrew Cooper
2020-02-18 14:43                 ` Roger Pau Monné
2020-02-18 15:34                   ` Andrew Cooper
2020-02-18 15:40                     ` Jan Beulich
2020-02-18 16:18                       ` Roger Pau Monné
2020-02-18 16:33                         ` Jan Beulich
2020-02-18 11:28         ` Jan Beulich
2020-02-18 11:44           ` Andrew Cooper
2020-02-17 18:43 ` [Xen-devel] [PATCH v2 6/6] x86: add accessors for scratch cpu mask Roger Pau Monne
2020-02-18  7:40 ` [Xen-devel] [PATCH v2 0/6] x86: fixes/improvements for scratch cpumask Jürgen Groß
2020-02-18 10:15   ` Roger Pau Monné
2020-02-18 10:46     ` Jürgen Groß
2020-02-18 10:26   ` Andrew Cooper
2020-02-18 10:54     ` Jürgen Groß

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=20200218094534.GO4679@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --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.