KVM: arm64: Add kimg_hyp_va() helper
authorMarc Zyngier <maz@kernel.org>
Wed, 21 Oct 2020 19:48:02 +0000 (20:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 9 Nov 2020 16:56:39 +0000 (16:56 +0000)
commit1db9d9ded771389aae5760d20dd1bac113451b9c
tree0b875630a1e300480e9532be817812633b5205b3
parentf8394f232b1eab649ce2df5c5f15b0e528c92091
KVM: arm64: Add kimg_hyp_va() helper

KVM/arm64 is so far unable to deal with function pointers, as the compiler
will generate the kernel's runtime VA, and not the linear mapping address,
meaning that kern_hyp_va() will give the wrong result.

We so far have been able to use PC-relative addressing, but that's not
always easy to use, and prevents the implementation of things like
the mapping of an index to a pointer.

To allow this, provide a new helper that computes the required
translation from the kernel image to the HYP VA space.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/va_layout.c