aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2018-03-13 12:40:39 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2018-03-19 13:06:39 +0000
commit4205a89b8060141ac0216a507b9f70728f056a10 (patch)
tree644f8d7106da0caa44d9fd4b73b3f0e0e37d3745 /arch/arm64/include
parentarm/arm64: KVM: Introduce EL2-specific executable mappings (diff)
downloadlinux-dev-4205a89b8060141ac0216a507b9f70728f056a10.tar.xz
linux-dev-4205a89b8060141ac0216a507b9f70728f056a10.zip
arm64: Make BP hardening slot counter available
We're about to need to allocate hardening slots from other parts of the kernel (in order to support ARM64_HARDEN_EL2_VECTORS). Turn the counter into an atomic_t and make it available to the rest of the kernel. Also add BP_HARDEN_EL2_SLOTS as the number of slots instead of the hardcoded 4... Acked-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/mmu.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
index a050d4f3615d..3baf010fe883 100644
--- a/arch/arm64/include/asm/mmu.h
+++ b/arch/arm64/include/asm/mmu.h
@@ -21,6 +21,8 @@
#define USER_ASID_FLAG (UL(1) << USER_ASID_BIT)
#define TTBR_ASID_MASK (UL(0xffff) << 48)
+#define BP_HARDEN_EL2_SLOTS 4
+
#ifndef __ASSEMBLY__
typedef struct {
@@ -51,6 +53,7 @@ struct bp_hardening_data {
#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
extern char __bp_harden_hyp_vecs_start[], __bp_harden_hyp_vecs_end[];
+extern atomic_t arm64_el2_vector_last_slot;
DECLARE_PER_CPU_READ_MOSTLY(struct bp_hardening_data, bp_hardening_data);