At the moment, KVM/ARM is quite heavy handed when it comes to i-cache invalidation, as it is flushed on each stage-2 mapping. An alternative is to mark each page as non-executable (courtesy of the XN flag), and then to invalidate the i-cache when the CPU tries to execute a page. We're basically trading off invalidation for faults. Performance wise, the performance difference is very modest (I've seen a 0.2% improvement over 10 runs of "hackbench 100 process 1000"). But the important thing in my opinion is that it reduces the impact of the VM on the whole system (fault handling only impact the VM while invalidation is global). Code wise, this introduce a bit of restructuring in our stage-2 manipulation code, making the code a bit cleaner (IMHO). Note that these patches are against my arm64 branch, and won't apply on anything else. As always, comments welcome. M. Marc Zyngier (7): ARM: KVM: introduce stage2_get_pte ARM: KVM: introduce stage2_set_pte_at ARM: KVM: remove handling of IO mapping from stage2_set_pte ARM: KVM: fix user_mem_abort() use of stage2_set_pte ARM: KVM: kill stage2_set_pte ARM: KVM: introduce kvm_decode_fault ARM: KVM: make all pages non-executable by default arch/arm/include/asm/kvm_mmu.h | 19 +++++++++--- arch/arm/include/asm/pgtable.h | 2 +- arch/arm/kvm/mmu.c | 66 ++++++++++++++++++++++++++++-------------- 3 files changed, 60 insertions(+), 27 deletions(-) -- 1.8.1.2 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm