All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.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>
Subject: Re: [Xen-devel] [PATCH v2 0/6] x86: fixes/improvements for scratch cpumask
Date: Tue, 18 Feb 2020 08:40:58 +0100	[thread overview]
Message-ID: <cec31639-00ce-8ef1-4a7e-1d85a92b820e@suse.com> (raw)
In-Reply-To: <20200217184324.73762-1-roger.pau@citrix.com>

On 17.02.20 19:43, Roger Pau Monne wrote:
> Hello,
> 
> Commit:
> 
> 5500d265a2a8fa63d60c08beb549de8ec82ff7a5
> x86/smp: use APIC ALLBUT destination shorthand when possible
> 
> Introduced a bogus usage of the scratch cpumask: it was used in a
> function that could be called from interrupt context, and hence using
> the scratch cpumask there is not safe. Patch #5 is a fix for that usage,
> together with also preventing the usage of any per-CPU variables when
> send_IPI_mask is called from #MC or #NMI context. Previous patches are
> preparatory changes.
> 
> Patch #6 adds some debug infrastructure to make sure the scratch cpumask
> is used in the right context, and hence should prevent further missuses.

I wonder whether it wouldn't be better to have a common percpu scratch
cpumask handling instead of introducing local ones all over the
hypervisor.

So basically an array of percpu cpumasks allocated when bringing up a
cpu (this spares memory as the masks wouldn't need to cover NR_CPUS
cpus), a percpu counter of the next free index and get_ and put_
functions acting in a lifo manner.

This would help removing all the still existing cpumasks on the stack
and any illegal nesting would be avoided. The only remaining question
would be the size of the array.

Thoughts?


Juergen

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

  parent reply	other threads:[~2020-02-18  7:41 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é
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 ` Jürgen Groß [this message]
2020-02-18 10:15   ` [Xen-devel] [PATCH v2 0/6] x86: fixes/improvements for scratch cpumask 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=cec31639-00ce-8ef1-4a7e-1d85a92b820e@suse.com \
    --to=jgross@suse.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=roger.pau@citrix.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.