[PATCH v1 1/3] arm64: Add BBM Level 2 cpu feature

Mikołaj Lenczewski miko.lenczewski at arm.com
Thu Feb 20 01:37:00 PST 2025


Hi Oliver,

Thank you for taking the time to review this patch series.

On Wed, Feb 19, 2025 at 03:57:43PM -0800, Oliver Upton wrote:
> On Wed, Feb 19, 2025 at 03:34:12PM -0800, Oliver Upton wrote:
> > Hi Miko,
> > 
> > On Wed, Feb 19, 2025 at 02:38:38PM +0000, Mikołaj Lenczewski wrote:
> > > +config ARM64_ENABLE_BBML2
> > 
> > nit: consider calling this ARM64_BBML2_NOABORT or similar, since this
> > assumes behavior that exceeds the BBML2 baseline.
> > 

That is a better phrasing, will change this.

> > > +	bool "Enable support for Break-Before-Make Level 2 detection and usage"
> > > +	default y
> > > +	help
> > > +	  FEAT_BBM provides detection of support levels for break-before-make
> > > +	  sequences. If BBM level 2 is supported, some TLB maintenance requirements
> > > +	  can be relaxed to improve performance. Selecting N causes the kernel to
> > > +	  fallback to BBM level 0 behaviour even if the system supports BBM level 2.
> > > +
> > 
> > [...]
> > 

I will assume you mean to add the comment about this technically
exceeding the BBML2 baseline to the docs here as well? Or am I
misunderstanding?

> > > +static bool has_bbml2_noconflict(const struct arm64_cpu_capabilities *entry,
> > > +				 int scope)
> > > +{
> > > +	if (!IS_ENABLED(CONFIG_ARM64_ENABLE_BBML2))
> > > +		return false;
> > > +
> > > +	/* We want to allow usage of bbml2 in as wide a range of kernel contexts
> > > +	 * as possible. This list is therefore an allow-list of known-good
> > > +	 * implementations that both support bbml2 and additionally, fulfil the
> > 
> > typo: fullfill
> 
> I can't spell either ;-)

Spelling is hard, will fix :)

> > > +	 * extra constraint of never generating TLB conflict aborts when using
> > > +	 * the relaxed bbml2 semantics (such aborts make use of bbml2 in certain
> > > +	 * kernel contexts difficult to prove safe against recursive aborts).
> > > +	 */
> > 
> > We should be *very* specific of what qualifies a 'known-good'
> > implementation here. Implementations shouldn't be added to this list
> > based on the observed behavior, only if *the implementer* states their
> > design will not generate conflict aborts for BBML2 mapping granularity
> > changes.
> > 

Understood, will clarify.

> > > diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
> > > index 1e65f2fb45bd..8d67bb4448c5 100644
> > > --- a/arch/arm64/tools/cpucaps
> > > +++ b/arch/arm64/tools/cpucaps
> > > @@ -26,6 +26,7 @@ HAS_ECV
> > >  HAS_ECV_CNTPOFF
> > >  HAS_EPAN
> > >  HAS_EVT
> > > +HAS_BBML2_NOCONFLICT
> > 
> > Please add this cap to cpucap_is_possible() test for the config option.
> > 

Sure, will do so.

-- 
Kind regards,
Mikołaj Lenczewski



More information about the linux-arm-kernel mailing list