KVM: arm64: Patch kimage_voffset instead of loading the EL1 value
authorMarc Zyngier <maz@kernel.org>
Sat, 24 Oct 2020 15:33:38 +0000 (16:33 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 27 Nov 2020 11:32:43 +0000 (11:32 +0000)
commit68b824e428c5fb5c3dc5ef80b1543e767534b58e
tree93f0cc373bf871d0eddcdef77fc5ca0d8bb17c8c
parent7cd0aaafaadcaaf280887f8b478393a9fcfc69e3
KVM: arm64: Patch kimage_voffset instead of loading the EL1 value

Directly using the kimage_voffset variable is fine for now, but
will become more problematic as we start distrusting EL1.

Instead, patch the kimage_voffset into the HYP text, ensuring
we don't have to load an untrusted value later on.

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