KVM: arm64: Generate final CTR_EL0 value when running in Protected mode
authorMarc Zyngier <maz@kernel.org>
Mon, 22 Mar 2021 12:09:51 +0000 (12:09 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 25 Mar 2021 11:00:33 +0000 (11:00 +0000)
commit755db23420a1ce4b740186543432983e9bbe713e
treeae61e46ebac9d8b0857e4a91aca47128b99076f5
parent90134ac9cabb69972d0a509bf08e108a73442184
KVM: arm64: Generate final CTR_EL0 value when running in Protected mode

In protected mode, late CPUs are not allowed to boot (enforced by
the PSCI relay). We can thus specialise the read_ctr macro to
always return a pre-computed, sanitised value. Special care is
taken to prevent the use of this custome version outside of
the protected mode.

Reviewed-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/image-vars.h
arch/arm64/kvm/va_layout.c