]> git.baikalelectronics.ru Git - kernel.git/commit
arm/arm64: KVM: Use kernel mapping to perform invalidation on page fault
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 5 Jan 2015 21:13:24 +0000 (21:13 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 29 Jan 2015 22:24:57 +0000 (23:24 +0100)
commit9a1927d995f71b336d3c27f2e5b0c8eb5b0b055e
tree57b219954fcb587cd0bbf8b3a4abbe40c269a2da
parentadc7b7a12f763693f0b91929ceb523ab05a0e819
arm/arm64: KVM: Use kernel mapping to perform invalidation on page fault

When handling a fault in stage-2, we need to resync I$ and D$, just
to be sure we don't leave any old cache line behind.

That's very good, except that we do so using the *user* address.
Under heavy load (swapping like crazy), we may end up in a situation
where the page gets mapped in stage-2 while being unmapped from
userspace by another CPU.

At that point, the DC/IC instructions can generate a fault, which
we handle with kvm->mmu_lock held. The box quickly deadlocks, user
is unhappy.

Instead, perform this invalidation through the kernel mapping,
which is guaranteed to be present. The box is much happier, and so
am I.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/include/asm/kvm_mmu.h
arch/arm/kvm/mmu.c
arch/arm64/include/asm/kvm_mmu.h