]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: KVM: Guests can skip __install_bp_hardening_cb()s HYP work
authorJames Morse <james.morse@arm.com>
Fri, 21 Sep 2018 20:49:19 +0000 (21:49 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 19 Oct 2018 14:37:25 +0000 (15:37 +0100)
commitbc203956449389980ed6303b30cb9eca4ce9965c
tree8c85a24a9c2d877e430f1d4987debe5d63123bac
parent1fa35c355afcb70838938eaec0b445be85355bf3
arm64: KVM: Guests can skip __install_bp_hardening_cb()s HYP work

enable_smccc_arch_workaround_1() passes NULL as the hyp_vecs start and
end if the HVC conduit is in use, and ARM_SMCCC_ARCH_WORKAROUND_1 is
detected.

If the guest kernel happened to be built with KVM_INDIRECT_VECTORS,
we go on to allocate a slot, memcpy() the empty workaround in and
do the appropriate cache maintenance.

This works as we always tell memcpy() the range is 0, so it never
accesses the NULL src pointer, but we still do the cache maintenance.

If hyp_vecs_start is NULL we know we're a guest, just update the fn
like the !KVM_INDIRECT_VECTORS version.

Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/cpu_errata.c