linux/arch/arm64/kernel
Mark Rutland 09ec66de84 UPSTREAM: arm64: mte: fix restoration of GCR_EL1 from suspend
Since commit:

  bad1e1c663 ("arm64: mte: switch GCR_EL1 in kernel entry and exit")

we saved/restored the user GCR_EL1 value at exception boundaries, and
update_gcr_el1_excl() is no longer used for this. However it is used to
restore the kernel's GCR_EL1 value when returning from a suspend state.
Thus, the comment is misleading (and an ISB is necessary).

When restoring the kernel's GCR value, we need an ISB to ensure this is
used by subsequent instructions. We don't necessarily get an ISB by
other means (e.g. if the kernel is built without support for pointer
authentication). As __cpu_setup() initialised GCR_EL1.Exclude to 0xffff,
until a context synchronization event, allocation tag 0 may be used
rather than the desired set of tags.

This patch drops the misleading comment, adds the missing ISB, and for
clarity folds update_gcr_el1_excl() into its only user.

Fixes: bad1e1c663 ("arm64: mte: switch GCR_EL1 in kernel entry and exit")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210714143843.56537-2-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 59f44069e0)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I1be6e588f9796ca5f01d2e9bd5e9743c40dc0778
2021-08-27 12:26:10 -07:00
..
probes arm64: kprobes: Restore local irqflag if kprobes is cancelled 2021-04-28 13:40:02 +02:00
vdso Merge 5.10.36 into android12-5.10 2021-05-13 14:22:11 +02:00
vdso32 UPSTREAM: arm64: vdso32: drop -no-integrated-as flag 2021-05-13 09:14:25 -07:00
.gitignore
acpi_numa.c
acpi_parking_protocol.c ANDROID: arm64: kernel: use __pa_function for secondary_entry 2021-02-05 02:28:53 +00:00
acpi.c arm64: permit ACPI core to map kernel memory used for table overrides 2020-09-30 22:27:51 +01:00
alternative.c UPSTREAM: arm64: alternatives: Remove READ_ONCE() usage during patch operation 2021-01-29 08:41:03 +00:00
armv8_deprecated.c BACKPORT: arm64: uaccess: rename privileged uaccess routines 2021-04-23 17:52:37 +02:00
asm-offsets.c FROMLIST: arm64: mte: rename gcr_user_excl to mte_ctrl 2021-07-14 20:52:05 -07:00
cacheinfo.c
cpu_errata.c UPSTREAM: arm64: spectre: Consolidate spectre-v3a detection 2021-01-28 17:57:08 +00:00
cpu_ops.c
cpu-reset.h ANDROID: arm64: add __va_function and __pa_function 2021-01-14 16:33:37 +00:00
cpu-reset.S FROMGIT: arm64: Use INIT_SCTLR_EL1_MMU_OFF to disable the MMU on CPU restart 2021-03-19 08:22:53 +00:00
cpufeature.c FROMGIT: arm64/cpufeature: Optionally disable MTE via command-line 2021-08-05 07:21:22 +00:00
cpuidle.c
cpuinfo.c FROMLIST: arm64: cpuinfo: Split AArch32 registers out into a separate struct 2021-02-05 09:20:52 +00:00
crash_core.c
crash_dump.c arm64: kdump: update ppos when reading elfcorehdr 2021-03-30 14:32:03 +02:00
debug-monitors.c BACKPORT: arm64: expose FAR_EL1 tag bits in siginfo 2021-01-22 10:09:05 -08:00
efi-entry.S
efi-header.S arm64: efi: increase EFI PE/COFF header padding to 64 KB 2020-10-28 14:02:03 +00:00
efi-rt-wrapper.S
efi.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
entry-common.c Merge 5.10.38 into android12-5.10 2021-05-20 15:35:25 +02:00
entry-fpsimd.S arm64/sve: Implement a helper to load SVE registers from FPSIMD state 2020-09-21 18:06:33 +01:00
entry-ftrace.S
entry.S FROMLIST: arm64: avoid double ISB on kernel entry 2021-07-14 20:52:06 -07:00
fpsimd.c BACKPORT: arm64: fpsimd: run kernel mode NEON with softirqs disabled 2021-05-13 07:53:33 +00:00
ftrace.c
head.S This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
hibernate-asm.S
hibernate.c UPSTREAM: arm64: mte: reset the page tag in page->flags 2021-01-19 21:47:29 -08:00
hw_breakpoint.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hyp-stub.S UPSTREAM: arm64: Add missing ISB after invalidating TLB in enter_vhe 2021-06-10 20:26:07 -07:00
idreg-override.c FROMGIT: arm64/cpufeature: Optionally disable MTE via command-line 2021-08-05 07:21:22 +00:00
image-vars.h FROMGIT: KVM: arm64: Generate final CTR_EL0 value when running in Protected mode 2021-03-31 08:23:20 +00:00
image.h arm64: get rid of TEXT_OFFSET 2020-09-07 15:00:52 +01:00
insn.c arm64: kprobe: disable probe of fault prone ptrauth instruction 2020-09-14 12:07:02 +01:00
io.c
irq.c UPSTREAM: arm64: scs: use vmapped IRQ and SDEI shadow stacks 2021-01-07 17:56:54 -08:00
jump_label.c
kaslr.c FROMGIT: arm64: Move "nokaslr" over to the early cpufeature infrastructure 2021-02-12 15:27:47 +00:00
kexec_image.c arm64: kexec_file: Fix sparse warning 2020-11-10 13:11:44 +00:00
kgdb.c
kuser32.S
machine_kexec_file.c arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails 2021-03-04 11:38:36 +01:00
machine_kexec.c
Makefile FROMGIT: arm64: cpufeature: Add an early command-line cpufeature override facility 2021-02-12 15:27:46 +00:00
module-plts.c ANDROID: arm64: module: preserve RELA sections for FIPS140 integrity selfcheck 2021-06-11 07:49:58 +00:00
module.c BACKPORT: kasan, arm64: expand CONFIG_KASAN checks 2021-01-19 21:47:30 -08:00
mte.c UPSTREAM: arm64: mte: fix restoration of GCR_EL1 from suspend 2021-08-27 12:26:10 -07:00
paravirt.c arm64: paravirt: Initialize steal time when cpu is online 2020-09-17 18:12:18 +01:00
pci.c
perf_callchain.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
perf_event.c arm64: perf: Fix 64-bit event counter read truncation 2021-03-17 17:06:28 +01:00
perf_regs.c perf/arch: Remove perf_sample_data::regs_user_copy 2020-11-09 18:12:34 +01:00
pointer_auth.c FROMLIST: arm64: move preemption disablement to prctl handlers 2021-07-14 20:52:05 -07:00
process.c FROMLIST: arm64: move preemption disablement to prctl handlers 2021-07-14 20:52:05 -07:00
proton-pack.c UPSTREAM: arm64: alternatives: Split up alternative.h 2021-01-29 08:41:02 +00:00
psci.c ANDROID: arm64: add __va_function and __pa_function 2021-01-14 16:33:37 +00:00
ptrace.c BACKPORT: arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) 2021-07-14 20:52:05 -07:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S arm64/relocate_kernel: remove redundant code 2020-09-11 19:06:25 +01:00
return_address.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
sdei.c UPSTREAM: arm64: sdei: Push IS_ENABLED() checks down to callee functions 2021-01-07 17:56:54 -08:00
setup.c FROMGIT: arm64: Extract early FDT mapping from kaslr_early_init() 2021-02-12 15:27:46 +00:00
signal.c BACKPORT: FROMLIST: arm64: Remove logic to kill 32-bit tasks on 64-bit-only cores 2021-02-05 09:20:54 +00:00
signal32.c
sigreturn32.S
sleep.S BACKPORT: kasan: remove redundant config option 2021-03-24 15:09:15 -07:00
smccc-call.S arm64/kernel: Remove needless Call Frame Information annotations 2020-09-01 09:50:36 +02:00
smp_spin_table.c ANDROID: arm64: add __va_function and __pa_function 2021-01-14 16:33:37 +00:00
smp.c FROMLIST: arm64: Mark the recheduling IPI as raw interrupt 2021-06-23 18:12:13 +00:00
stacktrace.c Merge 5.10.27 into android12-5.10 2021-04-02 15:25:50 +02:00
suspend.c BACKPORT: arm64: pac: Optimize kernel entry/exit key installation code paths 2021-07-14 20:52:05 -07:00
sys_compat.c BACKPORT: arm64: expose FAR_EL1 tag bits in siginfo 2021-01-22 10:09:05 -08:00
sys.c
sys32.c
syscall.c This is the 5.10.11 stable release 2021-01-27 12:12:33 +01:00
time.c
topology.c Power management updates for 5.10-rc1 2020-10-14 10:45:41 -07:00
trace-events-emulation.h
traps.c ANDROID: arm64: add vendor hooks for unusal abort cases 2021-03-11 19:59:21 +00:00
vdso.c arm64: vdso: Fix unusual formatting in *setup_additional_pages() 2020-09-01 13:37:57 +01:00
vmlinux.lds.S FROMGIT: arm64: Move .hyp.rodata outside of the _sdata.._edata range 2021-08-04 17:17:54 +00:00