From patchwork Tue Aug 1 00:21:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 128964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2398795vqg; Mon, 31 Jul 2023 19:44:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlGwf3cQy/oqCBd61LjBoQUH+o6wcmHzgQgLcKQSWuUyk6KgBowW5JnUNieALhX23pJIKI4f X-Received: by 2002:a17:902:e546:b0:1b5:561a:5c9a with SMTP id n6-20020a170902e54600b001b5561a5c9amr11856755plf.39.1690857888700; Mon, 31 Jul 2023 19:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690857888; cv=none; d=google.com; s=arc-20160816; b=N1kQG1MK/T+7nkY+/zgVfkOmkPihkLfjEQkIL7wOtMjUeWsYJtL1OX8AmR1q7NiheN PmDQumuKhrqPa1KCBimkg76DyruOfEZW+5YiJazQTkPwFcSD1y3BmFVyXNGm+JadCOtN 6o1wJ7VTYKSrL6pq18i3dXGluwFytIWdXvUhYtxTnECms9sguNfD24VwCTwBaJWrW5iV 3+NoEha0KmPldB8pcYFmjBhDbWIwieFRGyFnGMOS+EcgMvwDdbS0zii7vMASje4JaqOe nHX+/2AQqRSW4TUgbp07t2YzEWToJHxRnChgsDhLIRgALSEtabiB9AwMgS7x0e7odgb3 M+tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=MiBo42sK/GMXkVAkei5JHweORvWMqcmgUZYS33J6fF0=; fh=gya5F2cZq9WTAdFit1IlKDHE8FQoHEyxSPkqDAO7wTs=; b=e123muBzNZV+dfCauekiYHvQz49wA1KIta4MWvr3Sy3yqrKU8mioKWQQMoaRoPJj27 4rFPnVYo/lyPt/RDVOs1r1U+YcS7N3YR2AeYvd7J7SshSMm1s3LBOT0Rv0M5QcF/ljby T1j3BlXiJke33prggE2HRI62kFELMvy8woA1zN1sZVpCtpJU41Yhr3QZ8kBtmYIjwui/ EjFDzsxP9tgnwb7e6ZiRiVTlXoEBg3ac31oKAybIbNwmlXs4pZhcMH8x7Wm1go/1D75E nkAF0wy5rfHx3jaQXN7dXHHuccOpq90dAtWQWQjC/tAArA+HC0nhyher/3ALJSxz6WOe mxWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=xCOyw96l; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a1709029f8800b001bbd2599ac7si8226373plq.53.2023.07.31.19.44.35; Mon, 31 Jul 2023 19:44:48 -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=xCOyw96l; 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 S231350AbjHAAVl (ORCPT + 99 others); Mon, 31 Jul 2023 20:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231243AbjHAAVg (ORCPT ); Mon, 31 Jul 2023 20:21:36 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31933199F for ; Mon, 31 Jul 2023 17:21:34 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5704970148dso61350587b3.3 for ; Mon, 31 Jul 2023 17:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690849293; x=1691454093; 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=MiBo42sK/GMXkVAkei5JHweORvWMqcmgUZYS33J6fF0=; b=xCOyw96l+NGIsCoqla91ojMChbo7SK0mxjsBS5En4m6U8FZuat4rWttoEUC2kEUlRC Kc5Tdi3f/aC074kdK9WPVcbpEqFOD5snoJtJRh/GW8NPp7DdzGioQ2jCQ53aKAAMVNgV H5LOLNlPJaayXRR+pgE4o+eqbb3X+xSKM0jo1106+iKscpzsP1EGPa0ydb/aj4FLtxsY 0donlqAlwXUUmCYafnPKmqmI1HPi+8LHmgKCNUbUmu3rVwJ7KhsLSWeNCX/OGzUbsggN aeRLetSPiTZb1U7EoSaftIT6N09FIkj+uoCbe5WsmP3ETqmIpdraN0k9VEsoVBooWVQW kbAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690849293; x=1691454093; 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=MiBo42sK/GMXkVAkei5JHweORvWMqcmgUZYS33J6fF0=; b=fAeug3/AhttJqMB+6N0bVyj0WI+r6HEil6+wOCO1C1E+4ZVpVwM0rCTyKfDhIPGnYl Usid86mNANMbCo5Qys8K1qWOPTbEKcgyoiXY+X6nzjRoopLN0LKUZFzTzHCAMCE0T2Yi iYuCjR7JSxLwXoUFESv2PNAeN7jp+Wlb9Kk6IpNn5BMjloE70jZ+THzhTtbyHQ/RZ4lv 4PghumJ8cOnFHRl60GlOvk4G16EaKe8tC0bAlmAwPTLs6m0RVAO8K7J0l17QKcPUmUuy 0s/5fObTJcmOAlZZmwc5uRq7vulFIejEOxE5CAn338rijqbxNPQwKEIuK6GFNZ4Io1Du QZQw== X-Gm-Message-State: ABy/qLYR5YQcZoTS4TvcG+q+7VDxcgvl16I6gMV6OipY+w3PVO6ykH/M bUehQXrwwAjA8NBsWcSCy5v/fWDRisZd X-Received: from mizhang-super.c.googlers.com ([34.105.13.176]) (user=mizhang job=sendgmr) by 2002:a81:b710:0:b0:576:92da:cd3d with SMTP id v16-20020a81b710000000b0057692dacd3dmr79492ywh.8.1690849293487; Mon, 31 Jul 2023 17:21:33 -0700 (PDT) Reply-To: Mingwei Zhang Date: Tue, 1 Aug 2023 00:21:22 +0000 In-Reply-To: <20230801002127.534020-1-mizhang@google.com> Mime-Version: 1.0 References: <20230801002127.534020-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230801002127.534020-3-mizhang@google.com> Subject: [PATCH v3 2/6] KVM: Documentation: Update the field name gfns and its description in 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 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772993001284874286 X-GMAIL-MSGID: 1772993001284874286 Update the field 'gfns' in kvm_mmu_page to 'shadowed_translation' to be consistent with the code. Also update the corresponding 'gfns' in the comments. The more detailed description of 'shadowed_translation' is already inlined in the data structure definition, so no need to duplicate the text but simply just update the names. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 561efa8ec7d7..35e642303962 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -221,11 +221,14 @@ Shadow pages contain the following information: at __pa(sp2->spt). sp2 will point back at sp1 through parent_pte. The spt array forms a DAG structure with the shadow page as a node, and guest pages as leaves. - gfns: - An array of 512 guest frame numbers, one for each present pte. Used to - perform a reverse map from a pte to a gfn. When role.direct is set, any - element of this array can be calculated from the gfn field when used, in - this case, the array of gfns is not allocated. See role.direct and gfn. + shadowed_translation: + An array of 512 shadow translation entries, one for each present pte. Used + to perform a reverse map from a pte to a gfn as well as its access + permission. When role.direct is set, the shadow_translation array is not + allocated. This is because the gfn contained in any element of this array + 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 the + 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