KVM: arm64: Propagate errors from __pkvm_prot_finalize hypercall
authorWill Deacon <will@kernel.org>
Fri, 8 Oct 2021 13:58:37 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:15 +0000 (19:16 +0100)
commite41d46fe0954ec4ae806f8b815bf70929d5c5657
tree87f6927e5a24b0c936a181ec5699c376a34b40ee
parentdd267d35d82a523c9f7f953fe7efad42fedc82f7
KVM: arm64: Propagate errors from __pkvm_prot_finalize hypercall

[ Upstream commit 2f2e1a5069679491d18cf9021da19b40c56a17f3 ]

If the __pkvm_prot_finalize hypercall returns an error, we WARN but fail
to propagate the failure code back to kvm_arch_init().

Pass a pointer to a zero-initialised return variable so that failure
to finalise the pKVM protections on a host CPU can be reported back to
KVM.

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-5-will@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kvm/arm.c