Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1295793rwd; Thu, 8 Jun 2023 15:52:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4m119QCpVT+sXEGZk9eBJKPbxhq3T2/gbErABVae60eJ/q6dzHzrTcyfWQiUn8SJmqRzwJ X-Received: by 2002:a17:90a:e645:b0:258:8731:4e3f with SMTP id ep5-20020a17090ae64500b0025887314e3fmr5353116pjb.44.1686264738060; Thu, 08 Jun 2023 15:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686264738; cv=none; d=google.com; s=arc-20160816; b=L8qzpfVL5FbZ/okRtb5j/tUpsPbS8vMVKIwYgePQ4pL5DYj8NrkSz1AWyXMF829h9P DlK5HtlxnBmX44LFVC6htcrkubd509us0vjN+gV4axNhwEhjRTuD1x7wU2M+FG7Ogem2 GHLoOXc+BIY9jak8BQHVb/O1KHl/eJzVy85nvp55D19yoxcWP9JuQHHulNvWuxtUGMoB vh1atA9cSxUAk8cg4aA1Aggf1WTDanBISXl46xV9IPsXBHuIBcSH5SLruinzB4N2hZ0h E0/iVybY0VW5s7kwmwfnM+2M+J6wzhbvg1Nqd177jkb8KLwZg7ZgBnOb9PtxgCzOFFfM i0YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3VvOVkeoZOg8bLOTHO/XPAd+duFpOWtxmm7bgNMjwIY=; b=PI+2lttAC1mBE/i7H68iMt6CwudnvOD3/JmyttcZmelSOjJCEqcwCzq0Vst9JMTBnG cnuR/6OdbwYrB3XWvUKskJxHCv3rVyCmpm5VxBZ1KOovIBULIJDjjNVpkjCRprPNLRub whKJ9pYv50+kWMII7cjpXEy1ylPweryR10u+kOwPSMpyx8ajbs0NwfpUuzONUVqe3DcA zCfn1KSy1dP5mW453N0tfX6pQp9rGA4X6nqd8HZQjf8wtLDQdLG24tASXM1X8fJjuL5T ZGsRz0fOOvcA3bGnSpxFwWfd9K6eVMYHbNZ5UrhfDdiKDZrNmTjlOPrMiyZeTlnDXOB7 VV3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=SMu023XU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a17090a2e8c00b002590f26818asi3452190pjd.0.2023.06.08.15.52.06; Thu, 08 Jun 2023 15:52:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=SMu023XU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236702AbjFHWOZ (ORCPT + 99 others); Thu, 8 Jun 2023 18:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232715AbjFHWOX (ORCPT ); Thu, 8 Jun 2023 18:14:23 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399B212E for ; Thu, 8 Jun 2023 15:14:22 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-33bf12b5fb5so154425ab.1 for ; Thu, 08 Jun 2023 15:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686262461; x=1688854461; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3VvOVkeoZOg8bLOTHO/XPAd+duFpOWtxmm7bgNMjwIY=; b=SMu023XUb3hUwIzFGWt7VF8BORxCe6qv0OHg6vdrhD5Q4hLPfovNAjr0cpYZV8z2I/ qHID6Y26hyv84vgV4sRxmcjOHqHB9zneqOuERsO+QZqGoJD6EuPi/tCWSD6tbQaA3fou PwdFkNkXuG3YYckZyScVzMBNineCRvCgVZisP4yKzy8widSfC3WO5Rdswlha0rTnzQ5x lApzjhUZW0UOMN1V5LrmyLByurKV6qUtslTaxRWs0xEvEXHZg8EXB/xjasb5LBpcVLJj MnAkI+Foz+xbPY49w7StsDbIO5zpJ8/FSA44sxcMv/ksNtaKeDsul2wT1XNl9XBpGcC8 /O2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686262461; x=1688854461; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3VvOVkeoZOg8bLOTHO/XPAd+duFpOWtxmm7bgNMjwIY=; b=gQaN0ZSZToAmZwMvZXpL1m2kDdqC6F1bOOwsUbePYUgRBq79+CKyf7iOCZVEgQXXaT 0KhISup/CUrToj5Xf2TwHfQtFhB65a0h3uXPEeJ+n5PVZHPk6RhRcjuU01/N1sXySCC4 wgtVd2hA16wgeg5w8neZ+p1WIqVfAub4XXq5/ZeJUfCxYHfPZjtrcmVcrujDqOiln4JD cANEnpxPyL+apJA1SMYjzQu3a+ECi5GMR9FJKaS9sA9NKCKXXLnj9+0PgFytbxPyccVb ihDQGY9BhT/6bVQO2mWUg1/WWZZPYrF4GQbXLslz/Kr+hqLcbbZZxm1Qbv5wO0za+gFN eHDw== X-Gm-Message-State: AC+VfDyvuj0o8x94Kb2XwX1Of0NGzb+PNAkW2fs0Bzzn0jz3OZDV/wG5 eZE1oZf7RX4JfHfQ4aELW6LHcTNALl9EP8yElch/ag== X-Received: by 2002:a05:6e02:1bac:b0:33b:5343:c1d6 with SMTP id n12-20020a056e021bac00b0033b5343c1d6mr215059ili.21.1686262461249; Thu, 08 Jun 2023 15:14:21 -0700 (PDT) MIME-Version: 1.0 References: <20230608220558.39094-1-ctshao@google.com> In-Reply-To: <20230608220558.39094-1-ctshao@google.com> From: Yu Zhao Date: Thu, 8 Jun 2023 16:13:44 -0600 Message-ID: Subject: Re: [PATCH v1 1/3] KVM: arm64: Consistently use free_removed_table() for stage-2 To: Chun-Tse Shao Cc: linux-kernel@vger.kernel.org, oliver.upton@linux.dev, Marc Zyngier , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Ben Gardon , Gavin Shan , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 8, 2023 at 4:06=E2=80=AFPM Chun-Tse Shao wr= ote: > > From: Oliver Upton > > free_removed_table() is essential to the RCU-protected parallel walking > scheme, as behind the scenes the cleanup is deferred until an RCU grace > period. Nonetheless, the stage-2 unmap path calls put_page() directly, > which leads to table memory being freed inline with the table walk. > > This is safe for the time being, as the stage-2 unmap walker is called > while holding the write lock. A future change to KVM will further relax > the locking mechanics around the stage-2 page tables to allow lock-free > walkers protected only by RCU. As such, switch to the RCU-safe mechanism > for freeing table memory. > > Signed-off-by: Oliver Upton > Signed-off-by: Chun-Tse Shao Acked-by: Yu Zhao