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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6A0FC433F5 for ; Fri, 22 Apr 2022 16:00:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 51EAE4A0FD; Fri, 22 Apr 2022 12:00:58 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qR9juji4JA9b; Fri, 22 Apr 2022 12:00:53 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 65FE14B099; Fri, 22 Apr 2022 12:00:53 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id CD3344A0FD for ; Fri, 22 Apr 2022 12:00:51 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hqFxnAQEWCOV for ; Fri, 22 Apr 2022 12:00:50 -0400 (EDT) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id A982649F5A for ; Fri, 22 Apr 2022 12:00:50 -0400 (EDT) Received: by mail-ed1-f43.google.com with SMTP id 21so10972609edv.1 for ; Fri, 22 Apr 2022 09:00:50 -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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=B59WmKOmyKLqObKAYrr0Nd3oMvb1zTXWY8Y55DCWA51Dtj5KPWN31pUm7Q6DECCdEw KSBHAQvXsR06UMbAZIJjb6TqDEKsIcKHrJnrAdzGN2mPvXyKv8ml7ZlPDaYMxu6qFgn0 r7guBuL6nmDnu3nFX9pV0W6PtphTRWDjb3GgBrYKV+TmCx8DCE4cEE87S3p85fu+f3T1 gFjfRCMjOpVD5ZYAj3a3MkL/glhUssHZyZmJBI+2J3EhuJfHC8S8Xnut8x3y3OfzgHBZ sJ9g5lhUeJgpBdgiwgxZmB/w5IOt/tc53uzl7T9nLQTLnGgfK3HVb5t/LejD/QZbZKCN YYag== 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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=ARtSgmH4uvBPNrE//KvzkS/ZDv230BjCugX23xXpxsq2k7GtdGAku2QbqaRr766B1q EPPnYI57VvKpqapbpz7A/3YeOOJ3ivB+bCa4zdPXH485zGe7lTesIrgRpJVuWaI2vecX MY5QBg5Vuw5DAdNBQAD88wgCvnFpx2qns1R2xbC0W2ELQbeOl7m0l7WJmvYQbrn9BC5s iyyCBGSYEBjaj7nJykYcVYKN7ANICZkeaKa/6sFGcr82J+vknqu3V6UL7H89/ruf+q8e voIWxC8PSyL0Rk8IonU6C6g3roo6lIM5ulPDWL4TmoFxCE346aoFejusGVs6gI914DFn TvMw== X-Gm-Message-State: AOAM530sRFOSPH8oT7DGi1sW7UiafujO5WkrEswuMckfYBXlcclMgSZm 7n3BR4SPAWdUTXfamCvX1RFLI0Wp7Ap2lA== X-Google-Smtp-Source: ABdhPJwgTmz6DWsAH0vuu2Cgkvp4em5pC8WwDnJP/+KeAYOH3MbagaEyjkznZqW7nPRo1eklhTXx2w== X-Received: by 2002:a05:6402:5ca:b0:423:f330:f574 with SMTP id n10-20020a05640205ca00b00423f330f574mr5714790edx.116.1650643249420; Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Received: from google.com (30.171.91.34.bc.googleusercontent.com. [34.91.171.30]) by smtp.gmail.com with ESMTPSA id q7-20020a170906540700b006d5eca5c9cfsm867968ejo.191.2022.04.22.09.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Date: Fri, 22 Apr 2022 16:00:45 +0000 From: Quentin Perret To: Oliver Upton 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: Cc: kvm@vger.kernel.org, Marc Zyngier , Peter Shier , Ben Gardon , David Matlack , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thursday 21 Apr 2022 at 16:40:56 (+0000), Oliver Upton wrote: > The other option would be to not touch the subtree at all until the rcu > callback, as at that point software will not tweak the tables any more. > No need for atomics/spinning and can just do a boring traversal. Right that is sort of what I had in mind. Note that I'm still trying to make my mind about the overall approach -- I can see how RCU protection provides a rather elegant solution to this problem, but this makes the whole thing inaccessible to e.g. pKVM where RCU is a non-starter. A possible alternative that comes to mind would be to have all walkers take references on the pages as they walk down, and release them on their way back, but I'm still not sure how to make this race-safe. I'll have a think ... _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 40781C433F5 for ; Fri, 22 Apr 2022 16:05: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=VKxKd+6dwHBpFft6nNc5b8H/qZZqhejB9kRQALsG1so=; b=JMOjj5ymBdwRBQ /hzishcL05ctKaS4n6cJivnLtvdD/vn+xSHrTyjzEBjTAhPG3rUCfRwOIzv1D1zzOxhwo4+1smNxd m8LFOGWanvMdB3yhqaJKi3uWuUE75xe6tBRoN/yZnRYLdgQ6Li4VZrNh1h1jGgD4tzJmhBy/bzllf XxzzkWuWwvP+DvR1+/ROL8j7Y/2OCNZ21717vthw2nVCVEtgyaNIPXPpP7z/794isq4KjBsq6K8K/ vkbjbCurrLkHeR4lT7N1KFG5/qOfMr723+HFv6MhTom0s1VxMqU9EMy0HjkEIPkmeZy+jdBhm6xsO 7bHSr9dXeactnqeHqJFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhvlF-001Igq-LW; Fri, 22 Apr 2022 16:03:58 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhviK-001HTB-Cy for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 16:00:57 +0000 Received: by mail-ed1-x531.google.com with SMTP id d6so5868819ede.8 for ; Fri, 22 Apr 2022 09:00:50 -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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=B59WmKOmyKLqObKAYrr0Nd3oMvb1zTXWY8Y55DCWA51Dtj5KPWN31pUm7Q6DECCdEw KSBHAQvXsR06UMbAZIJjb6TqDEKsIcKHrJnrAdzGN2mPvXyKv8ml7ZlPDaYMxu6qFgn0 r7guBuL6nmDnu3nFX9pV0W6PtphTRWDjb3GgBrYKV+TmCx8DCE4cEE87S3p85fu+f3T1 gFjfRCMjOpVD5ZYAj3a3MkL/glhUssHZyZmJBI+2J3EhuJfHC8S8Xnut8x3y3OfzgHBZ sJ9g5lhUeJgpBdgiwgxZmB/w5IOt/tc53uzl7T9nLQTLnGgfK3HVb5t/LejD/QZbZKCN YYag== 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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=Rxhdxq8j56NPoJkwZXQZozUnOm26TqiHQO9+ILBI2g4KF6soz1CXu3jtGD3BEQnNwp KP+Qd17dVthbpSDzOQ5POk4zNcYuL3s8AX8LTNcSxafyv+FWSkX8j6/IffqVAco708DQ lfGLEYskafauq7//PfwndJnmrIjcr9240YghowZ13h/ryIUvr670RRDMI+dKn0IIMuIO 4HY03Qaji2bKgWa8XCkqBv0VIgwOO4s9uADdOq+8b44AVziu5Vwjbuo/6P0CQJIWplh7 x37AHVcGZdn1eYnLSQLGVXfgSxp8Vg2Y5xm6SjUwGlAW89YJ1qXECym4RfsRVHF9uMaJ sqtA== X-Gm-Message-State: AOAM532zW+87zwKnw1Pcz+HQ5P1DRNgD2xh5mAuzvILC4pe2mmt8K7ua vflnddVxw4MhD1DVb91XCWUMUw== X-Google-Smtp-Source: ABdhPJwgTmz6DWsAH0vuu2Cgkvp4em5pC8WwDnJP/+KeAYOH3MbagaEyjkznZqW7nPRo1eklhTXx2w== X-Received: by 2002:a05:6402:5ca:b0:423:f330:f574 with SMTP id n10-20020a05640205ca00b00423f330f574mr5714790edx.116.1650643249420; Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Received: from google.com (30.171.91.34.bc.googleusercontent.com. [34.91.171.30]) by smtp.gmail.com with ESMTPSA id q7-20020a170906540700b006d5eca5c9cfsm867968ejo.191.2022.04.22.09.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Date: Fri, 22 Apr 2022 16:00:45 +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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220422_090056_491051_8CE522B5 X-CRM114-Status: GOOD ( 12.74 ) 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 Thursday 21 Apr 2022 at 16:40:56 (+0000), Oliver Upton wrote: > The other option would be to not touch the subtree at all until the rcu > callback, as at that point software will not tweak the tables any more. > No need for atomics/spinning and can just do a boring traversal. Right that is sort of what I had in mind. Note that I'm still trying to make my mind about the overall approach -- I can see how RCU protection provides a rather elegant solution to this problem, but this makes the whole thing inaccessible to e.g. pKVM where RCU is a non-starter. A possible alternative that comes to mind would be to have all walkers take references on the pages as they walk down, and release them on their way back, but I'm still not sure how to make this race-safe. I'll have a think ... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A29E3C433FE for ; Fri, 22 Apr 2022 16:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448891AbiDVQD4 (ORCPT ); Fri, 22 Apr 2022 12:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1449635AbiDVQDp (ORCPT ); Fri, 22 Apr 2022 12:03:45 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 178C455236 for ; Fri, 22 Apr 2022 09:00:51 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id be20so2631196edb.12 for ; Fri, 22 Apr 2022 09:00:51 -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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=B59WmKOmyKLqObKAYrr0Nd3oMvb1zTXWY8Y55DCWA51Dtj5KPWN31pUm7Q6DECCdEw KSBHAQvXsR06UMbAZIJjb6TqDEKsIcKHrJnrAdzGN2mPvXyKv8ml7ZlPDaYMxu6qFgn0 r7guBuL6nmDnu3nFX9pV0W6PtphTRWDjb3GgBrYKV+TmCx8DCE4cEE87S3p85fu+f3T1 gFjfRCMjOpVD5ZYAj3a3MkL/glhUssHZyZmJBI+2J3EhuJfHC8S8Xnut8x3y3OfzgHBZ sJ9g5lhUeJgpBdgiwgxZmB/w5IOt/tc53uzl7T9nLQTLnGgfK3HVb5t/LejD/QZbZKCN YYag== 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=Z64NNLHkcUmTZj8rPBl+zXy5wRD3qI9VqCl/OwwNbD8=; b=XBrxvW9sTL02JHu8UJWgvDuuSq4k2dmvbS0GHMAEdVLAdFLvwz6H3IODG0q+36h8hI cQl1yRgViL4OHdugGSM7JQ5Et8J5zrOmQbMj6/czTXTpQWxsHCs/31OrL6d/2wlLa3Ku QBRagnBKpCoqyzUog2+VIN3lkMNEflNqRLALgPhCUU6UBOiVlpY71gQdEUgj1q+d6NxX 3h7EsFwCt9sw4jnTO2aWFGXchHkgQZ9VKFa20kFQWpkqBBYEaVbCTz82C3GmDNl1i9Pa Fwo1u21OERB+ZMRPCamhP8FB76DIGd+cdf7+MkZaFbzVl4yb8aJX9Xqvd0GcmIrTa7jP 83MA== X-Gm-Message-State: AOAM530bsGAMgYFDGIhvbPXLrQrhjV1ZrL/BCTl8fjjCRrrNdswitJWw qJt/OBcEUI9gDd7DP9zFHchQfQ== X-Google-Smtp-Source: ABdhPJwgTmz6DWsAH0vuu2Cgkvp4em5pC8WwDnJP/+KeAYOH3MbagaEyjkznZqW7nPRo1eklhTXx2w== X-Received: by 2002:a05:6402:5ca:b0:423:f330:f574 with SMTP id n10-20020a05640205ca00b00423f330f574mr5714790edx.116.1650643249420; Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Received: from google.com (30.171.91.34.bc.googleusercontent.com. [34.91.171.30]) by smtp.gmail.com with ESMTPSA id q7-20020a170906540700b006d5eca5c9cfsm867968ejo.191.2022.04.22.09.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:00:49 -0700 (PDT) Date: Fri, 22 Apr 2022 16:00:45 +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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thursday 21 Apr 2022 at 16:40:56 (+0000), Oliver Upton wrote: > The other option would be to not touch the subtree at all until the rcu > callback, as at that point software will not tweak the tables any more. > No need for atomics/spinning and can just do a boring traversal. Right that is sort of what I had in mind. Note that I'm still trying to make my mind about the overall approach -- I can see how RCU protection provides a rather elegant solution to this problem, but this makes the whole thing inaccessible to e.g. pKVM where RCU is a non-starter. A possible alternative that comes to mind would be to have all walkers take references on the pages as they walk down, and release them on their way back, but I'm still not sure how to make this race-safe. I'll have a think ...