Skip to contentSkip to conversation

FAILED: patch "[PATCH] KVM: arm/arm64: Handle hva aging while destroying the vm" failed to apply to 4.9-stable tree

PATCH [email protected] 1 participant 1 message Aug 7, 2017 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 7e5a672289c9754d07e1c3b33649786d3d70f5e4 Mon Sep 17 00:00:00 2001

From: Suzuki K Poulose <[email protected]>
Date: Wed, 5 Jul 2017 09:57:00 +0100
Subject: [PATCH] KVM: arm/arm64: Handle hva aging while destroying the vm

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")
virt/kvm/arm/mmu.c +4 -0
index 0e1fc75f3585..2ea21dac0b44 100644
@@ -1718,12 +1718,16 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, u64 size, void *
 
 int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end)
 {
+	if (!kvm->arch.pgd)
+		return 0;
 	trace_kvm_age_hva(start, end);
 	return handle_hva_to_gpa(kvm, start, end, kvm_age_hva_handler, NULL);
 }
 
 int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
 {
+	if (!kvm->arch.pgd)
+		return 0;
 	trace_kvm_test_age_hva(hva);
 	return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL);
 }