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 7587CC433F5 for ; Thu, 21 Apr 2022 13:23:10 +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=9UjwIuUy8I4rYvpO8Oimzpiq59kOQhKzMqB40Aasu6k=; b=eKcWFM2jPNzT+K HdYWra6ST/9ovJ7VpL3/WT58uzAjPn6849sWreXJc7vFz1bdptml/c3vLDfkOtEOxjDW+tghbNtsg pOeLqUZOOr34swRKd07VmlW9VKIxwTVsERnsEYmyc5IEZr0cvgn8Nfgswnxq9IAdBASzY63FANjSO 47SS0TSn6Li06H5AxRbjjn91WMfO0lIdK3wf7ITBF7YdH51iJzI2KWr6Q/L0GVrhPGtIqbSFlWtBH cplDXZDC4wvZzHciuutCubZp4KHbuwanlzs4TIr+MSRxsTpUagVzTHnilpeK30wAzReQS340TbGZA muzdQzmgNJFM7x8TRUZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhWl0-00DX6N-I0; Thu, 21 Apr 2022 13:22:02 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhWkx-00DX4z-Dp for linux-arm-kernel@lists.infradead.org; Thu, 21 Apr 2022 13:22:00 +0000 Received: by mail-ej1-x629.google.com with SMTP id l7so10056864ejn.2 for ; Thu, 21 Apr 2022 06:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bXKpCYOj7t5BTPU5Wz9Ftw9cLOsid4GfV8dHQSkHd4o=; b=joRBLzIQeXqtjzT9eaoBB9pMC8QXEJyX4Tvbdj14LJYa8ePIyVTTUx6BsluwFjnR1/ HEypwr6hZPa9K51uwAM+mqB+4jCKf/HL6QYDsPSPHeBplmqqCCkSouKRgcxR7oXU+LZy JnCdjEb5abHlvdkHEy0yTCTsj6v8oXeDODKtTz1Z9MRmLCL5o7EgzBaKYqVXMgnAVBTi glNS6gATueFfFmQpvMxE0CyfSvrd+ySR0fTuSXemP7mP9yEXPsxZwITUyFbJ3LJiIEpY kBdhSVUmzoOl18V0Q5eTPLHb5w6h0tYMNzxun41SeG79AYgp7mY5A5gTwSJyUEzIuTXf CgEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bXKpCYOj7t5BTPU5Wz9Ftw9cLOsid4GfV8dHQSkHd4o=; b=Cyz6rI5OyPB588UyRT8AZ6/ktq/zDaNcMd9UM2mVHbLsTyvA/bN9Sh48bRnNABKeLe SP194Z7nwQdZsGPspHqLoZtRziFMxUk4r+t8vvfWxNBnT3f110PX788qYcPCXWvzgLM7 CuypIZViGs17iXJDzPXrTLhawAJImVmBeu9M3KQIUIjUMMlW/B0ZEXB0uZ1VzU9I5ne+ ar6NKfqYFqamxKOoUCdXG0JK6BqqcZiHYXe7dam9z5xYsjfcBwLcHg8JVyDEQA0cV3Cb HtqkLUv4jf2l3pjslt7K6ult0CoUlzAlnTYl3pPnOvT2qABp4xBazs3IuX8rCaX5d+eT srPg== X-Gm-Message-State: AOAM530ChMqIvS3cVbgys5/QPBqjZQV2fUsDWXzRaY1gy+Hdlm0q3pcV /3KFR5ez+aAs3srNw2olQ28AAg== X-Google-Smtp-Source: ABdhPJx1L9hShjNwK94hggJJiK6IFYK/sCAP5IkmWVOxrAJcbXpmJ83JIVZImsLcCV+kjJl8XfiyJA== X-Received: by 2002:a17:906:8554:b0:6e8:c43c:12b3 with SMTP id h20-20020a170906855400b006e8c43c12b3mr22510752ejy.331.1650547317768; Thu, 21 Apr 2022 06:21:57 -0700 (PDT) Received: from google.com (30.171.91.34.bc.googleusercontent.com. [34.91.171.30]) by smtp.gmail.com with ESMTPSA id d11-20020a056402400b00b00423e5bdd6e3sm6063712eda.84.2022.04.21.06.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 06:21:57 -0700 (PDT) Date: Thu, 21 Apr 2022 13:21:54 +0000 From: Quentin Perret To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Marc Zyngier , Ben Gardon , Peter Shier , David Matlack , Paolo Bonzini , linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 09/17] KVM: arm64: Tear down unlinked page tables in parallel walk Message-ID: References: <20220415215901.1737897-1-oupton@google.com> <20220415215901.1737897-10-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220415215901.1737897-10-oupton@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_062159_499938_62C5FF1C X-CRM114-Status: GOOD ( 14.36 ) 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 Hi Oliver, On Friday 15 Apr 2022 at 21:58:53 (+0000), Oliver Upton wrote: > Breaking a table pte is insufficient to guarantee ownership of an > unlinked subtree. Parallel software walkers could be traversing > substructures and changing their mappings. > > Recurse through the unlinked subtree and lock all descendent ptes > to take ownership of the subtree. Since the ptes are actually being > evicted, return table ptes back to the table walker to ensure child > tables are also traversed. Note that this is done both in both the > pre-order and leaf visitors as the underlying pte remains volatile until > it is unlinked. Still trying to get the full picture of the series so bear with me. IIUC the case you're dealing with here is when we're coallescing a table into a block with concurrent walkers making changes in the sub-tree. I believe this should happen when turning dirty logging off? Why do we need to recursively lock the entire sub-tree at all in this case? As long as the table is turned into a locked invalid PTE, what concurrent walkers are doing in the sub-tree should be irrelevant no? None of the changes they do will be made visible to the hardware anyway. So as long as the sub-tree isn't freed under their feet (which should be the point of the RCU protection) this should be all fine? Is there a case where this is not actually true? Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel