]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit8c4bb9d93c664f497c930c1f70cfcdcd5a6b5974
tree0d02175cae043c55de1dfe08e89ef8abeaf0549c
parentcaf97713dbd3073177a9fd9697808321105fafd1
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