From: Greg Kroah-Hartman Date: Fri, 11 Aug 2017 21:08:01 +0000 (-0700) Subject: 4.9-stable patches X-Git-Tag: v3.18.65~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9e4d1acb121b6c2696c0a47feb143244cd5211b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: kvm-arm-arm64-handle-hva-aging-while-destroying-the-vm.patch --- diff --git a/queue-4.9/kvm-arm-arm64-handle-hva-aging-while-destroying-the-vm.patch b/queue-4.9/kvm-arm-arm64-handle-hva-aging-while-destroying-the-vm.patch new file mode 100644 index 00000000000..77b5d8df2a4 --- /dev/null +++ b/queue-4.9/kvm-arm-arm64-handle-hva-aging-while-destroying-the-vm.patch @@ -0,0 +1,46 @@ +From 7e5a672289c9754d07e1c3b33649786d3d70f5e4 Mon Sep 17 00:00:00 2001 +From: Suzuki K Poulose +Date: Wed, 5 Jul 2017 09:57:00 +0100 +Subject: KVM: arm/arm64: Handle hva aging while destroying the vm + +From: Suzuki K Poulose + +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 +Reviewed-by: Christoffer Dall +Signed-off-by: Suzuki K Poulose +Signed-off-by: Marc Zyngier +Signed-off-by: Greg Kroah-Hartman + + +--- + arch/arm/kvm/mmu.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/kvm/mmu.c ++++ b/arch/arm/kvm/mmu.c +@@ -1664,12 +1664,16 @@ static int kvm_test_age_hva_handler(stru + + 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); + } diff --git a/queue-4.9/series b/queue-4.9/series index 6de4212c5ff..f33a70b2186 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -13,3 +13,4 @@ revert-net-account-for-current-skb-length-when-deciding-about-ufo.patch revert-ipv4-should-use-consistent-conditional-judgement-for-ip-fragment-in-__ip_append_data-and-ip_finish_output.patch udp-consistently-apply-ufo-or-fragmentation.patch sparc64-prevent-perf-from-running-during-super-critical-sections.patch +kvm-arm-arm64-handle-hva-aging-while-destroying-the-vm.patch