Skip to content

Commit cf2d23e

Browse files
Gavin ShanMarc Zyngier
authored andcommitted
KVM: arm/arm64: Fix young bit from mmu notifier
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: 35307b9 ("arm/arm64: KVM: Implement Stage-2 page aging") Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6645d85 commit cf2d23e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

virt/kvm/arm/mmu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,8 @@ int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
21442144
if (!kvm->arch.pgd)
21452145
return 0;
21462146
trace_kvm_test_age_hva(hva);
2147-
return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL);
2147+
return handle_hva_to_gpa(kvm, hva, hva + PAGE_SIZE,
2148+
kvm_test_age_hva_handler, NULL);
21482149
}
21492150

21502151
void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)