OrangePi_CM5/include
Peter Collingbourne 50829b8901 BACKPORT: arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS)
This change introduces a prctl that allows the user program to control
which PAC keys are enabled in a particular task. The main reason
why this is useful is to enable a userspace ABI that uses PAC to
sign and authenticate function pointers and other pointers exposed
outside of the function, while still allowing binaries conforming
to the ABI to interoperate with legacy binaries that do not sign or
authenticate pointers.

The idea is that a dynamic loader or early startup code would issue
this prctl very early after establishing that a process may load legacy
binaries, but before executing any PAC instructions.

This change adds a small amount of overhead to kernel entry and exit
due to additional required instruction sequences.

On a DragonBoard 845c (Cortex-A75) with the powersave governor, the
overhead of similar instruction sequences was measured as 4.9ns when
simulating the common case where IA is left enabled, or 43.7ns when
simulating the uncommon case where IA is disabled. These numbers can
be seen as the worst case scenario, since in more realistic scenarios
a better performing governor would be used and a newer chip would be
used that would support PAC unlike Cortex-A75 and would be expected
to be faster than Cortex-A75.

On an Apple M1 under a hypervisor, the overhead of the entry/exit
instruction sequences introduced by this patch was measured as 0.3ns
in the case where IA is left enabled, and 33.0ns in the case where
IA is disabled.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Link: https://linux-review.googlesource.com/id/Ibc41a5e6a76b275efbaa126b31119dc197b927a5
Link: https://lore.kernel.org/r/d6609065f8f40397a4124654eb68c9f490b4d477.1616123271.git.pcc@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 192536783
(cherry picked from commit 201698626fbca1cf1a3b686ba14cf2a056500716)
Change-Id: Ic0a21c92a22575f9ec3599fb67bd2931a50b9f04
[quic_eberman@quicinc.com: Resolved merge conflict in
 arch/arm64/kernel/process.c]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Peter Collingbourne <pcc@google.com>
2021-07-14 20:52:05 -07:00
..
acpi ACPI: scan: Use unique number for instance_no 2021-03-30 14:32:06 +02:00
asm-generic ANDROID: vmlinux.lds.h: Keep .eh_frame with CFI 2021-06-02 21:54:54 +00:00
clocksource
…
crypto FROMLIST: crypto: shash - stop comparing function pointers to avoid breaking CFI 2021-06-11 07:49:58 +00:00
drm UPSTREAM: drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-04-07 14:20:07 +00:00
dt-bindings FROMGIT: dt-bindings: connector: Replace BIT macro with generic bit ops 2021-06-07 06:15:29 +00:00
keys security: keys: trusted: fix TPM2 authorizations 2021-05-14 09:50:20 +02:00
kunit
…
kvm
…
linux ANDROID: cleancache: add oem data to cleancache_ops 2021-07-14 20:52:04 -07:00
math-emu
…
media ANDROID: add kabi padding for structures for the android12 release 2021-07-14 20:51:51 -07:00
memory
…
misc
…
net ANDROID: GKI: add vendor padding variable in struct sock 2021-07-14 20:52:03 -07:00
pcmcia
…
ras
…
rdma
…
scsi ANDROID: add kabi padding for structures for the android12 release 2021-07-14 20:51:51 -07:00
soc UPSTREAM: memory: mtk-smi: Allow building as module 2021-03-24 12:45:16 -07:00
sound ANDROID: add kabi padding for structures for the android12 release 2021-07-14 20:51:51 -07:00
target
…
trace ANDROID: GKI: net: add vendor hooks for 'struct sock' lifecycle 2021-07-14 20:52:04 -07:00
uapi BACKPORT: arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) 2021-07-14 20:52:05 -07:00
vdso
…
video
…
xen
…
OWNERS ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS 2021-04-03 14:11:30 +00:00