diff options
author | Ricardo Koller <ricarkol@google.com> | 2023-04-26 17:23:23 +0000 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-05-16 17:39:18 +0000 |
commit | 2f440b72e852be428540579b5813ba2b8236578d (patch) | |
tree | c4be44262abb5c8da28ca42115b6ae7e885693d4 /arch/arm64/kvm/mmu.c | |
parent | 26f457142d7ee2da20a5b701862230e4961423d9 (diff) | |
download | linux-2f440b72e852be428540579b5813ba2b8236578d.tar.gz linux-2f440b72e852be428540579b5813ba2b8236578d.tar.bz2 linux-2f440b72e852be428540579b5813ba2b8236578d.zip |
KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE
Add a capability for userspace to specify the eager split chunk size.
The chunk size specifies how many pages to break at a time, using a
single allocation. Bigger the chunk size, more pages need to be
allocated ahead of time.
Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20230426172330.1439644-6-ricarkol@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm/mmu.c')
-rw-r--r-- | arch/arm64/kvm/mmu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index a0d3c773af99..f2d30486f755 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -775,6 +775,10 @@ int kvm_init_stage2_mmu(struct kvm *kvm, struct kvm_s2_mmu *mmu, unsigned long t for_each_possible_cpu(cpu) *per_cpu_ptr(mmu->last_vcpu_ran, cpu) = -1; + /* The eager page splitting is disabled by default */ + mmu->split_page_chunk_size = KVM_ARM_EAGER_SPLIT_CHUNK_SIZE_DEFAULT; + mmu->split_page_cache.gfp_zero = __GFP_ZERO; + mmu->pgt = pgt; mmu->pgd_phys = __pa(pgt->pgd); return 0; |