OSDN Git Service

KVM: arm64: Reject stub hypercalls after pKVM has been initialised
authorWill Deacon <will@kernel.org>
Fri, 8 Oct 2021 13:58:36 +0000 (14:58 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 11 Oct 2021 08:07:28 +0000 (09:07 +0100)
commit8579a185bacaa64c65e43e251ceede2f7600f7e2
tree0d02175cae043c55de1dfe08e89ef8abeaf0549c
parent8f4566f18db5d1257fc2d5442e16274424a529c1
KVM: arm64: Reject stub hypercalls after pKVM has been initialised

The stub hypercalls provide mechanisms to reset and replace the EL2 code,
so uninstall them once pKVM has been initialised in order to ensure the
integrity of the hypervisor code.

To ensure pKVM initialisation remains functional, split cpu_hyp_reinit()
into two helper functions to separate usage of the stub from usage of
pkvm hypercalls either side of __pkvm_init on the boot CPU.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211008135839.1193-4-will@kernel.org
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/host.S