All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>,
	kernel-team@android.com,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	dianders@google.com, Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] arm64: Move handling of erratum 1418040 into C code
Date: Sat, 1 Aug 2020 12:41:46 +0100	[thread overview]
Message-ID: <20200801114145.GA18774@gaia> (raw)
In-Reply-To: <159621843473.1360974.5165992650144410881@swboyd.mtv.corp.google.com>

On Fri, Jul 31, 2020 at 11:00:34AM -0700, Stephen Boyd wrote:
> 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?

It's rather unnecessary, so it just makes the code a bit more
unreadable. I usually go by two questions:

1. Is the function required to be inlined for correct execution?

2. Is there a visible performance benefit by using __always_inline?
   (e.g. the compiler does a bad job)

For a static function called only in one place, the compiler usually
inlines it.

I can't speak on behalf of Will but from my perspective I'm against
adding __always_inline just because it's harmless (and occasionally I
edit it out of patches I apply manually).

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-01 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31  8:33 [PATCH v2 0/2] arm64: Allow erratum 1418040 for late CPUs Marc Zyngier
2020-07-31  8:33 ` [PATCH v2 1/2] arm64: Move handling of erratum 1418040 into C code Marc Zyngier
2020-07-31 10:41   ` Will Deacon
2020-07-31 11:14     ` Marc Zyngier
2020-07-31 11:32       ` Will Deacon
2020-07-31 18:00         ` Stephen Boyd
2020-08-01 11:41           ` Catalin Marinas [this message]
2020-07-31  8:33 ` [PATCH v2 2/2] arm64: Allow booting of late CPUs affected by erratum 1418040 Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200801114145.GA18774@gaia \
    --to=catalin.marinas@arm.com \
    --cc=dianders@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=suzuki.poulose@arm.com \
    --cc=swboyd@chromium.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.