]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Aug 2020 16:12:53 +0000 (18:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Aug 2020 16:12:53 +0000 (18:12 +0200)
added patches:
kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch

queue-4.14/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch b/queue-4.14/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch
new file mode 100644 (file)
index 0000000..4302c08
--- /dev/null
@@ -0,0 +1,48 @@
+From will@kernel.org  Mon Aug 24 18:12:22 2020
+From: Will Deacon <will@kernel.org>
+Date: Mon, 24 Aug 2020 12:29:54 +0100
+Subject: KVM: arm/arm64: Don't reschedule in unmap_stage2_range()
+To: gregkh@linuxfoundation.org
+Cc: linux-kernel@vger.kernel.org, maz@kernel.org, suzuki.poulose@arm.com, james.morse@arm.com, pbonzini@redhat.com, kernel-team@android.com, Will Deacon <will@kernel.org>, stable@vger.kernel.org
+Message-ID: <20200824112954.24756-1-will@kernel.org>
+
+From: Will Deacon <will@kernel.org>
+
+Upstream commits fdfe7cbd5880 ("KVM: Pass MMU notifier range flags to
+kvm_unmap_hva_range()") and b5331379bc62 ("KVM: arm64: Only reschedule
+if MMU_NOTIFIER_RANGE_BLOCKABLE is not set") fix a "sleeping from invalid
+context" BUG caused by unmap_stage2_range() attempting to reschedule when
+called on the OOM path.
+
+Unfortunately, these patches rely on the MMU notifier callback being
+passed knowledge about whether or not blocking is permitted, which was
+introduced in 4.19. Rather than backport this considerable amount of
+infrastructure just for KVM on arm, instead just remove the conditional
+reschedule.
+
+Cc: <stable@vger.kernel.org> # v4.14 only
+Cc: Marc Zyngier <maz@kernel.org>
+Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
+Cc: James Morse <james.morse@arm.com>
+Signed-off-by: Will Deacon <will@kernel.org>
+Acked-by: Marc Zyngier <maz@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ virt/kvm/arm/mmu.c |    6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/virt/kvm/arm/mmu.c
++++ b/virt/kvm/arm/mmu.c
+@@ -307,12 +307,6 @@ static void unmap_stage2_range(struct kv
+               next = stage2_pgd_addr_end(addr, end);
+               if (!stage2_pgd_none(*pgd))
+                       unmap_stage2_puds(kvm, pgd, addr, next);
+-              /*
+-               * If the range is too large, release the kvm->mmu_lock
+-               * to prevent starvation and lockup detector warnings.
+-               */
+-              if (next != end)
+-                      cond_resched_lock(&kvm->mmu_lock);
+       } while (pgd++, addr = next, addr != end);
+ }
index 0bbdea279222130f75e35b49c994452bb6517470..35bff2763b6c25ce612099f112ff0d306cb11fd4 100644 (file)
@@ -48,3 +48,4 @@ do_epoll_ctl-clean-the-failure-exits-up-a-bit.patch
 mm-hugetlb-fix-calculation-of-adjust_range_if_pmd_sharing_possible.patch
 xen-don-t-reschedule-in-preemption-off-sections.patch
 clk-evict-unregistered-clks-from-parent-caches.patch
+kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch