ARM: KVM: force cache clean on page fault when caches are off
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 14 Jan 2014 19:13:10 +0000 (19:13 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:18:35 +0000 (17:18 +0200)
commitebdea56c8b2acd4fd7a421d1d670e6bf10f37e60
tree3cf84c95b9e178c80e2a8664094b3898da2e8061
parent5ac10a803ba46a03fccfbd078b60fa0cd83422c0
ARM: KVM: force cache clean on page fault when caches are off

In order for a guest with caches disabled to observe data written
contained in a given page, we need to make sure that page is
committed to memory, and not just hanging in the cache (as guest
accesses are completely bypassing the cache until it decides to
enable it).

For this purpose, hook into the coherent_cache_guest_page
function and flush the region if the guest SCTLR
register doesn't show the MMU and caches as being enabled.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 159793001d7d85af17855630c94f0a176848e16b)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_mmu.h