linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3 11/11] arm64: docs: document pointer authentication
Date: Wed, 25 Apr 2018 13:27:50 +0100	[thread overview]
Message-ID: <20180425122749.4eqhd2uiofoc7jyv@armageddon.cambridge.arm.com> (raw)
In-Reply-To: <20180417183735.56985-12-mark.rutland@arm.com>

On Tue, Apr 17, 2018 at 07:37:35PM +0100, Mark Rutland wrote:
> +Basic support
> +-------------
> +
> +When CONFIG_ARM64_PTR_AUTH is selected, and relevant HW support is
> +present, the kernel will assign a random APIAKey value to each process
> +at exec*() time. This key is shared by all threads within the process,
> +and the key is preserved across fork(). Presence of functionality using
> +APIAKey is advertised via HWCAP_APIA.
> +
> +Recent versions of GCC can compile code with APIAKey-based return
> +address protection when passed the -msign-return-address option. This
> +uses instructions in the HINT space, and such code can run on systems
> +without the pointer authentication extension.
> +
> +The remaining instruction and data keys (APIBKey, APDAKey, APDBKey) are
> +reserved for future use, and instructions using these keys must not be
> +used by software until a purpose and scope for their use has been
> +decided. To enable future software using these keys to function on
> +contemporary kernels, where possible, instructions using these keys are
> +made to behave as NOPs.
> +
> +The generic key (APGAKey) is currently unsupported. Instructions using
> +the generic key must not be used by software.
> +
> +
> +Debugging
> +---------
> +
> +When CONFIG_ARM64_PTR_AUTH is selected, and relevant HW support is
> +present, the kernel will expose the position of TTBR0 PAC bits in the
> +NT_ARM_PAC_MASK regset (struct user_pac_mask), which userspace can
> +acqure via PTRACE_GETREGSET.
> +
> +Separate masks are exposed for data pointers and instruction pointers,
> +as the set of PAC bits can vary between the two. Debuggers should not
> +expect that HWCAP_APIA implies the presence (or non-presence) of this
> +regset -- in future the kernel may support the use of APIBKey, APDAKey,
> +and/or APBAKey, even in the absence of APIAKey.
> +
> +Note that the masks apply to TTBR0 addresses, and are not valid to apply
> +to TTBR1 addresses (e.g. kernel pointers).

I'm fine with the rest of the series but I'd like the toolchain guys to
ack the ABI we are exposing (just this document is fine).

> +Virtualization
> +--------------
> +
> +Pointer authentication is not currently supported in KVM guests. KVM
> +will mask the feature bits from ID_AA64ISAR1_EL1, and attempted use of
> +the feature will result in an UNDEFINED exception being injected into
> +the guest.

I suspect at some point we'll see patches for KVM?

-- 
Catalin

      parent reply	other threads:[~2018-04-25 12:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 18:37 [PATCHv3 00/11] ARMv8.3 pointer authentication userspace support Mark Rutland
2018-04-17 18:37 ` [PATCHv3 01/11] arm64: add pointer authentication register bits Mark Rutland
2018-04-17 18:37 ` [PATCHv3 02/11] arm64/kvm: consistently handle host HCR_EL2 flags Mark Rutland
2018-04-27  9:51   ` Christoffer Dall
2018-04-27 10:13     ` Mark Rutland
2018-04-17 18:37 ` [PATCHv3 03/11] arm64/kvm: hide ptrauth from guests Mark Rutland
2018-04-18 13:19   ` Andrew Jones
2018-04-18 13:47     ` Mark Rutland
2018-04-27  9:51   ` Christoffer Dall
2018-04-17 18:37 ` [PATCHv3 04/11] arm64: Don't trap host pointer auth use to EL2 Mark Rutland
2018-04-27  9:52   ` Christoffer Dall
2018-04-17 18:37 ` [PATCHv3 05/11] arm64/cpufeature: detect pointer authentication Mark Rutland
2018-04-17 18:37 ` [PATCHv3 06/11] asm-generic: mm_hooks: allow hooks to be overridden individually Mark Rutland
2018-04-17 19:56   ` Arnd Bergmann
2018-04-18 11:38     ` Mark Rutland
2018-04-17 18:37 ` [PATCHv3 07/11] arm64: add basic pointer authentication support Mark Rutland
2018-04-25 11:23   ` Catalin Marinas
2018-04-27 10:27     ` Mark Rutland
2018-04-17 18:37 ` [PATCHv3 08/11] arm64: expose user PAC bit positions via ptrace Mark Rutland
2018-04-17 18:37 ` [PATCHv3 09/11] arm64: perf: strip PAC when unwinding userspace Mark Rutland
2018-04-17 18:37 ` [PATCHv3 10/11] arm64: enable pointer authentication Mark Rutland
2018-04-17 18:37 ` [PATCHv3 11/11] arm64: docs: document " Mark Rutland
2018-04-22  8:05   ` Pavel Machek
2018-04-22  8:47     ` Marc Zyngier
2018-04-22  9:00       ` Pavel Machek
2018-04-25 12:27   ` Catalin Marinas [this message]

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=20180425122749.4eqhd2uiofoc7jyv@armageddon.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).