• Oliver Upton's avatar
    Merge branch kvm-arm64/eager-page-splitting into kvmarm/next · 83510396
    Oliver Upton authored
    * kvm-arm64/eager-page-splitting:
      : Eager Page Splitting, courtesy of Ricardo Koller.
      :
      : Dirty logging performance is dominated by the cost of splitting
      : hugepages to PTE granularity. On systems that mere mortals can get their
      : hands on, each fault incurs the cost of a full break-before-make
      : pattern, wherein the broadcast invalidation and ensuing serialization
      : significantly increases fault latency.
      :
      : The goal of eager page splitting is to move the cost of hugepage
      : splitting out of the stage-2 fault path and instead into the ioctls
      : responsible for managing the dirty log:
      :
      :  - If manual protection is enabled for the VM, hugepage splitting
      :    happens in the KVM_CLEAR_DIRTY_LOG ioctl. This is desirable as it
      :    provides userspace granular control over hugepage splitting.
      :
      :  - Otherwise, if userspace relies on the legacy dirty log behavior
      :    (clear on collection), hugepage splitting is done at the moment dirty
      :    logging is enabled for a particular memslot.
      :
      : Support for eager page splitting requires explicit opt-in from
      : userspace, which is realized through the
      : KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE capability.
      arm64: kvm: avoid overflow in integer division
      KVM: arm64: Use local TLBI on permission relaxation
      KVM: arm64: Split huge pages during KVM_CLEAR_DIRTY_LOG
      KVM: arm64: Open-code kvm_mmu_write_protect_pt_masked()
      KVM: arm64: Split huge pages when dirty logging is enabled
      KVM: arm64: Add kvm_uninit_stage2_mmu()
      KVM: arm64: Refactor kvm_arch_commit_memory_region()
      KVM: arm64: Add kvm_pgtable_stage2_split()
      KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE
      KVM: arm64: Export kvm_are_all_memslots_empty()
      KVM: arm64: Add helper for creating unlinked stage2 subtrees
      KVM: arm64: Add KVM_PGTABLE_WALK flags for skipping CMOs and BBM TLBIs
      KVM: arm64: Rename free_removed to free_unlinked
    Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
    83510396
pgtable.c 36.9 KB