arm64: Cope with CPUs stuck in VHE mode
authorMarc Zyngier <maz@kernel.org>
Thu, 8 Apr 2021 13:10:09 +0000 (14:10 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 8 Apr 2021 17:45:16 +0000 (18:45 +0100)
commit31a32b49b80f79cbb84a9c948c5609c6fc044443
treee05bd1f6475ece8044c9d61a1b1a46e00c4c6996
parentcac642c12a805ae7565a263b59fb94ad19e81952
arm64: Cope with CPUs stuck in VHE mode

It seems that the CPUs part of the SoC known as Apple M1 have the
terrible habit of being stuck with HCR_EL2.E2H==1, in violation
of the architecture.

Try and work around this deplorable state of affairs by detecting
the stuck bit early and short-circuit the nVHE dance. Additional
filtering code ensures that attempts at switching to nVHE from
the command-line are also ignored.

It is still unknown whether there are many more such nuggets
to be found...

Reported-by: Hector Martin <marcan@marcan.st>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210408131010.1109027-3-maz@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/head.S
arch/arm64/kernel/hyp-stub.S
arch/arm64/kernel/idreg-override.c