From nobody Mon Feb 9 00:55:06 2026 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 384FBEE3F0F for ; Tue, 12 Sep 2023 18:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237618AbjILSqW (ORCPT ); Tue, 12 Sep 2023 14:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237544AbjILSqK (ORCPT ); Tue, 12 Sep 2023 14:46:10 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE19170B for ; Tue, 12 Sep 2023 11:46:04 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d7e79ec07b4so5870385276.0 for ; Tue, 12 Sep 2023 11:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694544364; x=1695149164; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=1yc1t1cPhcaHcfI5EVv9bF1nMQXNiuICbyEqqARRk08=; b=0D+IFsg/c/klBU+DNRVCXwQuaPdObjt4HEf0QzddULB5ht7UgbaNXDYbBQkw6l6+h2 bX6JEWXm/U32/BCN60XpkiaP24KDjH8ok6J3Vn4eFun8NNaBHThdBOVbhvZN+VrUuKiT YHDJM4NQtAfEbY0OaRb1dFlXL8b/frwQ2gJ3nFBKGUJZ1t1qj2AEZGebXZ8o0BVbFdf3 WNqFkx7x4GNC1yxEidYpQeAs9dKdAhdvYKbjQITFc9UVZ958ueUWhyGA1AT1XVF80ktf ISjhn2nWRyT+iQDFTSBEG6dz1lQDnamH1KnfihB3yvKz8F8mzXFNvTEv/sj25rpuZFLH u1Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694544364; x=1695149164; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1yc1t1cPhcaHcfI5EVv9bF1nMQXNiuICbyEqqARRk08=; b=Rbc6QwW8FcsYP2L71I0D9R2znHQFMQYygOKXODYZGabRBS0n6xZmN4cL2KIc4dPzYC OY9578ME0ALchru5WJT2BfqO4PsqIwznHdoUYt4HhgUC7Qm3HHYhNTQdxknbwMoCGhdd Oa/z6ggQpAGU/CK5m1R0QahM0RjXH6aJU9t2q0M0xTZ7Sjqxg/rJNDsUa+5MRYduA/VJ saBjy7VIFSsneQcKnTbW1DMngQrEtGWnKmm268bPutTOFfyUoUMUJEolNyuHEuWkCrSj A5UvT5ePZ3FfmrnXeH5O1ZK+yauJN3/cGSkPUJYDzq41ZIeGGy7BoS6xaKhl5E5asLvh G4qw== X-Gm-Message-State: AOJu0YzGPezj5qrCxmcgYDEoKG3nK19tS9a9iqdF5Fc6PIDxl1CPwm+t oE3awrkaVfzk6l0y/8+jem2ofLZLsCN5 X-Google-Smtp-Source: AGHT+IHHhcRDlPw3DSpf44fo6CQF4LFDpfJyENmkPgeVqzhES7DO2nLgb88kYl04s/IipXV1gy4yvLlc+lQb X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a25:549:0:b0:d74:6bcc:7b22 with SMTP id 70-20020a250549000000b00d746bcc7b22mr5283ybf.6.1694544363864; Tue, 12 Sep 2023 11:46:03 -0700 (PDT) Reply-To: Mingwei Zhang Date: Tue, 12 Sep 2023 18:45:51 +0000 In-Reply-To: <20230912184553.1887764-1-mizhang@google.com> Mime-Version: 1.0 References: <20230912184553.1887764-1-mizhang@google.com> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog Message-ID: <20230912184553.1887764-5-mizhang@google.com> Subject: [PATCH v4 4/6] KVM: Documentation: Add the missing description for tdp_mmu_root_count into kvm_mmu_page From: Mingwei Zhang To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mingwei Zhang , Kai Huang , Jim Mattson , David Matlack , Ben Gardon , Xu Yilun , Zhi Wang , Randy Dunlap Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the description of tdp_mmu_root_count into kvm_mmu_page description and combine it with the description of root_count. tdp_mmu_root_count is an atomic counter used only in TDP MMU. Update the doc. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x8= 6/mmu.rst index 22d221c180d7..4a82fa016833 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -229,10 +229,13 @@ Shadow pages contain the following information: can be calculated from the gfn field when used. In addition, when role.direct is set, KVM does not track access permission for each of t= he gfn. See role.direct and gfn. - root_count: - A counter keeping track of how many hardware registers (guest cr3 or - pdptrs) are now pointing at the page. While this counter is nonzero, = the - page cannot be destroyed. See role.invalid. + root_count / tdp_mmu_root_count: + root_count is a reference counter for root shadow pages in Shadow MMU. + vCPUs elevate the refcount when getting a shadow page that will be us= ed as + a root page, i.e. page that will be loaded into hardware directly (CR= 3, + PDPTRs, nCR3 EPTP). Root pages cannot be destroyed while their refcou= nt is + non-zero. See role.invalid. tdp_mmu_root_count is similar but exclusi= vely + used in TDP MMU as an atomic refcount. parent_ptes: The reverse mapping for the pte/ptes pointing at this page's spt. If parent_ptes bit 0 is zero, only one spte points at this page and --=20 2.42.0.283.g2d96d420d3-goog