[PATCH 0/2] arm64/gcs: Store the GCSCRE0_EL1 register value not userspace mode
From: Mark Brown
Date: Thu Sep 17 2026 - 18:27:38 EST
At present we store the userspace GCS mode for a task using the prctl()
value set by userspace rather than the mode configuration written to
GCSCRE0_EL1 which means the register value needs to be generated on each
task switch when the new task uses GCS. Since the mapping between the
two is easily reversable switch things around and store the value that
we need in the context switch path.
Do a small refactoring to move code out of the header, then make the
switch.
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
Mark Brown (2):
arm64/gcs: Move gcs_check_locked() out of the header
arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode
arch/arm64/include/asm/gcs.h | 22 ++++-----------
arch/arm64/include/asm/processor.h | 2 +-
arch/arm64/kernel/process.c | 11 ++++----
arch/arm64/kernel/ptrace.c | 4 +--
arch/arm64/kernel/signal.c | 8 +++---
arch/arm64/mm/gcs.c | 58 +++++++++++++++++++++++++++-----------
6 files changed, 59 insertions(+), 46 deletions(-)
---
base-commit: c2cd463d6ee7d55a3ec0719d93c49ff99022d58f
change-id: 20260911-arm64-gcs-store-gcscre0-2e3e246e6f7a
prerequisite-change-id: 20260910-arm64-gcs-lock-eperm-06ce8f8e5250
Best regards,
--
Mark Brown <broonie@xxxxxxxxxx>