BACKPORT: arm/arm64: KVM: Use set/way op trapping to track the state of the caches

Trying to emulate the behaviour of set/way cache ops is fairly
pointless, as there are too many ways we can end-up missing stuff.
Also, there is some system caches out there that simply ignore
set/way operations.

So instead of trying to implement them, let's convert it to VA ops,
and use them as a way to re-enable the trapping of VM ops. That way,
we can detect the point when the MMU/caches are turned off, and do
a full VM flush (which is what the guest was trying to do anyway).

This allows a 32bit zImage to boot on the APM thingy, and will
probably help bootloaders in general.

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

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