arm64: KVM: Dynamically patch the kernel/hyp VA mask
authorMarc Zyngier <marc.zyngier@arm.com>
Sun, 3 Dec 2017 17:36:55 +0000 (17:36 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 19 Mar 2018 13:03:29 +0000 (13:03 +0000)
commit2b4d1606aac27f2485061abd953ea1e103b5e26e
tree452b64c046fa114c695a0846d90047d05ddf1999
parentef3935eeebffcad148edeb81021733c262db9970
arm64: KVM: Dynamically patch the kernel/hyp VA mask

So far, we're using a complicated sequence of alternatives to
patch the kernel/hyp VA mask on non-VHE, and NOP out the
masking altogether when on VHE.

The newly introduced dynamic patching gives us the opportunity
to simplify that code by patching a single instruction with
the correct mask (instead of the mind bending cumulative masking
we have at the moment) or even a single NOP on VHE. This also
adds some initial code that will allow the patching callback
to switch to a more complex patching.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/Makefile
arch/arm64/kvm/va_layout.c [new file with mode: 0644]