From: Greg Kroah-Hartman Date: Mon, 24 Aug 2020 16:16:48 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.234~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=885f1c5796d16453ed1c779d26e48ed486479d04;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch --- diff --git a/queue-4.9/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch b/queue-4.9/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch new file mode 100644 index 00000000000..794f4a98ed4 --- /dev/null +++ b/queue-4.9/kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch @@ -0,0 +1,48 @@ +From will@kernel.org Mon Aug 24 18:14:19 2020 +From: Will Deacon +Date: Mon, 24 Aug 2020 12:29:40 +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 , stable@vger.kernel.org +Message-ID: <20200824112940.24706-1-will@kernel.org> + +From: Will Deacon + +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: # v4.9 only +Cc: Marc Zyngier +Cc: Suzuki K Poulose +Cc: James Morse +Signed-off-by: Will Deacon +Acked-by: Marc Zyngier +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/kvm/mmu.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/arch/arm/kvm/mmu.c ++++ b/arch/arm/kvm/mmu.c +@@ -298,12 +298,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); + } + diff --git a/queue-4.9/series b/queue-4.9/series index cc9d5b10e6e..d5a650d33e7 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -36,3 +36,4 @@ epoll-keep-a-reference-on-files-added-to-the-check-list.patch 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 +kvm-arm-arm64-don-t-reschedule-in-unmap_stage2_range.patch