Skip to content

Commit 7e86f2d

Browse files
Suzuki K Poulosegregkh
authored andcommitted
KVM: arm/arm64: Handle hva aging while destroying the vm
commit 7e5a672289c9754d07e1c3b33649786d3d70f5e4 upstream. The mmu_notifier_release() callback of KVM triggers cleaning up the stage2 page table on kvm-arm. However there could be other notifier callbacks in parallel with the mmu_notifier_release(), which could cause the call backs ending up in an empty stage2 page table. Make sure we check it for all the notifier callbacks. Fixes: commit 293f29363 ("kvm-arm: Unmap shadow pagetables properly") Reported-by: Alex Graf <agraf@suse.de> Reviewed-by: Christoffer Dall <cdall@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6fe71ca commit 7e86f2d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/arm/kvm/mmu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,12 +1629,16 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data)
16291629

16301630
int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end)
16311631
{
1632+
if (!kvm->arch.pgd)
1633+
return 0;
16321634
trace_kvm_age_hva(start, end);
16331635
return handle_hva_to_gpa(kvm, start, end, kvm_age_hva_handler, NULL);
16341636
}
16351637

16361638
int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
16371639
{
1640+
if (!kvm->arch.pgd)
1641+
return 0;
16381642
trace_kvm_test_age_hva(hva);
16391643
return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL);
16401644
}

0 commit comments

Comments
 (0)