[PATCH v2] arm64: mte: avoid clearing PSTATE.TCO on entry unless necessary

Peter Collingbourne pcc at google.com
Fri Dec 3 10:33:24 PST 2021


On Wed, Nov 10, 2021 at 2:07 PM Peter Collingbourne <pcc at google.com> wrote:
>
> On some microarchitectures, clearing PSTATE.TCO is expensive. Clearing
> TCO is only necessary if in-kernel MTE is enabled, or if MTE is
> enabled in the userspace process in synchronous (or, soon, asymmetric)
> mode, because we do not report uaccess faults to userspace in none
> or asynchronous modes. Therefore, adjust the kernel entry code to
> clear TCO only if necessary.
>
> Because it is now possible to switch to a task in which TCO needs to
> be clear from a task in which TCO is set, we also need to do the same
> thing on task switch.
>
> Signed-off-by: Peter Collingbourne <pcc at google.com>
> Link: https://linux-review.googlesource.com/id/I52d82a580bd0500d420be501af2c35fa8c90729e
> ---
> v2:
> - do the same thing in cpu_switch_to()

Ping.

Peter



More information about the linux-arm-kernel mailing list