]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
arm64: KVM: VHE: Clear HCR_TGE when invalidating guest TLBs
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 17 Feb 2017 14:32:18 +0000 (14:32 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 22 Mar 2017 14:02:34 +0000 (08:02 -0600)
commit223996c7e18806cc96df812bbc70eda2cfec1dae
treee6f5d7fb50ab89e205788dcdd14ee82c93b9617b
parent7a7c8866070234ff7a050a23ab09bcadddb71d4e
arm64: KVM: VHE: Clear HCR_TGE when invalidating guest TLBs

BugLink: http://bugs.launchpad.net/bugs/1675032
commit 68925176296a8b995e503349200e256674bfe5ac upstream.

When invalidating guest TLBs, special care must be taken to
actually shoot the guest TLBs and not the host ones if we're
running on a VHE system.  This is controlled by the HCR_EL2.TGE
bit, which we forget to clear before invalidating TLBs.

Address the issue by introducing two wrappers (__tlb_switch_to_guest
and __tlb_switch_to_host) that take care of both the VTTBR_EL2
and HCR_EL2.TGE switching.

Reported-by: Tomasz Nowicki <tnowicki@caviumnetworks.com>
Tested-by: Tomasz Nowicki <tnowicki@caviumnetworks.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/arm64/kvm/hyp/tlb.c