arm64: Ensure the secondary CPUs have safe ASIDBits size
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 23 Feb 2016 10:31:45 +0000 (10:31 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 25 Feb 2016 10:33:06 +0000 (10:33 +0000)
commit13f417f3b83f78de402f1674aa9009f778d768c3
treedc0dfd2833646daa589ece017497f61806e337bf
parent038dc9c66a0fe415e7f20ed38faab37b3ab92ae6
arm64: Ensure the secondary CPUs have safe ASIDBits size

Adds a hook for checking whether a secondary CPU has the
features used already by the kernel during early boot, based
on the boot CPU and plugs in the check for ASID size.

The ID_AA64MMFR0_EL1:ASIDBits determines the size of the mm context
id and is used in the early boot to make decisions. The value is
picked up from the Boot CPU and cannot be delayed until other CPUs
are up. If a secondary CPU has a smaller size than that of the Boot
CPU, things will break horribly and the usual SANITY check is not good
enough to prevent the system from crashing. So, crash the system with
enough information.

Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/mmu_context.h
arch/arm64/kernel/cpufeature.c
arch/arm64/mm/context.c