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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0936C433FE for ; Mon, 14 Nov 2022 17:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ik+eqzaMwhjpsPflYSo3MaIMl9Kk2t+YMiT4pgSU1I0=; b=4TodrgoA0doxvy d/r9aXSm1erCEF8K5ZsJ8A0yE5mbzv8ZwPjav79OO0rWJMn7kF/cwKEeQiB8HyXmgwvaFHs/Qw6/Y pGL0Q3H3qLmy94qgMqe0Ew4fEzRy1azolJBdlwk2BR5wmgcU9mGVcFm66GNBQNpAyh0zB1ZbnqYwV tKHuWvsixnDwhtfsi0ih09edTiDEEtnqw8PUOBjvKeLcOxNnVqBC2vkwEN72IGoc5cKubocxvUYmi 8DxfpQPQ9gGVz5bhCSuXnBKZNUKJ3G556jXIfEo5amTFauXFeUwY5DHmqi2FUHn9BkAjVnY50HYkA GTEG7sscpfmTT5Hrn/AA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oudTS-003Jyb-K3; Mon, 14 Nov 2022 17:42:22 +0000 Received: from out0.migadu.com ([94.23.1.103]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oudTO-003JrP-Ca for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 17:42:20 +0000 Date: Mon, 14 Nov 2022 17:42:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668447730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=81grqjfzDbXvj/kXaN38dFg6IyEuzMGxJS1cZ3BwExg=; b=BYYs+S93PrA9vVkBPWsRJ92HUs5Bu24WxHWBumocLkBoLuv73fHHvwn4/0+o2MapvGeTyT RPXB5tTSzzkHJlhJt2zzpoKv+E3mEZPegjVH8mRb1KektxarogfmLvmou14ILn5UAplWns JjLprqhlcu/VJzDptSMXok7eHx8HAnk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marek Szyprowski Cc: Marc Zyngier , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Reiji Watanabe , Ricardo Koller , David Matlack , Quentin Perret , Ben Gardon , Gavin Shan , Peter Xu , Will Deacon , Sean Christopherson , kvmarm@lists.linux.dev Subject: Re: [PATCH v5 08/14] KVM: arm64: Protect stage-2 traversal with RCU Message-ID: References: <20221107215644.1895162-1-oliver.upton@linux.dev> <20221107215644.1895162-9-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_094218_891884_D43866C0 X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Marek, On Mon, Nov 14, 2022 at 03:29:14PM +0100, Marek Szyprowski wrote: > This patch landed in today's linux-next (20221114) as commit = > c3119ae45dfb ("KVM: arm64: Protect stage-2 traversal with RCU"). = > Unfortunately it introduces a following warning: Thanks for the bug report :) I had failed to test nVHE in the past few revisions of this series. > --->8--- > = > kvm [1]: IPA Size Limit: 40 bits > BUG: sleeping function called from invalid context at = > include/linux/sched/mm.h:274 > in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 > preempt_count: 0, expected: 0 > RCU nest depth: 1, expected: 0 > 2 locks held by swapper/0/1: > =A0#0: ffff80000a8a44d0 (kvm_hyp_pgd_mutex){+.+.}-{3:3}, at: = > __create_hyp_mappings+0x80/0xc4 > =A0#1: ffff80000a927720 (rcu_read_lock){....}-{1:2}, at: = > kvm_pgtable_walk+0x0/0x1f4 > CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc3+ #5918 > Hardware name: Raspberry Pi 3 Model B (DT) > Call trace: > =A0dump_backtrace.part.0+0xe4/0xf0 > =A0show_stack+0x18/0x40 > =A0dump_stack_lvl+0x8c/0xb8 > =A0dump_stack+0x18/0x34 > =A0__might_resched+0x178/0x220 > =A0__might_sleep+0x48/0xa0 > =A0prepare_alloc_pages+0x178/0x1a0 > =A0__alloc_pages+0x9c/0x109c > =A0alloc_page_interleave+0x1c/0xc4 > =A0alloc_pages+0xec/0x160 > =A0get_zeroed_page+0x1c/0x44 > =A0kvm_hyp_zalloc_page+0x14/0x20 > =A0hyp_map_walker+0xd4/0x134 > =A0kvm_pgtable_visitor_cb.isra.0+0x38/0x5c > =A0__kvm_pgtable_walk+0x1a4/0x220 > =A0kvm_pgtable_walk+0x104/0x1f4 > =A0kvm_pgtable_hyp_map+0x80/0xc4 > =A0__create_hyp_mappings+0x9c/0xc4 > =A0kvm_mmu_init+0x144/0x1cc > =A0kvm_arch_init+0xe4/0xef4 > =A0kvm_init+0x3c/0x3d0 > =A0arm_init+0x20/0x30 > =A0do_one_initcall+0x74/0x400 > =A0kernel_init_freeable+0x2e0/0x350 > =A0kernel_init+0x24/0x130 > =A0ret_from_fork+0x10/0x20 > kvm [1]: Hyp mode initialized successfully > = > --->8---- > = > I looks that more changes in the KVM code are needed to use RCU for that = > code. Right, the specific issue is that while the stage-2 walkers preallocate any table memory they may need, the hyp walkers do not and allocate inline. As hyp stage-1 is protected by a spinlock there is no actual need for RCU in that case. I'll post something later on today that addresses the issue. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel