arm64/gcs: Provide basic EL2 setup to allow GCS usage at EL0 and EL1
authorMark Brown <broonie@kernel.org>
Tue, 1 Oct 2024 22:58:50 +0000 (23:58 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Oct 2024 11:04:35 +0000 (12:04 +0100)
commitff5181d8a2a82c982276a7e035896185c390e856
tree9ecf6c1057f230260f2955f6d46082c372c424f2
parentd0aa2b4351862cc2ce8d97e00c96bffc02ea16af
arm64/gcs: Provide basic EL2 setup to allow GCS usage at EL0 and EL1

There is a control HCRX_EL2.GCSEn which must be set to allow GCS
features to take effect at lower ELs and also fine grained traps for GCS
usage at EL0 and EL1.  Configure all these to allow GCS usage by EL0 and
EL1.

We also initialise GCSCR_EL1 and GCSCRE0_EL1 to ensure that we can
execute function call instructions without faulting regardless of the
state when the kernel is started.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20241001-arm64-gcs-v13-11-222b78d87eee@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/el2_setup.h