From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED559C433DF for ; Tue, 11 Aug 2020 10:27:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA74E20768 for ; Tue, 11 Aug 2020 10:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597141653; bh=KrsjJEn9/AAscGALbBQiNYwkr+CsOr9idxLrWL4e3TE=; h=From:To:Cc:Subject:Date:List-ID:From; b=N2hPPP0f8sTFl2YDNUOZZHiKJZIH7Smwquql/SAn3tVN+offcpQauokAtdhFdhvmP 2cK7lbukIU01EOEEfWBfpQxWriC4Pnv+blXSWBncVj1+6NoA6NxsEnJJCcmWNeA0zb 09B0b66e7rqUkevU9IvjNXGOTxTqdR12QZngGTHw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbgHKK1c (ORCPT ); Tue, 11 Aug 2020 06:27:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:54438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728390AbgHKK1c (ORCPT ); Tue, 11 Aug 2020 06:27:32 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A195F20656; Tue, 11 Aug 2020 10:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597141651; bh=KrsjJEn9/AAscGALbBQiNYwkr+CsOr9idxLrWL4e3TE=; h=From:To:Cc:Subject:Date:From; b=PIKF5mZGoH+YEC5q1fL4nAJGN7PAFK+DseTN0XF1YN5njXxltvV+cT5aht3Kp8pGf TXYgvj9cDwRixGojJZO7lIXkdb3f4GLCxSFLcy+GZKd+x5wgMr1ll3l8xV4kzh3vd4 7yJCn5KKWmuA405P8Fb/MnoX1F8fILd5+A1QL5VE= From: Will Deacon To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Will Deacon , Marc Zyngier , Suzuki K Poulose , James Morse , Thomas Bogendoerfer , Paul Mackerras , Paolo Bonzini , Sean Christopherson Subject: [PATCH 0/2] KVM: arm64: Fix sleeping while atomic BUG() on OOM Date: Tue, 11 Aug 2020 11:27:23 +0100 Message-Id: <20200811102725.7121-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, While stress-testing my arm64 stage-2 page-table rewrite [1], I ran into a sleeping while atomic BUG() during OOM that I can reproduce with mainline. The problem is that the arm64 page-table code periodically calls cond_resched_lock() when unmapping the stage-2 page-tables, but in the case of OOM, this occurs in atomic context. These couple of patches (based on 5.8) propagate the flags from the MMU notifier range structure, which in turn indicate whether or not blocking is permitted. Cheers, Will [1] https://android-kvm.googlesource.com/linux/+/refs/heads/topic/pgtable Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: James Morse Cc: Thomas Bogendoerfer Cc: Paul Mackerras Cc: Paolo Bonzini Cc: Sean Christopherson --->8 Will Deacon (2): KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/mmu.c | 19 ++++++++++++++----- arch/mips/include/asm/kvm_host.h | 2 +- arch/mips/kvm/mmu.c | 3 ++- arch/powerpc/include/asm/kvm_host.h | 3 ++- arch/powerpc/kvm/book3s.c | 3 ++- arch/powerpc/kvm/e500_mmu_host.c | 3 ++- arch/x86/include/asm/kvm_host.h | 3 ++- arch/x86/kvm/mmu/mmu.c | 3 ++- virt/kvm/kvm_main.c | 3 ++- 10 files changed, 30 insertions(+), 14 deletions(-) -- 2.28.0.236.gb10cc79966-goog