OSDN Git Service

KVM: arm/arm64: Fix young bit from mmu notifier
authorGavin Shan <gshan@redhat.com>
Tue, 21 Jan 2020 05:56:59 +0000 (16:56 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:33:26 +0000 (16:33 -0500)
commit5b63ffb30b8148f87e3585f916772adf76e05765
tree3e2beba6dc50067f6e095fe0300132f4b7568055
parent0e0310adf2207cc175fb86833b0e61b8237edb25
KVM: arm/arm64: Fix young bit from mmu notifier

commit cf2d23e0bac9f6b5cd1cba8898f5f05ead40e530 upstream.

kvm_test_age_hva() is called upon mmu_notifier_test_young(), but wrong
address range has been passed to handle_hva_to_gpa(). With the wrong
address range, no young bits will be checked in handle_hva_to_gpa().
It means zero is always returned from mmu_notifier_test_young().

This fixes the issue by passing correct address range to the underly
function handle_hva_to_gpa(), so that the hardware young (access) bit
will be visited.

Fixes: 35307b9a5f7e ("arm/arm64: KVM: Implement Stage-2 page aging")
Signed-off-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200121055659.19560-1-gshan@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/arm/mmu.c