]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: arm64: Ask the compiler to __always_inline functions used at HYP
authorJames Morse <james.morse@arm.com>
Thu, 20 Feb 2020 16:58:37 +0000 (16:58 +0000)
committerMarc Zyngier <maz@kernel.org>
Sat, 22 Feb 2020 11:01:47 +0000 (11:01 +0000)
commit5c37f1ae1c335800d16b207cb578009c695dcd39
tree9e35f8234b5b0779a85cc6a3ebd029d345d237f7
parentb3f15ec3d809ccf2e171ca4e272a220d3c1a3e05
KVM: arm64: Ask the compiler to __always_inline functions used at HYP

On non VHE CPUs, KVM's __hyp_text contains code run at EL2 while the rest
of the kernel runs at EL1. This code lives in its own section with start
and end markers so we can map it to EL2.

The compiler may decide not to inline static-inline functions from the
header file. It may also decide not to put these out-of-line functions
in the same section, meaning they aren't mapped when called at EL2.

Clang-9 does exactly this with __kern_hyp_va() and a few others when
x18 is reserved for the shadow call stack. Add the additional __always_
hint to all the static-inlines that are called from a hyp file.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200220165839.256881-2-james.morse@arm.com
----
kvm_get_hyp_vector() pulls in all the regular per-cpu accessors
and this_cpu_has_cap(), fortunately its only called for VHE.
arch/arm64/include/asm/arch_gicv3.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/kvm_emulate.h
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/include/asm/virt.h