[RFC PATCH v1 2/5] arm64: Add BBM Level 2 cpu feature
Mikołaj Lenczewski
miko.lenczewski at arm.com
Fri Dec 13 08:17:26 PST 2024
> > +static int do_conflict_abort(unsigned long far, unsigned long esr,
> > + struct pt_regs *regs)
> > +{
> > + if (!system_supports_bbml2())
> > + return do_bad(far, esr, regs);
> > +
> > + /* if we receive a TLB conflict abort, we know that there are multiple
> > + * TLB entries that translate the same address range. the minimum set
> > + * of invalidations to clear these entries is implementation defined.
> > + * the maximum set is defined as either tlbi(vmalls12e1) or tlbi(alle1).
> > + *
> > + * if el2 is enabled and stage 2 translation enabled, this may be
> > + * raised as a stage 2 abort. if el2 is enabled but stage 2 translation
> > + * disabled, or if el2 is disabled, it will be raised as a stage 1
> > + * abort.
> > + *
> > + * local_flush_tlb_all() does a tlbi(vmalle1), which is enough to
> > + * handle a stage 1 abort.
> > + */
> > +
> > + local_flush_tlb_all();
> > +
> > + return 0;
> > +}
>
> Can we actually guarantee that we make it this far without taking another
> abort? Given that I'm yet to see one of these things in the wild, I'm
> fairly opposed to pretending that we can handle them. We'd be much better
> off only violating BBM on CPUs that are known to handle the conflict
> gracefully. Judging by your later patch, this is practically keyed off
> the MIDR _anyway_...
>
> Will
Thanks for reviewing. Apologies for the delay in responding, and for
spam (replied instead of group-replied).
There should not be an option to take another fault while performing the
handler, as long as the mappings covering the fault handler table or any
code in this path are not screwed with. This is discussed further in the
resent patch series [1].
The MIDR revisions will be fixed. I was confused as to which revisions
were affected on an earlier version of the series, and had missed
updating them. The kconfig workarounds should be correct in this regard.
[1]: https://lore.kernel.org/all/084c5ada-51af-4c1a-b50a-4401e62ddbd6@arm.com/
More information about the linux-arm-kernel
mailing list