KVM: arm/arm64: Limit icache invalidation to prefetch aborts
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 23 Oct 2017 16:11:19 +0000 (17:11 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 8 Jan 2018 14:20:45 +0000 (15:20 +0100)
commitd0e22b4ac3ba23c611739f554392bf5e217df49f
tree33dd9a41741e6d8b653de9d715b6b277a2424c63
parentfefb876b9b96fa7e4ed3d906979ea45b4cf07349
KVM: arm/arm64: Limit icache invalidation to prefetch aborts

We've so far eagerly invalidated the icache, no matter how
the page was faulted in (data or prefetch abort).

But we can easily track execution by setting the XN bits
in the S2 page tables, get the prefetch abort at HYP and
perform the icache invalidation at that time only.

As for most VMs, the instruction working set is pretty
small compared to the data set, this is likely to save
some traffic (specially as the invalidation is broadcast).

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
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/include/asm/pgtable.h
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/include/asm/pgtable-prot.h
virt/kvm/arm/mmu.c