[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 2/2] x86: add accessors for scratch cpu mask


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 11 Mar 2020 16:51:18 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 11 Mar 2020 15:51:44 +0000
  • Ironport-sdr: q8g+iyZ+bQXMVpswYGw0v3NgSjsYu+KXadUG7G5kHHb8Co8dlxHBlsfRodurshz275Xh70btK1 rGYkpR437DWEAu+6cGVeras/5zsv+XRJMoPpGXhNne4xBHA9KjP7ttt4dLpM3pNBDreRoDhKGP Qw8H4cqfQQiwdqcGJ+yHQisywWDEH8/XbD26BbSQtNj3+e8ObfnOodLOGWDNtPaXzOLCQU3IQ+ IKdcj5X9+UkL+4N75uBp9zB1oOwebKgtum2/lWtHCOKJAogUSz8fyuY6cti7nwrLC3de6gpX/F pms=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Mar 11, 2020 at 04:37:50PM +0100, Jan Beulich wrote:
> On 11.03.2020 16:34, Roger Pau Monné wrote:
> > On Fri, Feb 28, 2020 at 01:42:58PM +0100, Jan Beulich wrote:
> >> On 28.02.2020 13:07, Roger Pau Monne wrote:
> >>> Current usage of the per-CPU scratch cpumask is dangerous since
> >>> there's no way to figure out if the mask is already being used except
> >>> for manual code inspection of all the callers and possible call paths.
> >>>
> >>> This is unsafe and not reliable, so introduce a minimal get/put
> >>> infrastructure to prevent nested usage of the scratch mask and usage
> >>> in interrupt context.
> >>>
> >>> Move the declaration of scratch_cpumask to smp.c in order to place the
> >>> declaration and the accessors as close as possible.
> >>>
> >>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> >>
> >> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> > 
> > Ping? This seems to have the required RB, but hasn't been committed.
> 
> While as per the R-b this technically is fine, I continue to be
> uncertain whether we actually want to go this far.

If this had been in place 5500d265a2a8fa6 ('x86/smp: use APIC ALLBUT
destination shorthand when possible') wouldn't have introduced a
bogus usage of the scratch per cpu mask, as the check would have
triggered.

After finding that one of my commits introduced a bug I usually do the
exercise of trying to figure out which checks or safeguards would have
prevented it, and hence came up with this patch.

I would also like to note that this adds 0 overhead to non-debug
builds.

> Andrew, as
> per a discussion we had when I was pondering whether to commit
> this, also looks to have similar concerns (which iirc he said he
> had voiced on irc).

Is the concern only related to the fact that you have to use the
get/put accessors and thus more lines of code are added, or is there
something else?

Thanks, Roger.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.