lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH 3/7] arm64: mm: use nGnRnE instead of nGnRE on Apple processors
On Thu, Jan 21, 2021 at 12:32 PM Will Deacon <will@kernel.org> wrote:
> On Wed, Jan 20, 2021 at 02:27:13PM +0100, Mohamed Mediouni wrote:
> > Use nGnRnE instead of nGnRE on Apple SoCs to workaround a serious hardware quirk.
> > /*
> > * Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and
> > * changed during __cpu_setup to Normal Tagged if the system supports MTE.
> > @@ -432,6 +451,13 @@ SYM_FUNC_START(__cpu_setup)
> > * Memory region attributes
> > */
> > mov_q x5, MAIR_EL1_SET
> > +#ifdef CONFIG_ARCH_APPLE
> > + mrs x0, MIDR_EL1
> > + lsr w0, w0, #24
> > + mov_q x1, MAIR_EL1_SET_APPLE
> > + cmp x0, #0x61 // 0x61 = Implementer: Apple
> > + csel x5, x1, x5, eq
>
> Why does this need to be done so early? It would be a lot cleaner if we
> could detect this in a similar fashion to other errata and update the MAIR
> appropriately. If that's not possible because of early IO mappings (which
> ones?), then we could instead initialise to nGnRnE unconditionally, but
> relax it to nGnRE if we detect that we _don't_ have the erratum.

There is (at least) the custom SMP startup code that uses device
mappings. If that's the only thing that needs the modified MAIR
to be used early, I'd consider that one more reason against doing the
custom cpu_operations for now.

Arnd

\
 
 \ /
  Last update: 2021-01-21 12:41    [W:0.189 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site