From patchwork Tue Sep 12 18:45:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 138483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp742236vqx; Tue, 12 Sep 2023 16:30:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpCOYbeSlXBZkuoCzUaW7NLgQOGZniYTbGbHn1QyP1b4PzkMb66sCPDlhHvJoXllVggJj0 X-Received: by 2002:a17:902:d70a:b0:1b8:76fc:5bf6 with SMTP id w10-20020a170902d70a00b001b876fc5bf6mr1145077ply.43.1694561431730; Tue, 12 Sep 2023 16:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694561431; cv=none; d=google.com; s=arc-20160816; b=Roft6rplqNf8byRusWUXqoLJJpJwS0fu92opm+NygK260VznDIWGkBDAbv1xdOlLuQ ikiNeysom+oTIawik9glbAdeIavl6H1Qd+EZ6ATI5yoa39empj+zEaHzMJ100rVwu78W /YGhmk0B9XByZf/eyRD3M/rhCyV+utEK7HNvBk2dS7rqe1Ccs0EcGyUu3ABQHvmk+qxy MJIYQlBrqmtXdfPNmRBHov641xwGKUYpLhfxHBT1+u54aB66n+O5HriDp0Yh6zhUogH5 BM5+T/MWQtyIVnSFuQqvtprJWbNND9fUQWlU4Mzqo22WO/0wXg2fyiOyJMGfyrqQBcvl X7dQ== 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=qTWRNy0B9f+ysXrRobFDRO6uVjKtmJ5Zj+3oA+uRqFw=; fh=oepeMie6ME0MwNRfBVLnM5ecOy8V5MJ/o7dp7J50CP0=; b=NcyTOauPWEFGFqrOaTbegp+gLxXK2OoKdlfqlAVvZYWVsd4hHI2hQhfP4QxF6atOqO CGz7aoKEHZL118SJMy5aHoLwTkZBqQLmWKDVD0ZyUiFSaU3tf0Inb6QBJyBWbm17DZwi ETQM+9ppjsOwINsuPt+UUdW0jECO/jhQzJGgx1ALaIU/66HnVX2zyBCMeS0buZJunYLt W9tdu0E0gnFtsDbIDq8HGutgy5dhXW4+rD5gqn3NHYHcox40t+j422OkHXiTIn1tDCjs hw8hAfwkeLMX8AHkbQI9uQE3FVJfeMVaJSXRHjOp+Q7n70qBfLJ2GBil75BEfwoNvgQa ovIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SCrNki8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n13-20020a170903110d00b001bbcddc33dasi9202993plh.180.2023.09.12.16.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 16:30:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SCrNki8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 63B0F8160387; Tue, 12 Sep 2023 11:46:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237520AbjILSqI (ORCPT + 36 others); Tue, 12 Sep 2023 14:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237472AbjILSqE (ORCPT ); Tue, 12 Sep 2023 14:46:04 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9A0210D3 for ; Tue, 12 Sep 2023 11:46:00 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59224c40275so65957377b3.3 for ; Tue, 12 Sep 2023 11:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694544360; x=1695149160; 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=qTWRNy0B9f+ysXrRobFDRO6uVjKtmJ5Zj+3oA+uRqFw=; b=SCrNki8Jh/KDjueh7CYSf8v07IBDd9cSO/+obsBUIryLQl7iWKfUYdvrOP/lP4xd12 pUB6Q9ptoCMePKL0iBY3/KqftWHmf2MpHdnvDsGEKJwgQvlMGH0+lpOa/Xyz01zV/PIR rhn8WPzS6ljB3+62B7C3ZQ+Ish0RWVTcq376F5xXgAZt8TgiQRwhzalmvzjTRDa7fMJz TqfjDKafiSVCk6Wro+5heXmfd3NbS6aXrDYiZU5c47CdyEM+QU39EofFWnrAoUs+u2yQ yB2dGwwl9pz2fSygR3HGud1CQUHAv+bh5xXalmEOZq00EyvEIOc8EWW5hgQtMBrvmbDz zajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694544360; x=1695149160; 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=qTWRNy0B9f+ysXrRobFDRO6uVjKtmJ5Zj+3oA+uRqFw=; b=k8rcEhUtx51oo+0poVQqAh88xnDfl+FIF9SC7dq/ZpzDDZ2qw1bvlJSH5tJexzLIbb Lqlgdqhn0YPzowEqKyLSHeqi7lrPSXwQfZrN2v+YA51Spq9r9AbEgHF831NXcVxYjoIN RSeq1LyTe7F8nC/yn03rxxtWl5JhDbODRR6x5q4D1lx8GEGKoNEYQw2e2V+pjjZwXJV0 9Qe+XSKvYASbHQr+elBlZI28YiL+V1PtVIGOg1WdM7C4CLroumXJolHj5z8TRExMYxWm JYyGKNEX8f8SmBTbGJJg6EqhCj5g4HJ/IT3CM8qH08bPh9dnVk36VqUu9S7IV7aT/9b9 x9kQ== X-Gm-Message-State: AOJu0Yw6BwktWVF83AnOyzeno/yrcDHDFENqNmIiEzkHx/q1jSbQHNy4 81vdj5EKbTWxVCQZqJsQJ70in53kFnZa X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a25:949:0:b0:d80:ff9:d19e with SMTP id u9-20020a250949000000b00d800ff9d19emr4790ybm.9.1694544360050; Tue, 12 Sep 2023 11:46:00 -0700 (PDT) Reply-To: Mingwei Zhang Date: Tue, 12 Sep 2023 18:45:49 +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-3-mizhang@google.com> Subject: [PATCH v4 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 11:46:25 -0700 (PDT) X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776876447846334829 X-GMAIL-MSGID: 1776876447846334829 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 23c20455d4e7..f659f282357d 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