[PATCH v8 4/4] Documentation: document the preferred tag checking mode feature

Catalin Marinas catalin.marinas at arm.com
Thu Jul 1 10:04:50 PDT 2021


On Wed, Jun 30, 2021 at 04:15:09PM -0700, Peter Collingbourne wrote:
> +Per-CPU preferred tag checking mode
> +-----------------------------------
> +
> +On some CPUs the performance of MTE in stricter tag checking modes
> +is similar to that of less strict tag checking modes. This makes it
> +worthwhile to enable stricter checks on those CPUs when a less strict
> +checking mode is requested, in order to gain the error detection
> +benefits of the stricter checks without the performance downsides. To
> +support this scenario, a privileged user may configure a stricter
> +tag checking mode as the CPU's preferred tag checking mode.
> +
> +The preferred tag checking mode for each CPU is controlled by
> +``/sys/devices/system/cpu/cpu<N>/mte_tcf_preferred``, to which a
> +privileged user may write the value ``async`` or ``sync``.  The default
> +preferred mode for each CPU is ``async``.
> +
> +To allow a program to potentially run in the CPU's preferred tag
> +checking mode, the user program may set multiple tag check fault mode
> +bits in the ``flags`` argument to the ``prctl(PR_SET_TAGGED_ADDR_CTRL,
> +flags, 0, 0, 0)`` system call. If the CPU's preferred tag checking
> +mode is in the task's set of provided tag checking modes (this will
> +always be the case at present because the kernel only supports two
> +tag checking modes, but future kernels may support more modes), that
> +mode will be selected. Otherwise, one of the modes in the task's mode
> +set will be selected in a currently unspecified manner.

I'm ok with leaving this undefined (it's in the spirit of many
architecture features ;)). In practice we may choose async or asym over
sync but the user shouldn't care if it passed multiple flags.

-- 
Catalin



More information about the linux-arm-kernel mailing list