BACKPORT: 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.

BUG=chromium:846515
TEST=build/boot on hana with USE=kvm_host

Change-Id: Ic6b97f263300b1662b3d07faaa6773991e6ea2eb
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit 0d3e4d4fade6b04e933b11e69e80044f35e9cd60)
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
[SR: context conflicts]
Conflicts:
   arch/arm/kvm/mmu.c
Reviewed-on: https://chromium-review.googlesource.com/1088049
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
3 files changed