arm64: add runtime system sanity checks
authorMark Rutland <mark.rutland@arm.com>
Wed, 16 Jul 2014 15:32:46 +0000 (16:32 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Jul 2014 14:24:11 +0000 (15:24 +0100)
commit127161aaf0fcd37680984f79e1451b870b3e310a
tree66f405041d7673f64cf9c7c1139ff8d2e8f6d043
parent59ccc0d41b7a60c82c636cd056021f522c30557e
arm64: add runtime system sanity checks

Unexpected variation in certain system register values across CPUs is an
indicator of potential problems with a system. The kernel expects CPUs
to be mostly identical in terms of supported features, even in systems
with heterogeneous CPUs, with uniform instruction set support being
critical for the correct operation of userspace.

To help detect issues early where hardware violates the expectations of
the kernel, this patch adds simple runtime sanity checks on important ID
registers in the bring up path of each CPU.

Where CPUs are fundamentally mismatched, set TAINT_CPU_OUT_OF_SPEC.
Given that the kernel assumes CPUs are identical feature wise, let's not
pretend that we expect such configurations to work. Supporting such
configurations would require massive rework, and hopefully they will
never exist.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/cpuinfo.c