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 0A511C433FE for ; Tue, 1 Nov 2022 20:47:38 +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=iGgcvQlJzfZFZNJGWBTbT4atKGO0JXIZFsDsiAFzQV8=; b=tHcAcGKxRYAMeU GfIn7hhWpeGqP950/ivdeDgcmVz4L0D/ZflgLbRTWZUpWxmlCfj9uFhmBFvT8Ss9g3YJu4YJPsqHk TKStwcgDYuxFonqAeqdxpRuS2Ri2u5acrafJQlyf0BIT4t2gy3C+GXvtKIvPxTDV85mN8XUgOlCGC cx8ah+xSZ97VQsEIM7bt3y6qlHzkjSQfJNBkgQSzoQGDvvIMae6IqsxYhJLgOTpxtikoHlfIdXwq0 CYi8Pr/nDyiSTo3qyNCwJihUNUdLH0RFJB84XVGYd0YIaxamsmKz9H3Kva4BmLkL92/FIZAzQMAKZ I9MocQ015ZDJ0CWxo5Nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opy9b-006zU5-9U; Tue, 01 Nov 2022 20:46:35 +0000 Received: from out0.migadu.com ([2001:41d0:2:267::]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opy9Y-006zQR-3N for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 20:46:33 +0000 Date: Tue, 1 Nov 2022 20:46:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1667335584; 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: in-reply-to:in-reply-to:references:references; bh=6x7DY2gFzopQuMFwkeq+iyUXN3O/bFmTMTh5Iwt6CyU=; b=Ntzyn+Jf1qlzNpR43HCbuxbzt104ksD0+HTq91Wbi7fM3ZJX+fuyM9zeZERcfo5B9ME3QU sNiBtHDKWktUciuMiYOqDL3Sx8rR8pqU4HneKRow7juwaiH+PSmc+w7NJIfezOQb25Kn7T 1JxNVgb//P6smSrAzNQdZs3fjKuMhIU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson 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 , kvmarm@lists.linux.dev Subject: Re: [PATCH v3 09/15] KVM: arm64: Free removed stage-2 tables in RCU callback Message-ID: References: <20221027221752.1683510-1-oliver.upton@linux.dev> <20221027221752.1683510-10-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-20221101_134632_330570_D4F20BEB X-CRM114-Status: GOOD ( 16.43 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 01, 2022 at 08:28:04PM +0000, Sean Christopherson wrote: > On Thu, Oct 27, 2022, Oliver Upton wrote: > > There is no real urgency to free a stage-2 subtree that was pruned. > > Nonetheless, KVM does the tear down in the stage-2 fault path while > > holding the MMU lock. > > [ copy ] > This is _very_ misleading. The above paints RCU as an optimization of sorts to > avoid doing work while holding mmu_lock. Freeing page tables in an RCU callback > is _required_ for correctness when allowing parallel page faults to remove page > tables, as holding mmu_lock for read in that case doesn't ensure no other CPU is > accessing and/or holds a reference to the to-be-freed page table. Agree, but it is still important to reason about what is changing here too. Moving work out of the vCPU fault path _is_ valuable, though ancillary to the correctness requirements. > IMO, this patch should to be squashed with the previous patch, "Protect stage-2 > traversal with RCU". One doesn't make any sense without the other. I had split these up back when this series was a lot more gnarly and there was too much slop in a single diff. That isn't the case any more, so yeah I'll squash them. [ paste ] > > Free removed stage-2 subtrees after an RCU grace period. To guarantee > > all stage-2 table pages are freed before killing a VM, add an > > rcu_barrier() to the flush path. An aside, this is flat-out wrong now. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel