mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64/gcs: Store the GCSCRE0_EL1 register value not userspace mode
@ 2026-09-17 22:14 Mark Brown
  2026-09-17 22:14 ` [PATCH 1/2] arm64/gcs: Move gcs_check_locked() out of the header Mark Brown
  2026-09-17 22:14 ` [PATCH 2/2] arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2026-09-17 22:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland
  Cc: linux-arm-kernel, linux-kernel, Mark Brown

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@kernel.org>
---
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@kernel.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-15 13:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 22:14 [PATCH 0/2] arm64/gcs: Store the GCSCRE0_EL1 register value not userspace mode Mark Brown
2026-09-17 22:14 ` [PATCH 1/2] arm64/gcs: Move gcs_check_locked() out of the header Mark Brown
2026-09-17 22:14 ` [PATCH 2/2] arm64: gcs: Store GCSCRE0_EL1 values instead of userspace mode Mark Brown
2026-10-14 17:30   ` Catalin Marinas
2026-10-14 18:28     ` Mark Brown
2026-10-15 12:04       ` Catalin Marinas
2026-10-15 13:02         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®