]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Minor optimization of range_is_memory
authorDavid Brazdil <dbrazdil@google.com>
Wed, 28 Jul 2021 15:32:32 +0000 (15:32 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Aug 2021 11:02:36 +0000 (12:02 +0100)
commit492483333892f40ed9d6e79dcf399ec285c02302
treec5bfbedf9936a95d253a0dd474cc243fc3084650
parentb0f2e22969a3187c50b8bc4e34e952eb4630ad22
KVM: arm64: Minor optimization of range_is_memory

Currently range_is_memory finds the corresponding struct memblock_region
for both the lower and upper bounds of the given address range with two
rounds of binary search, and then checks that the two memblocks are the
same. Simplify this by only doing binary search on the lower bound and
then checking that the upper bound is in the same memblock.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Reviewed-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210728153232.1018911-3-dbrazdil@google.com
arch/arm64/kvm/hyp/nvhe/mem_protect.c