arm64/mm: Allocate PIE slots for EL0 guarded control stack
authorMark Brown <broonie@kernel.org>
Tue, 1 Oct 2024 22:58:52 +0000 (23:58 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Oct 2024 11:04:35 +0000 (12:04 +0100)
commit092055f1508cce6f60d4927fe8a048d76bbad73e
tree4ea6a2c656580d0db30953f5a309361ac25df84b
parent6487c963083c24ede289d4267ffa60a9db668cd4
arm64/mm: Allocate PIE slots for EL0 guarded control stack

Pages used for guarded control stacks need to be described to the hardware
using the Permission Indirection Extension, GCS is not supported without
PIE. In order to support copy on write for guarded stacks we allocate two
values, one for active GCSs and one for GCS pages marked as read only prior
to copy.

Since the actual effect is defined using PIE the specific bit pattern used
does not matter to the hardware but we choose two values which differ only
in PTE_WRITE in order to help share code with non-PIE cases.

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-13-222b78d87eee@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/pgtable-prot.h