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 A3721C4332F for ; Tue, 1 Nov 2022 20:29:08 +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=5gXnJZLt5ZabfuTRaPLwBqhW9RWjKSufP0Py3GyD/4s=; b=j3Ks/3NgFB6uaO j8Lv6lVowEHyOOXhOyZdrXv5ilLi4cucs1+9s0Z3Aq3M9kJPki/Yn7nn/FAM8tROmAZKnRoOIm37H xZjUiiFfaT9w8hgRneJj09P1B2/Jf9xJrXuFIFGvVz2X3r36wQE8GXUE5ZYcxhtZNr6SNzGC9KY/Z mjwx3vSPNFpCWGH0HcJwDSc4lb02bk+DtlGhtjXYA3kEYJx94GwnIg1/rjFgdkyjkS2vnXtOUuZtB dmBwoeUars8JGtk/HpEGdb/pNORM8eS8K0LyoklXtbhUgQwPOegm+ilVcyBUeixuMw4Ndjb90TvSF kloLVrzxfKurntRqSqlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opxro-006uuM-8a; Tue, 01 Nov 2022 20:28:12 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opxrl-006uth-P5 for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 20:28:11 +0000 Received: by mail-pj1-x1036.google.com with SMTP id b11so14302597pjp.2 for ; Tue, 01 Nov 2022 13:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7Q15eoBQW+ndVdEuHxmdR78/VIpdRnCY/gFW79Q5++Y=; b=JeRquhbkLaWQ4VXS0ZlfxU7Y8+xIVGl1+LdsPQ0hWDUsemLo7dmNUjfVG3XeWtQ+q6 anOYfFqBxLnv8zuKUeuNSfJC6yWnnwaRxxvd3gf+tr+sN4tRYQJ9BFAcNmM51Nmm1y4/ Ve0qZkEVA5+q3F865yXWV2l795oQInHr6YQ8EVAoPWaVtZSXmHDvtUvYOs+L9jwDIpH4 d9gFRlhhChEJbDnUVO+mCaISyg5Rc3dqgckgKei9ZJmBfo2vdA09RgkQPWFNRdICRIjW QZ+tYvfviZe8jTh+Aetu+CrTUVBHson3qov5eGJuvniXk3JfoUiJeCHNjzBEM33zQVat HCJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7Q15eoBQW+ndVdEuHxmdR78/VIpdRnCY/gFW79Q5++Y=; b=c45IJkMkbQDfqKqSGUjKlIMyI9E3Gw41cWpy+plx31FlPaO2LUWfHEo1NuSAqLSCOV 9qZvk5hU4c7FJrWX45WqV0c3pF0mLtbi9p1AbAlm+EsC61ZnhL3k6a8VWLenqwAZJJOJ +W7zL4mxjz3InU1LprrO5zkO/oypb6cBNEmjwCvB+IbxYfRJ+eLeexKlpQ4dNYdAwtRU efm0IlmrWAiCB/+0bUxso275qGBRRoL0lfAG1usmftEkZlIjYD7x5GAfI6aJ5+VIOGgj n9XVgrp4yeWNsEES6EErGH7L7z7tA7UP/BAEJcZ0NvrmEhHKXIBM0EFMD7n8oKiRgn4s 3SKw== X-Gm-Message-State: ACrzQf19ZThFJ4q8r/WZQPzyYWM0L/HF0jL/xnLfeWuxoglwU+k351Q7 GX/DVRX0s9LOXp/G9PVyX+HHoA== X-Google-Smtp-Source: AMsMyM7rdaSOxuZbjzEc/VEG8h7kZQ83nH1qpB3jBULH8y8Ns8Rm2Ic8D29LJAQbjO7QhKZuDJvUsQ== X-Received: by 2002:a17:90a:54:b0:212:eb01:1ce with SMTP id 20-20020a17090a005400b00212eb0101cemr39243143pjb.236.1667334488515; Tue, 01 Nov 2022 13:28:08 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id u5-20020a17090a1f0500b0020dd9382124sm6315783pja.57.2022.11.01.13.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 13:28:07 -0700 (PDT) Date: Tue, 1 Nov 2022 20:28:04 +0000 From: Sean Christopherson To: Oliver Upton 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: <20221027221752.1683510-10-oliver.upton@linux.dev> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_132809_832513_5FFF558D X-CRM114-Status: GOOD ( 11.39 ) 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 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. > > 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. 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. 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel