Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Jan Beulich
On 18.02.2020 17:18, Roger Pau Monné wrote: > On Tue, Feb 18, 2020 at 04:40:29PM +0100, Jan Beulich wrote: >> On 18.02.2020 16:34, Andrew Cooper wrote: >>> On 18/02/2020 14:43, Roger Pau Monné wrote: OK, so what about: if ( in_mc() || in_nmi() ) { bool x2apic =

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2020 at 04:40:29PM +0100, Jan Beulich wrote: > On 18.02.2020 16:34, Andrew Cooper wrote: > > On 18/02/2020 14:43, Roger Pau Monné wrote: > >> On Tue, Feb 18, 2020 at 01:29:56PM +, Andrew Cooper wrote: > >>> On 18/02/2020 11:46, Roger Pau Monné wrote: > On Tue, Feb 18, 2020

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Jan Beulich
On 18.02.2020 16:34, Andrew Cooper wrote: > On 18/02/2020 14:43, Roger Pau Monné wrote: >> On Tue, Feb 18, 2020 at 01:29:56PM +, Andrew Cooper wrote: >>> On 18/02/2020 11:46, Roger Pau Monné wrote: On Tue, Feb 18, 2020 at 11:35:37AM +, Andrew Cooper wrote: > On 18/02/2020 11:22,

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 18/02/2020 14:43, Roger Pau Monné wrote: > On Tue, Feb 18, 2020 at 01:29:56PM +, Andrew Cooper wrote: >> On 18/02/2020 11:46, Roger Pau Monné wrote: >>> On Tue, Feb 18, 2020 at 11:35:37AM +, Andrew Cooper wrote: On 18/02/2020 11:22, Roger Pau Monné wrote: > On Tue, Feb 18, 2020

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2020 at 01:29:56PM +, Andrew Cooper wrote: > On 18/02/2020 11:46, Roger Pau Monné wrote: > > On Tue, Feb 18, 2020 at 11:35:37AM +, Andrew Cooper wrote: > >> > >> On 18/02/2020 11:22, Roger Pau Monné wrote: > >>> On Tue, Feb 18, 2020 at 11:21:12AM +, Andrew Cooper wrote:

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 18/02/2020 11:46, Roger Pau Monné wrote: > On Tue, Feb 18, 2020 at 11:35:37AM +, Andrew Cooper wrote: >> >> On 18/02/2020 11:22, Roger Pau Monné wrote: >>> On Tue, Feb 18, 2020 at 11:21:12AM +, Andrew Cooper wrote: On 18/02/2020 11:10, Roger Pau Monné wrote: > On Tue, Feb 18,

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2020 at 11:35:37AM +, Andrew Cooper wrote: > > > On 18/02/2020 11:22, Roger Pau Monné wrote: > > On Tue, Feb 18, 2020 at 11:21:12AM +, Andrew Cooper wrote: > >> On 18/02/2020 11:10, Roger Pau Monné wrote: > >>> On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 18/02/2020 11:28, Jan Beulich wrote: > On 18.02.2020 12:21, Andrew Cooper wrote: >> On 18/02/2020 11:10, Roger Pau Monné wrote: >>> On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: On 17/02/2020 18:43, Roger Pau Monne wrote: > @@ -67,7 +68,20 @@ static void

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 18/02/2020 11:22, Roger Pau Monné wrote: > On Tue, Feb 18, 2020 at 11:21:12AM +, Andrew Cooper wrote: >> On 18/02/2020 11:10, Roger Pau Monné wrote: >>> On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: On 17/02/2020 18:43, Roger Pau Monne wrote: > @@ -67,7 +68,20 @@

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Jan Beulich
On 18.02.2020 12:21, Andrew Cooper wrote: > On 18/02/2020 11:10, Roger Pau Monné wrote: >> On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: >>> On 17/02/2020 18:43, Roger Pau Monne wrote: @@ -67,7 +68,20 @@ static void send_IPI_shortcut(unsigned int shortcut, int vector,

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2020 at 11:21:12AM +, Andrew Cooper wrote: > On 18/02/2020 11:10, Roger Pau Monné wrote: > > On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: > >> On 17/02/2020 18:43, Roger Pau Monne wrote: > >>> @@ -67,7 +68,20 @@ static void send_IPI_shortcut(unsigned int

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 18/02/2020 11:10, Roger Pau Monné wrote: > On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: >> On 17/02/2020 18:43, Roger Pau Monne wrote: >>> @@ -67,7 +68,20 @@ static void send_IPI_shortcut(unsigned int shortcut, int >>> vector, >>> void send_IPI_mask(const cpumask_t *mask,

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2020 at 10:53:45AM +, Andrew Cooper wrote: > On 17/02/2020 18:43, Roger Pau Monne wrote: > > @@ -67,7 +68,20 @@ static void send_IPI_shortcut(unsigned int shortcut, int > > vector, > > void send_IPI_mask(const cpumask_t *mask, int vector) > > { > > bool cpus_locked =

Re: [Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-18 Thread Andrew Cooper
On 17/02/2020 18:43, Roger Pau Monne wrote: > @@ -67,7 +68,20 @@ static void send_IPI_shortcut(unsigned int shortcut, int > vector, > void send_IPI_mask(const cpumask_t *mask, int vector) > { > bool cpus_locked = false; > -cpumask_t *scratch = this_cpu(scratch_cpumask); > +

[Xen-devel] [PATCH v2 5/6] x86/smp: use a dedicated scratch cpumask in send_IPI_mask

2020-02-17 Thread Roger Pau Monne
Using scratch_cpumask in send_IPI_mak is not safe because it can be called from interrupt context, and hence Xen would have to make sure all the users of the scratch cpumask disable interrupts while using it. Instead introduce a new cpumask to be used by send_IPI_mask, and disable interrupts