]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
arm/arm64: KVM: Enforce unconditional flush to PoC when mapping to stage-2
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 25 Jan 2017 12:29:59 +0000 (12:29 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 13 Mar 2017 21:20:54 +0000 (15:20 -0600)
commitd2c01f929996f6b9462c457cabde878fad065859
tree20d15983fb2aeacf83fdb0f573aa541251513237
parent4c2359ee9fd32a2e53920c29ec9f8fdd79582aa5
arm/arm64: KVM: Enforce unconditional flush to PoC when mapping to stage-2

BugLink: http://bugs.launchpad.net/bugs/1672544
commit 8f36ebaf21fdae99c091c67e8b6fab33969f2667 upstream.

When we fault in a page, we flush it to the PoC (Point of Coherency)
if the faulting vcpu has its own caches off, so that it can observe
the page we just brought it.

But if the vcpu has its caches on, we skip that step. Bad things
happen when *another* vcpu tries to access that page with its own
caches disabled. At that point, there is no garantee that the
data has made it to the PoC, and we access stale data.

The obvious fix is to always flush to PoC when a page is faulted
in, no matter what the state of the vcpu is.

Fixes: 2d58b733c876 ("arm64: KVM: force cache clean on page fault when caches are off")
Reviewed-by: Christoffer Dall <christoffer.dall@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/arm/include/asm/kvm_mmu.h
arch/arm64/include/asm/kvm_mmu.h