On Wed, Apr 14, 2021 at 3:10 AM Catalin Marinas <catalin.marinas@xxxxxxx> wrote: > > On Thu, 18 Mar 2021 20:10:52 -0700, Peter Collingbourne wrote: > > In an upcoming change we are going to introduce per-task SCTLR_EL1 > > bits for PAC. Move the existing per-task SCTLR_EL1 field out of the > > MTE-specific code so that we will be able to use it from both the > > PAC and MTE code paths and make the task switching code more efficient. > > Applied to arm64 (for-next/pac-set-get-enabled-keys). > > Peter, can you please have a look and give it a try as part of the arm64 > for-next/core branch? I rebased your patches on top of the > for-next/mte-async-kernel-mode branch as this was adding more code to > mte_thread_switch(), so I kept the function for now. > > Thanks. > > [1/3] arm64: mte: make the per-task SCTLR_EL1 field usable elsewhere > https://git.kernel.org/arm64/c/2f79d2fc391e > [2/3] arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) > https://git.kernel.org/arm64/c/201698626fbc > [3/3] arm64: pac: Optimize kernel entry/exit key installation code paths > https://git.kernel.org/arm64/c/b90e483938ce Hi Catalin, I tested the rebased patch series on an Apple M1 under a hypervisor with my Android forward-edge PAC prototype and it seems to work. I think it should be possible to get rid of at least one of the ISBs that are now on the task switch path, but let's leave that to a later patch. The patch series looks good otherwise. Peter