From: Catalin Marinas <catalin.marinas@arm.com>
To: D Scott Phillips <scott@os.amperecomputing.com>
Cc: linux-arm-kernel@lists.infradead.org,
Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
Darren Hart <darren@os.amperecomputing.com>,
patches@amperecomputing.com
Subject: Re: [PATCH v5] arm64: errata: Fix exec handling in erratum 1418040 workaround
Date: Thu, 23 Dec 2021 11:43:47 +0000 [thread overview]
Message-ID: <YcRg86f9vOHs3MJh@arm.com> (raw)
In-Reply-To: <86wnjwfwk4.fsf@scott-ph-mail.amperecomputing.com>
On Wed, Dec 22, 2021 at 08:12:27AM -0800, D Scott Phillips wrote:
> Catalin Marinas <catalin.marinas@arm.com> writes:
> > On Mon, Dec 20, 2021 at 03:41:14PM -0800, D Scott Phillips wrote:
> >> The erratum 1418040 workaround enables CNTVCT_EL1 access trapping in EL0
> >> when executing compat threads. The workaround is applied when switching
> >> between tasks, but the need for the workaround could also change at an
> >> exec(), when a non-compat task execs a compat binary or vice versa. Apply
> >> the workaround in arch_setup_new_exec().
> >>
> >> This leaves a small window of time between SET_PERSONALITY and
> >> arch_setup_new_exec where preemption could occur and confuse the old
> >> workaround logic that compares TIF_32BIT between prev and next. Instead, we
> >> can just read cntkctl to make sure it's in the state that the next task
> >> needs. I measured cntkctl read time to be about the same as a mov from a
> >> general-purpose register on N1. Update the workaround logic to examine the
> >> current value of cntkctl instead of the previous task's compat state.
> >>
> >> Fixes: d49f7d7376d0 ("arm64: Move handling of erratum 1418040 into C code")
> >> Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
> >> Cc: <stable@vger.kernel.org> # 5.4.x
> >
> > Why 5.4? I think the fixed commit is 5.9.
>
> d49f7d7376d0 got backported into v5.4.62's 82b05f0838aa. That looks like
> that's the farthest it's made it back. Is this the correct way to handle
> fixing the backported change, or should a separate backport be sent to
> 5.4 for the fix?
If it applies cleanly to 5.4.62, I'll just tweak the fixes line back to
5.4 (I changed it to 5.9 as I have a git hook that adjusts the Fixes
line automatically when applying). If it doesn't apply cleanly, you can
send it separately.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-12-23 11:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 23:41 [PATCH v5] arm64: errata: Fix exec handling in erratum 1418040 workaround D Scott Phillips
2021-12-21 11:30 ` Catalin Marinas
2021-12-21 20:10 ` D Scott Phillips
2021-12-22 11:03 ` Catalin Marinas
2021-12-22 12:44 ` Marc Zyngier
2021-12-22 15:23 ` Catalin Marinas
2021-12-22 15:25 ` Catalin Marinas
2021-12-22 16:12 ` D Scott Phillips
2021-12-23 11:43 ` Catalin Marinas [this message]
2021-12-23 18:22 ` D Scott Phillips
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=YcRg86f9vOHs3MJh@arm.com \
--to=catalin.marinas@arm.com \
--cc=darren@os.amperecomputing.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=patches@amperecomputing.com \
--cc=scott@os.amperecomputing.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).