arm/arm64: KVM: Invalidate data cache on unmap
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 4 May 2015 01:25:21 +0000 (09:25 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 11 May 2015 11:07:35 +0000 (07:07 -0400)
commita412dc06d66e6f32269b3825221dc323dcc2ede0
treea2b5ddc440b40128ab18ae55d66504d73d1a5eaf
parentcc0c5f43df62402d1c283f047634e4672f7cb1d8
arm/arm64: KVM: Invalidate data cache on unmap

commit 363ef89f8e9bcedc28b976d0fe2d858fe139c122 upstream.

Let's assume a guest has created an uncached mapping, and written
to that page. Let's also assume that the host uses a cache-coherent
IO subsystem. Let's finally assume that the host is under memory
pressure and starts to swap things out.

Before this "uncached" page is evicted, we need to make sure
we invalidate potential speculated, clean cache lines that are
sitting there, or the IO subsystem is going to swap out the
cached view, loosing the data that has been written directly
into memory.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/arm/include/asm/kvm_mmu.h
arch/arm/kvm/mmu.c
arch/arm64/include/asm/kvm_mmu.h