From: Peter Collingbourne <pcc@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Will Deacon <will@kernel.org>
Cc: Peter Collingbourne <pcc@google.com>,
Evgenii Stepanov <eugenis@google.com>,
Szabolcs Nagy <szabolcs.nagy@arm.com>,
Tejas Belagod <Tejas.Belagod@arm.com>,
linux-arm-kernel@lists.infradead.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH v9 0/4] arm64: mte: allow async MTE to be upgraded to sync on a per-CPU basis
Date: Fri, 2 Jul 2021 12:41:06 -0700 [thread overview]
Message-ID: <20210702194110.2045282-1-pcc@google.com> (raw)
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 (4):
arm64: mte: rename gcr_user_excl to mte_ctrl
arm64: mte: change ASYNC and SYNC TCF settings into bitfields
arm64: mte: introduce a per-CPU tag checking mode preference
Documentation: document the preferred tag checking mode feature
.../ABI/testing/sysfs-devices-system-cpu | 16 ++
.../arm64/memory-tagging-extension.rst | 48 +++++-
arch/arm64/include/asm/processor.h | 8 +-
arch/arm64/kernel/asm-offsets.c | 2 +-
arch/arm64/kernel/entry.S | 4 +-
arch/arm64/kernel/mte.c | 149 ++++++++++++------
include/uapi/linux/prctl.h | 11 +-
7 files changed, 178 insertions(+), 60 deletions(-)
--
2.32.0.93.g670b81a890-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-07-02 19:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 19:41 Peter Collingbourne [this message]
2021-07-02 19:41 ` [PATCH v9 1/4] arm64: mte: rename gcr_user_excl to mte_ctrl Peter Collingbourne
2021-07-13 17:50 ` Will Deacon
2021-07-02 19:41 ` [PATCH v9 2/4] arm64: mte: change ASYNC and SYNC TCF settings into bitfields Peter Collingbourne
2021-07-07 11:10 ` Will Deacon
2021-07-12 19:04 ` Peter Collingbourne
2021-07-13 17:27 ` Will Deacon
2021-07-13 22:52 ` Peter Collingbourne
2021-07-02 19:41 ` [PATCH v9 3/4] arm64: mte: introduce a per-CPU tag checking mode preference Peter Collingbourne
2021-07-07 11:15 ` Will Deacon
2021-07-12 18:59 ` Peter Collingbourne
2021-07-13 17:48 ` Will Deacon
2021-07-13 22:46 ` Peter Collingbourne
2021-07-02 19:41 ` [PATCH v9 4/4] Documentation: document the preferred tag checking mode feature Peter Collingbourne
2021-07-13 17:53 ` Will Deacon
2021-07-13 22:55 ` Peter Collingbourne
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=20210702194110.2045282-1-pcc@google.com \
--to=pcc@google.com \
--cc=Tejas.Belagod@arm.com \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=szabolcs.nagy@arm.com \
--cc=vincenzo.frascino@arm.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 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.