]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
kvm: arm/arm64: Rework gpa callback handlers
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 20 Mar 2017 18:26:42 +0000 (18:26 +0000)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:42:50 +0000 (07:42 -0700)
commit056aad67f836e20568be9b7ca07703a8dea26e0c
treed40ff6eb1d75557c9b1b970766bfe1017f2c4460
parent97da3854c526d3a6ee05c849c96e48d21527606c
kvm: arm/arm64: Rework gpa callback handlers

In order to perform an operation on a gpa range, we currently iterate
over each page in a user memory slot for the given range. This is
inefficient while dealing with a big range (e.g, a VMA), especially
while unmaping a range. At present, with stage2 unmap on a range with
a hugepage backed region, we clear the PMD when we unmap the first
page in the loop. The remaining iterations simply traverse the page table
down to the PMD level only to see that nothing is in there.

This patch reworks the code to invoke the callback handlers on the
biggest range possible within the memory slot to to reduce the number of
times the handler is called.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/kvm/mmu.c