KVM: arm64: Add kvm_pgtable_stage2_find_range()
authorQuentin Perret <qperret@google.com>
Fri, 19 Mar 2021 10:01:39 +0000 (10:01 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 19 Mar 2021 12:01:22 +0000 (12:01 +0000)
commit2fcb3a59401d2d12b5337b62c799eeb22cf40a2c
tree21d212a0e0504c2c09f32333f2d1751eb3402979
parent3fab82347ffb36c8b7b38dabc8e79276eeb1a81c
KVM: arm64: Add kvm_pgtable_stage2_find_range()

Since the host stage 2 will be identity mapped, and since it will own
most of memory, it would preferable for performance to try and use large
block mappings whenever that is possible. To ease this, introduce a new
helper in the KVM page-table code which allows to search for large
ranges of available IPA space. This will be used in the host memory
abort path to greedily idmap large portion of the PA space.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210319100146.1149909-32-qperret@google.com
arch/arm64/include/asm/kvm_pgtable.h
arch/arm64/kvm/hyp/pgtable.c