• Yanan Wang's avatar
    KVM: arm64: Move guest CMOs to the fault handlers · 25aa2869
    Yanan Wang authored
    We currently uniformly perform CMOs of D-cache and I-cache in function
    user_mem_abort before calling the fault handlers. If we get concurrent
    guest faults(e.g. translation faults, permission faults) or some really
    unnecessary guest faults caused by BBM, CMOs for the first vcpu are
    necessary while the others later are not.
    
    By moving CMOs to the fault handlers, we can easily identify conditions
    where they are really needed and avoid the unnecessary ones. As it's a
    time consuming process to perform CMOs especially when flushing a block
    range, so this solution reduces much load of kvm and improve efficiency
    of the stage-2 page table code.
    
    We can imagine two specific scenarios which will gain much benefit:
    1) In a normal VM startup, this solution will improve the efficiency of
    handling guest page faults incurred by vCPUs, when initially populating
    stage-2 page tables.
    2) After live migration, the heavy workload will be resumed on the
    destination VM, however all the stage-2 page tables need to be rebuilt
    at the moment. So this solution will ease the performance drop during
    resuming stage.
    Reviewed-by: default avatarFuad Tabba <tabba@google.com>
    Signed-off-by: default avatarYanan Wang <wangyanan55@huawei.com>
    Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
    Link: https://lore.kernel.org/r/20210617105824.31752-5-wangyanan55@huawei.com
    25aa2869
mmu.c 41.2 KB