[PATCH v2 1/2] arm64: Move handling of erratum 1418040 into C code
Stephen Boyd
swboyd at chromium.org
Fri Jul 31 14:00:34 EDT 2020
Quoting Will Deacon (2020-07-31 04:32:28)
> On Fri, Jul 31, 2020 at 12:14:40PM +0100, Marc Zyngier wrote:
> > On 2020-07-31 11:41, Will Deacon wrote:
> > > On Fri, Jul 31, 2020 at 09:33:57AM +0100, Marc Zyngier wrote:
> > > > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> > > > index 6089638c7d43..8bbf066224ab 100644
> > > > --- a/arch/arm64/kernel/process.c
> > > > +++ b/arch/arm64/kernel/process.c
> > > > @@ -515,6 +515,40 @@ static void entry_task_switch(struct
> > > > task_struct *next)
> > > > __this_cpu_write(__entry_task, next);
> > > > }
> > > >
> > > > +/*
> > > > + * ARM erratum 1418040 handling, affecting the 32bit view of CNTVCT.
> > > > + * Assuming the virtual counter is enabled at the beginning of times:
> > > > + *
> > > > + * - disable access when switching from a 64bit task to a 32bit task
> > > > + * - enable access when switching from a 32bit task to a 64bit task
> > > > + */
> > > > +static __always_inline
> > >
> > > Do we need the __always_inline? None of the other calls from
> > > __switch_to()
> > > have it.
> >
> > Suggestion from Stephen. In my experience, it doesn't change much as
> > most things get inlined anyway. Happy to drop it.
>
> Yes, please. We can add it back if it's shown to be a problem.
Just for my own edification, why is __always_inline undesirable? Should
there be an always inline version of the function that has the static
key so that the erratum path is kept out of the switch_to() default
path?
More information about the linux-arm-kernel
mailing list