]> 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)
commit9e230e8ffc6321ca0cdf445741b4776f7256a95d
tree0d02175cae043c55de1dfe08e89ef8abeaf0549c
parentfa0b4db518de68d118e8f40f93e114b324480932
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