Skip to content

arm64: mte: allow async MTE to be upgraded to sync on a per-CPU basis

Peter Collingbourne linux-arm-kernel 11 versions – Applied

Status from this message: Applied to arm64 (for-next/mte) but first added Will's acks from v10 an

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v11 Latest5 patches 3 repliesApplied
  2. v105 patches 7 repliesSuperseded
  3. v94 patches 11 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v84 patches7 repliesSuperseded
v71 patch2 repliesSuperseded
v61 patch0 repliesSuperseded
v51 patch33 repliesSuperseded
v41 patch2 repliesSuperseded
v31 patch4 repliesSuperseded
v21 patch4 repliesSuperseded
v11 patch6 repliesSuperseded

v8 from the cover letter

- split into multiple patches
- remove MTE_CTRL_TCF_NONE
- improve documentation
- disable preemption and add comment to mte_update_sctlr_user
- bring back PR_MTE_TCF_SHIFT for source compatibility
- address formatting nit

Patches in v11 Applied

#Subject and filesSizeRepliesApplied
1/5arm64: mte: rename gcr_user_excl to mte_ctrlarch/arm64/include/asm/processor.h arch/arm64/kernel/asm-offsets.c arch/arm64/kernel/entry.S +1 more+15 -100 replies
2/5arm64: mte: change ASYNC and SYNC TCF settings into bitfieldsarch/arm64/include/asm/processor.h arch/arm64/kernel/mte.c include/uapi/linux/prctl.h+37 -470 replies
3/5arm64: move preemption disablement to prctl handlersarch/arm64/include/asm/pointer_auth.h arch/arm64/include/asm/processor.h arch/arm64/kernel/mte.c +2 more+24 -290 replies
4/5arm64: mte: introduce a per-CPU tag checking mode preferencearch/arm64/kernel/mte.c+63 -20 replies
5/5Documentation: document the preferred tag checking mode featureDocumentation/ABI/testing/sysfs-devices-system-cpu Documentation/arm64/memory-tagging-extension.rst+59 -72 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchCatalin MarinasWill Deacon
1/5R-b
2/5R-b
3/5
4/5R-b
5/5R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v11 thread

Cover letter [PATCH v11 0/5] arm64: mte: allow async MTE to be upgraded to sync on a per-CPU basis

On some CPUs the performance of MTE in synchronous mode is similar to that of asynchronous mode. This makes it worthwhile to enable synchronous mode on those CPUs when asynchronous mode is requested, in order to gain the error detection benefits of synchronous mode without the performance downsides. Therefore, make it possible for user programs to opt into upgrading to synchronous mode on those CPUs.

This is done by introducing a notion of a preferred TCF mode, which is controlled on a per-CPU basis by a sysfs node. The existing SYNC and ASYNC TCF settings are repurposed as bitfields that specify a set of possible modes. If the preferred TCF mode for a particular CPU is in the user-provided mode set (this will always be the case for mode sets containing more than one mode because the kernel only supports two tag checking modes, but future kernels may support more modes) then that mode is used when running on that CPU, otherwise one of the modes in the task's mode set will be selected in a currently unspecified manner.

v8:
- split into multiple patches
- remove MTE_CTRL_TCF_NONE
- improve documentation
- disable preemption and add comment to mte_update_sctlr_user
- bring back PR_MTE_TCF_SHIFT for source compatibility
- address formatting nit

v7:
- switch to new API proposed on list

v6:
- switch to strings in sysfs nodes instead of TCF values

v5:
- updated documentation
- address some nits in mte.c

v4:
- switch to new mte_ctrl field
- make register_mte_upgrade_async_sysctl return an int
- change the sysctl to take 0 or 1 instead of raw TCF values
- "same as" -> "similar to"

v3:
- drop the device tree support
- add documentation
- add static_assert to ensure no overlap with real HW bits
- move per-CPU variable initialization to mte.c
- use smp_call_function_single instead of stop_machine

v2:
- make it an opt-in behavior
- change the format of the device tree node
- also allow controlling the feature via sysfs

Peter Collingbourne (5):
arm64: mte: rename gcr_user_excl to mte_ctrl
arm64: mte: change ASYNC and SYNC TCF settings into bitfields
arm64: move preemption disablement to prctl handlers
arm64: mte: introduce a per-CPU tag checking mode preference
Documentation: document the preferred tag checking mode feature

 .../ABI/testing/sysfs-devices-system-cpu      |  18 +++
 .../arm64/memory-tagging-extension.rst        |  48 +++++-
 arch/arm64/include/asm/pointer_auth.h         |  12 +-
 arch/arm64/include/asm/processor.h            |  10 +-
 arch/arm64/kernel/asm-offsets.c               |   2 +-
 arch/arm64/kernel/entry.S                     |   4 +-
 arch/arm64/kernel/mte.c                       | 139 ++++++++++++------
 arch/arm64/kernel/pointer_auth.c              |  10 +-
 arch/arm64/kernel/process.c                   |  21 +--
 include/uapi/linux/prctl.h                    |  11 +-
 10 files changed, 189 insertions(+), 86 deletions(-)
Signature · 7 lines
2.32.0.432.gabb21c7263-goog


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel