arm64: KVM: Enable Common Not Private translations
authorVladimir Murzin <vladimir.murzin@arm.com>
Tue, 31 Jul 2018 13:08:57 +0000 (14:08 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 18 Sep 2018 11:03:34 +0000 (12:03 +0100)
commitab510027dc4dbd1eeb611a34b0cda8b21fcde492
tree6f71d3b509e910de4db2cebd1b76f33ef11873b7
parent5ffdfaedfa0aba3f5db0fbb8ed4f3192be2b39b8
arm64: KVM: Enable Common Not Private translations

We rely on cpufeature framework to detect and enable CNP so for KVM we
need to patch hyp to set CNP bit just before TTBR0_EL2 gets written.

For the guest we encode CNP bit while building vttbr, so we don't need
to bother with that in a world switch.

Reviewed-by: James Morse <james.morse@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/include/asm/kvm_arm.h
arch/arm/include/asm/kvm_mmu.h
arch/arm64/include/asm/kvm_arm.h
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kvm/hyp-init.S
virt/kvm/arm/arm.c