From patchwork Mon Jun 26 18:20:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7707084vqr; Mon, 26 Jun 2023 12:29:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Tf3731cRzZr44Lxk40hf6Ti94IsWM3LZgGPzBM1nVQd5R+IAu4mejlZ20O66qTog/ADu0 X-Received: by 2002:a05:6402:50d4:b0:51d:a5c6:37c1 with SMTP id h20-20020a05640250d400b0051da5c637c1mr790616edb.1.1687807779078; Mon, 26 Jun 2023 12:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687807779; cv=none; d=google.com; s=arc-20160816; b=t4msOiSEAeGqfHejUR9nbIfqWtjhNL7F3mTiRxc401pdW+HHaIc3qy9/0Cpkua0biX 1Xsanu1MF40bZG0j+7kLD4SqRCJFtV2X09jEYbCm30eTXh9yZITgu2IFHiFXe1WC2MFS 09igtUzX70i/yQqRbUXYbajMTVC4BoN1Syf5N7ZbMnwNye4s3K5d4EE9aBbGnNypkSC9 RFV4H0/znkQ0bBIrBP+uFfbfaBZbHlDAGdp4z0siGFDsAoarOGtZfcDUqMiL8A1YTsX/ X2OkqTP+aodVg37lQaob5mRF0Lzu1mRGqUM+NG+1388uorVwGEn+YtBQao1Y+u4x3+f1 Zrog== 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=Y2F7UYJOU65mERHIxW2LZZxZD/ZR1RVDUwRiTiwItys=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=TJrKhB58frikYa6jqUPJIRmYAf0Q38MvREPulp/CAmP6S2dRhRNmJt3cOx/5KgqdC2 7k37+jNwD029Zqf33n2yljxyBEmJE3USy4/uPEvRXFTuqQLe8VW6bnImqb8/+qlhU6Ny vT6EXxv5/7prCrHuuBixFMKnsXZtEVzw1jsKhyCrMo7F5BAGjUxnoBCn85eG6LMT/9k/ 3y9g2UqsFuxrPOAwwFej0j0FycIN97w8W6M1cjk9dEglyGyhz9FRK8qauOdbSDKnSJy5 MEHw0QAWJszIx1DmZ1KIsw5ZXkcSP/rz1x6Is1UfAgsbio9F1gw11kf/Wzn1uJEKhq/u AciA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6QKwtXOY; 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 x17-20020aa7d6d1000000b0051d8b721498si2458074edr.99.2023.06.26.12.29.14; Mon, 26 Jun 2023 12:29:39 -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=6QKwtXOY; 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 S231656AbjFZSUj (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231218AbjFZSU2 (ORCPT ); Mon, 26 Jun 2023 14:20:28 -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 1FC7794 for ; Mon, 26 Jun 2023 11:20:23 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-565ba5667d5so46453637b3.0 for ; Mon, 26 Jun 2023 11:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803622; x=1690395622; 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=Y2F7UYJOU65mERHIxW2LZZxZD/ZR1RVDUwRiTiwItys=; b=6QKwtXOYY51Y7PQ7wfsNGjwbER6Yz6DPkobVYnmu5EEdKXoy/LHSOUX9cZtrLAgc6l litzVO5osAdbdQOcIO9Ga09HDzeq991xxbTlUdrk8DGRDuLeBMBX+1QgBMHmD00U7ZCs X9QGUnLkynNHJD2SfzoWZF3tX+dVdOMrEIHLmIWcHx1Rh7x8bqAaZDEP79yvnQE5l379 DXf9OnZQ/SLCBLcWzSD/1BT/NnxYx71SyISYFLLWR0lBQoIauVezVB7226VQnLXs2zJx MWP/ZgD4p03HYOWXNnBk2ZC/IgiMVf9tmFf4kqkp2snXcUqAA7joP+HYybq1y12XLq3c YW9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803622; x=1690395622; 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=Y2F7UYJOU65mERHIxW2LZZxZD/ZR1RVDUwRiTiwItys=; b=W2rsSzR9kAmlWap2U4PLbiG6yTf1NsN08hYV68WUjnxD9AaLrvlePtubFY2GwHU6jO trPxB3VJJ4sVPNKXx5Lkj/xQ7zBeskrIXbWQ8g6Ajbu7nsktXX0o3jib6ICHIxa/3voV Eb1RJPhr74gpdACbUqW6vjkAKbBa9ZyHanM4rZkLibG4qVF7IWJ95h+sAmJ2BEb58RxD yV1xBmhk6CXA1dK4bViofhCVqjK8RUgZEwDoSUVaBNWf9BhlkDKYWXSkV6ppJ4cEFzRn rPq+l5zE/LaQ1Ml/Eqe2C5/X2Igf6wvpbqzVtVTckIPNuDM9ytyecyNs7qgtj6voI6nA PI7g== X-Gm-Message-State: AC+VfDyXJRkdkz8G+NEvDBoLeGsSibnpSHghKWo/oOA3WCPdjLrWSxD/ fwxcFFMo6hIAkemV6EuMDud6pWtJwI/v X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a25:e0d1:0:b0:c2a:e79a:fc11 with SMTP id x200-20020a25e0d1000000b00c2ae79afc11mr130358ybg.9.1687803622386; Mon, 26 Jun 2023 11:20:22 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:11 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-2-mizhang@google.com> Subject: [PATCH v2 1/6] KVM: Documentation: Add the missing description for guest_mode in kvm_mmu_page_role 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 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,USER_IN_DEF_DKIM_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769794729844278163?= X-GMAIL-MSGID: =?utf-8?q?1769794729844278163?= Add the missing description for guest_mode in kvm_mmu_page_role description. guest_mode tells KVM whether a shadow page is used for the L1 or an L2. Update the missing field in documentation. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 8364afa228ec..561efa8ec7d7 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -202,6 +202,8 @@ Shadow pages contain the following information: Is 1 if the MMU instance cannot use A/D bits. EPT did not have A/D bits before Haswell; shadow EPT page tables also cannot use A/D bits if the L1 hypervisor does not enable them. + role.guest_mode: + Indicates the shadow page is created for a nested guest. role.passthrough: The page is not backed by a guest page table, but its first entry points to one. This is set if NPT uses 5-level page tables (host From patchwork Mon Jun 26 18:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113098 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7702420vqr; Mon, 26 Jun 2023 12:20:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sKA0u7pG8EIQ616CAhrcgcfWdsuHzJcBvm8yWy3vCQJf7mr2V+jeGYaWChFLHmxuk0xDQ X-Received: by 2002:aa7:d790:0:b0:51d:91c2:679f with SMTP id s16-20020aa7d790000000b0051d91c2679fmr5450642edq.16.1687807207980; Mon, 26 Jun 2023 12:20:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687807207; cv=none; d=google.com; s=arc-20160816; b=Uf3yR8RU5hiFESmJnUGOjktSJkDfJUg4QTBqIt3TUPe7phIOYdPY5+2YaWYaC/KMD6 T60qjcj4ahrygbwQsFXpVfWvdOLOV/34pHD8NPb4//O5hprmJM6KbcTMPrkq3NdujNu5 Nj2dS/Ra4xwMv+5d+S2rE6uKKzCipDE6roCHhWHMESlQ54/zqkJcJKxYwfGAH1XinWIT fNZrRWkjzKsYNew+pM6LpX4jKXhKn5Fi+iloE7rO+QioOgrzBgjZDFFStLyFX9xe4+JW dMdrXOk6zOm9tZ2xcSTZIoMhz1T9eGWWwn+/XISyJWunq3+Ml6NhbBge8DATI24+rpWu BWWg== 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=qTMxx/LJnmIWvUmH+gdz70kQEF0zmvOjZ2b4ibjV0JA=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=d4Gt/HgXZJdOGKYjQ8c7hzJOYcMh32LmeJwBVMK4p84YHD+3n3fo/0h/iAQQ2bFdx2 3LBUwzWajzRo3wSs7v4HQsf+rigsBd+CfZ3B/tuWlifH1ePfx05cdy0TSNb06YYQJVnr K3MdiyaA5Zgb0IET66YcEJKxhjM+ivGM51rE6AtyS7AToTUpXo5eUAmw7bZOcZSC9MGc /6oTwVetx7AbOvsEiRIyqgkLtVojnqCo8uOJpfW2bH0CepopcBQA6Y0qZyxS+UMyJikP b9uH46surQGGyMDcZTw0FuC1pfq9vmmJEcz0jjeLl2CiONTNBUC77j4rrRXYbM5/+tAQ ZFUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=S4eXFyS5; 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 b19-20020a05640202d300b0051bebe13248si2934186edx.63.2023.06.26.12.19.43; Mon, 26 Jun 2023 12:20:07 -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=S4eXFyS5; 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 S231830AbjFZSU7 (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbjFZSUe (ORCPT ); Mon, 26 Jun 2023 14:20:34 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4CDFE74 for ; Mon, 26 Jun 2023 11:20:24 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1b5465a79edso14555495ad.3 for ; Mon, 26 Jun 2023 11:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803624; x=1690395624; 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=qTMxx/LJnmIWvUmH+gdz70kQEF0zmvOjZ2b4ibjV0JA=; b=S4eXFyS5rCCSmx6iv7PwkGg0BQvm/qIBJWemgkd6QqmzpVRLetRiUZjak1W1mQyzZr mMKoaj7RIcwyjjYeEciNW4ODHuDXAB0C13yWbXWuat885LfNkeAe1aW17ajmWdoYdpXC lk8VuAdGvlhi04z5vwImriXcHwbtXGq5yiwmyAeXX64MSqe0tt/49ZE3I4ee91HgxP3c zZI/w6Nc73N8LQ4zawaNdpS2epI7IexAi7Wb/yi0aenclZFLqPugb8wyTg5JeBEyxrHx Xt5PuAKkhVJcUdmnZRtHtS5GOOJqKuDtYqs0xkgs9jrVWM7sdTirDlmdiNS+WWD/3Ss3 DLzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803624; x=1690395624; 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=qTMxx/LJnmIWvUmH+gdz70kQEF0zmvOjZ2b4ibjV0JA=; b=f7YQiyJAwi1qI0V1MG1CZ1tISz/XsTs+cSN5JvUQoz079tz0sAyWauAJYA/l+PJg4p eP5CyUlR1XWs68qaT0XptDPIr1EXau38sc/LUle19QIzHb400HsZe4zC9fLavXHcv23/ pg8Ma7yi3EkmjCf0WkN3zXWfgaRzpr5AgvTYaP+KcOQVTBXyVthB7ixXQtKlJBWzuIXe B9SGL1Zu5s2+45C1y8rCLnUi2R/WVk3Cjm19S7cq5h4gk06jqVFQGZLqraTzGXuTDBXP ujlRXXSKltcdFG59su/x7hT/1ViF4x+g2eOMcMd510duyfV5PgHLnnVsRr9cTiRynJXd f42w== X-Gm-Message-State: AC+VfDz+AhiM2lvZMVWT4nJc1krppUtrJUQN63cLI5/J7I/7+453AWvz UyF2lJc6U40hKXpZWOxD237xWQOSS347 X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a17:902:b608:b0:1b5:bd8:5aaa with SMTP id b8-20020a170902b60800b001b50bd85aaamr1078296pls.1.1687803624119; Mon, 26 Jun 2023 11:20:24 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:12 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-3-mizhang@google.com> Subject: [PATCH v2 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 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769794131364819339?= X-GMAIL-MSGID: =?utf-8?q?1769794131364819339?= 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 561efa8ec7d7..4c9044b4dc6c 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -221,11 +221,12 @@ 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 + 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. 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. + this case, the array of shadowed_translation is not allocated. 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 From patchwork Mon Jun 26 18:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7708514vqr; Mon, 26 Jun 2023 12:32:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IxM+qtOHVwrnG61KyKuiM5I391pglH+O2rb8eeo8hNIi+m1oYqbyyL+9z9ZpGsm3XnkVT X-Received: by 2002:aa7:d445:0:b0:51b:f739:8f53 with SMTP id q5-20020aa7d445000000b0051bf7398f53mr6531531edr.32.1687807936024; Mon, 26 Jun 2023 12:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687807936; cv=none; d=google.com; s=arc-20160816; b=iXr3iLziDzt8rkwAgLey/iDQUHJq/iJfuE1i4r569BpHcOpkgvlFNcm5VWOM79edlc DkTLOupebZ6bvVfBPlFIDyMBnCYFoNe0+hkDFFw1h4CzGbNJ1faoVOP+AIfeRdhVZSty g1/M2elLEIlzzkr9VtaL3U7mNdTmTODxp4x+EMmwxZCXAg4xXi9SILtxwuc91523Pg9a 0CXaMzVEszJ9KwpVCH/rVWufRsITqenoCkbfMA6UT01YhE1EFlDNMKXxzW58AjzNGrnm mGFGccBh7rlArUsS+cKnFo5uxX3iOkCSwVhvL0pn4Ss9aFMJgkzM3wig/Fcrhp9jWH6p sn0w== 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=0/miHGwTxT7US89Pp4p1SvRY38MOXEBbZOtBg20Cazc=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=rfI0wcGaxA9PsWROltNc4yZxyYSyUs11qLfIaG8JLS4YmbB3k4Bt7DxQC2FYh9wmvM 0Viu189DnhKkl4xnbXzjajTqSEvVtSWc8Db7g84ghg9cX2AC8NiUBsFNQ8q5x0t2kn4N E3Y63Cj2PsO/C5c4aqU9hHQCSjKhpFYwVr88DWN+Gr8+bvhurcnnSfn35+y2Ge7xgFON OaXJiU8SMqHtFFH/GO2oGmcx6s0uYDj9IDLqOiHgKt8LGNkhPE3C4YbfwTIhN6epMzVo s6l00w9RZDS7o8BBve2q17iKwCqsPCQyoAc76PISzy3ZUdnGaeFPc9adpx7S1Lel+gVX Pw7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=EHDAWz7Q; 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 v10-20020aa7d9ca000000b0051bebd721e3si3128724eds.191.2023.06.26.12.31.50; Mon, 26 Jun 2023 12:32:16 -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=EHDAWz7Q; 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 S231709AbjFZSUn (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbjFZSUd (ORCPT ); Mon, 26 Jun 2023 14:20:33 -0400 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8675110CB for ; Mon, 26 Jun 2023 11:20:26 -0700 (PDT) Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-262e619fb5aso810514a91.2 for ; Mon, 26 Jun 2023 11:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803626; x=1690395626; 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=0/miHGwTxT7US89Pp4p1SvRY38MOXEBbZOtBg20Cazc=; b=EHDAWz7QvBILtIie52w2HPumTE/XxMe4cOKd0HoxlAziAbEANSPDGzUZbDDuBQD+Wh Yp1DPuuapOk0eBvd1dE5O1zoBwyM5xvIQTserlY0buVkCErHOi5Qed8HmpRRPFe9ktOy FB7LOJmQ+2BAmiv4C2ktrEZ2eUqteQcG9Ugu8OBZ6IH6bFIdOjXLCoZM8oDaCxKYf0bZ 0hXLMenwq8XpV0Z6lgKtI3wkgj8nKTdD8qgqkg1Gnfwj8HeH5XA3/WvGrAIBXo9Sil0i +Y9WNlnB4SBC9g1OJvgHnc/qT7yufkr8d67BdfJ/o15lCD0IXlkz1aAha4ybBsoY00YC SJ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803626; x=1690395626; 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=0/miHGwTxT7US89Pp4p1SvRY38MOXEBbZOtBg20Cazc=; b=cRJktSQTUVeUrnsQgAWQY+i6WQ0Vw0inKXPJdY3unwrHrospHiXM7Y2udqgAg3CzBJ YLDyNM/JRiaWA4deAdRqsaNYqMatcONYTUvPQn8zVRWaXRMuMN98aKQrMc4Huncfc0LB lQGZKoUKP5enaFVae3EEII+45m61RlqzXIUE54+AjkIukd5GwAW5LclQtOfk6ougG2SU hwy1M3piNb4FHIxK+rVpC78mY+dN/HShQYuGGoomsS3ohYXGZIqAd5sAOl2aiHRS+IZJ t131k9SF/XVr49Kz035+DaaQu7i3he27ojd4+0o9sp8LbC40FyasKCIX2vBEW1AHYA5F EbEA== X-Gm-Message-State: AC+VfDyXLGxIjN6Jxp9cTz+kWhZ2p9cqL02kvkXm/iUDIbGAMjNPAEV9 4LEikSdE8Qhz7XZYEYlxMHd27etp6J77 X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a17:90b:797:b0:262:fb5d:1483 with SMTP id l23-20020a17090b079700b00262fb5d1483mr434837pjz.6.1687803625969; Mon, 26 Jun 2023 11:20:25 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:13 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-4-mizhang@google.com> Subject: [PATCH v2 3/6] KVM: Documentation: Add the missing description for ptep 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 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769794894678889266?= X-GMAIL-MSGID: =?utf-8?q?1769794894678889266?= Add the missing description for ptep in kvm_mmu_page description. ptep is used when TDP MMU is enabled and it shares the storage with parent_ptes. Update the doc to help readers to get up-to-date info. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 4c9044b4dc6c..5cd6cd5e8926 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -237,6 +237,11 @@ Shadow pages contain the following information: parent_ptes points at this single spte, otherwise, there exists multiple sptes pointing at this page and (parent_ptes & ~0x1) points at a data structure with a list of parent sptes. + ptep: + The reverse mapping for the pte pointing at this page's spt. This field is + used in replace of parent_ptes when TDP MMU is used. In TDP MMU, each + non-root shadow page will have one parent, while each root shadow page has + no parent. Note that this field is a union with parent_ptes. unsync: If true, then the translations in this page may not match the guest's translation. This is equivalent to the state of the tlb when a pte is From patchwork Mon Jun 26 18:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7705374vqr; Mon, 26 Jun 2023 12:25:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YexCCGwSf4/qOqML/NiZ4t+nPSjG5S4UX4/vgcj00gpz9tJ070rzm24hJETIi8wFF0yQv X-Received: by 2002:a17:907:7ea1:b0:98e:886:f27f with SMTP id qb33-20020a1709077ea100b0098e0886f27fmr6415947ejc.20.1687807557775; Mon, 26 Jun 2023 12:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687807557; cv=none; d=google.com; s=arc-20160816; b=dedHQRFclMBRtM3l/zRIEWZWm734exl9QsQBkuMYmuJz/ozG9rZmLQOKhQ5qLkGo9T QVjRAxTg8mkFr0xvJcU3jLFF3g6/uStw4AtxvZXL3/SxXH/q5d3I2FmdkQQreEXmTFBL MBzVnX3z80Ckdb/NcYJrkFgyuGcK8IT3JCASOLPRcpORnSMOTSqElAz1F7v0ZQoggkBA ZFaPkLSp4XNnpwxbYgxrDTC64ePA5PBYChdBb7B9fPTtrKW+ySAIkJzrRZ8DpFj9hKfi 6vhdzZ6W9+0a610CUPysxKG9lybnGPX8Cp6n3IP2oOWpnQ745U/KUfqhDsavGfYE4fXI aYlA== 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=DC1JUUoeIHOkdglYQmr1DfzfpGQE2uWlWtSL5MUhKa8=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=XF+98XBJvnIB6ClCPb3VOgQqqqejhs09FzFPRzV3nAvDwVOERYfZU+zsalhoD2b8Cg +ixtWc3K8+N0pzBG0Kkxqt6ZUlRElz48DsAQwLFaDbsMTuP1RhHGsmeu0caZiRQWEX1M NaXqTGPw9636fUr84YiBKBOlmhmK0oZ7zJYQG/NC3cAbsEhmf+Vh0wjDXuTvG3uU2nk4 RUHO89TbivYazruj7RqfvkzhSnm6jqHt1fBIWXq1OjyLw7LOcWk42jSzVC5X6ujwF6Js qIQwzy540JDM1EiMgswWKHBvPROw/D6+h9gSBH9gik9juWvEEzuA/+6y9j7p3LQntr9W qDwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=xYtXcmWx; 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 n17-20020a1709061d1100b00991bd84725asi1454672ejh.227.2023.06.26.12.25.32; Mon, 26 Jun 2023 12:25:57 -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=xYtXcmWx; 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 S231824AbjFZSUy (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231679AbjFZSUe (ORCPT ); Mon, 26 Jun 2023 14:20:34 -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 89BD510D7 for ; Mon, 26 Jun 2023 11:20:28 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-bd6df68105cso5081392276.2 for ; Mon, 26 Jun 2023 11:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803627; x=1690395627; 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=DC1JUUoeIHOkdglYQmr1DfzfpGQE2uWlWtSL5MUhKa8=; b=xYtXcmWxk0P1fCDcWTRmRHQ213fqB4rQuiXjexvxKc69fWrbx+jG1hAwG0llCkpycZ vIxsx2SNm225hbYaBdJVqoTck9XSOJKHlXh8DXvyqKg1GDw5gd8l+hSpY9QBLAiV12RY rv75429GaSsLG1+mV89FXylyGQezn4c2bMvPj3UN87MBkxdRUBLLYdkdL6DAdn3RGg72 VAUFRTosn8/60fdz9qwFv3TJRj28bLsYQui4hfKh76McyD8vBN0+at6FZ+BkOw316Td+ oESmYoDPXCHZZNA1rzDVevcOJ+5+8ZFPleApgNlncNDFxrTYp6OUsyfuI65KKgKe+AdK ayrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803627; x=1690395627; 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=DC1JUUoeIHOkdglYQmr1DfzfpGQE2uWlWtSL5MUhKa8=; b=jRPxCKFmkeKJ9T65hqU8oVDhCDo5RBP2DIdfzK0j+oAUnKYQn2IYw1Rd5fsuO2czeZ iO+lGRilTmHGR9GjOe7gVhnBg+dIM/FDyTrUcnKrMxBhVeyo9KDhbKNNCAfUXL3NU2FY 5luJzfWj7R2sSEzP33WwhzAd7o9/g9eYm6T+sfMqf3A0oxOuOFanC4PkLLRh4uZtlNGg zIQLe2IzCVi4j2h+LLwEVAzSnCHZJ3u4cdYY4YsnXPQNttatlKV2hDgftGmsZL04NDb2 Y5KBcZ2VpmtM4790j7Wrn1eVbBz1Xt8LjsSec1i10EkwJWgyRZX95oldW9Z7AXj9ERK4 Xdag== X-Gm-Message-State: AC+VfDw2Z4coUMeP7K/Iur1lg9M14ThdOcGg66rPEwLo+LYlHrRgBZsD ofNALnBH+FRELaoGc8rpVQ3dtC0ukfPu X-Received: from mizhang-super.c.googlers.com ([35.247.89.60]) (user=mizhang job=sendgmr) by 2002:a05:6902:18c4:b0:c1c:e037:136c with SMTP id ck4-20020a05690218c400b00c1ce037136cmr3172718ybb.0.1687803627815; Mon, 26 Jun 2023 11:20:27 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:14 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-5-mizhang@google.com> Subject: [PATCH v2 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 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769794497895411978?= X-GMAIL-MSGID: =?utf-8?q?1769794497895411978?= Add the description of tdp_mmu_root_count into kvm_mmu_page description. tdp_mmu_root_count is an atomic counter used only in TDP MMU. Its usage and meaning is slightly different with root_counter in shadow MMU. Update the doc. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 5cd6cd5e8926..97d695207e11 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -231,6 +231,11 @@ Shadow pages contain the following information: 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. + tdp_mmu_root_count: + An atomic reference counter in TDP MMU root page that allows for parallel + accesses. Accessing the page requires lifting the counter value. The + initial value is set to 2 indicating one reference from vCPU and one + from TDP MMU itself. Note this field is a union with root_count. 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 From patchwork Mon Jun 26 18:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7702180vqr; Mon, 26 Jun 2023 12:19:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Gl6iqT63misLxXK5prA4DMAVVOF3FzsfwgbyDrhTtL7tJLa9eq4bHBS9famOct1t6kZ6X X-Received: by 2002:a2e:7209:0:b0:2b4:5a0b:9290 with SMTP id n9-20020a2e7209000000b002b45a0b9290mr19346357ljc.21.1687807181380; Mon, 26 Jun 2023 12:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687807181; cv=none; d=google.com; s=arc-20160816; b=067QOGHl/UoMitLchkmCGGyVu/USGSePkglYyJmK8MkkKYqyjsxaY/ZicO868Nv4zL IMRyJuLcmvkEcchcbDPBoJewt2wgkJNqRoMfr9nU5P+1qhbSsDsZ1pzt9nhDv6b44chO Jil7RCEFjo+MSSP1yy6iGo7QkG43iQEMcPsuaF87o8PbWmO11CtPXCEw2sU6ekcMI6pm h/U1MJCzDW2VNwIbXptXivwSmvTzC5vfL2dXjxHmfFcbd254ke76Vy4FgkfbC8MnFqiC GYwEqPDrgifij+B0NlZ8qnAPD0ydz2qEKHH8SR//VA/yWV35RTWV7HzFAkurAnYb54+i Q0QA== 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=fPTPHDUYMvFHPd69LEESu74mldUigTMG6iEPquT4JGU=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=OcciCU/5NUJcgkoxwPdXA3MQFLj+JoqMX7EDrOFHyV2JyiMwC56ngRMwxHZI56JFD4 fxuH2IqJTQYvE1uWHN46+slimFpNKs0+D+5q1TLJtsXI6okiXfoOg8WLaPmo9hsw5+Is QptBh/g1F8okNWIzme8Pen/MZ0mzu5lhHu1ASGKVki5yczUVxMXEPhikMAzIHeCF46rP TRHrxq1KTiTWnZdF84NvXBPVWg1QC0S+AK8owzKv+54o6mm4vzquAbosHEdRWOWs+uGq ZxatDl61dU7ln8w+BQt5Om7yeRS91sDg0O2Ebz4XUB66cpZWYSpkFcycmTfSouyEe0oy tJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="hpVsGk/f"; 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 c19-20020aa7c753000000b0051a598d552bsi3112154eds.630.2023.06.26.12.19.16; Mon, 26 Jun 2023 12:19:41 -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="hpVsGk/f"; 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 S231812AbjFZSUv (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbjFZSUi (ORCPT ); Mon, 26 Jun 2023 14:20:38 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1622A10EA for ; Mon, 26 Jun 2023 11:20:30 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1b815dbcda3so1888485ad.0 for ; Mon, 26 Jun 2023 11:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803629; x=1690395629; 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=fPTPHDUYMvFHPd69LEESu74mldUigTMG6iEPquT4JGU=; b=hpVsGk/fUm1QcLK2YtEYFckHIZf49A1mdzhhlT6g1Lz6cLQjxC+qmUoy7IFKkrxdTa DdRNgOP3WHMEjb/9x9YWNAnaxx26m44CG5C2oiexiZybtYsDWogSxj85PydZ5tc7FW3v +NmOpbnqJCiSPeMVd7pgp+giO/Ty5+TAP/8PbLWOW2Ec1BYSHUC+OcmcCAdZGmOycB25 TxL3HUAGO524gTtd3orZ5coYXLol2k1UotilzoG9GZXIhx9ahPW0lvKpHXOCRiiyeYt/ fDkfwtXNV/lD3DYHcYbAAhYcNpnmqcXsUfzRZ8sQlZpX0eFtjRio+vRcjZCpz8EvRJNG 6MnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803629; x=1690395629; 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=fPTPHDUYMvFHPd69LEESu74mldUigTMG6iEPquT4JGU=; b=dFmMmoj+3yZw0f/UYbMO3R5l4Vr4hXVvkejYhpFZhnPpg28PLi+DGpOuaO9VsLA6wW 7rMKlk6J0YhicKGgYR0gATLo6o+tnqLBlzc7dNmWmHUa6wzchPKvHRoL5JF2/Cru4kVD GHa6cdYVTwvNKpqhdLYMuE5aNnWnY7z5AmNDtuhfRxhKsivDzkCI44gYNgeyJvVfc2vP LbrmjHfZcJM0RfusS6olhhGzy7mIjkhBsNhJi/FvK2U02WwvT2iEIIoBXrpBSblpuNZV iNCoMIbP1ZiUCQnEXCpZJEc5PELCL2/bqDKsYUVjXNReBpooU2lSZ99RbPDmu1xtOFVg gNTA== X-Gm-Message-State: AC+VfDzyI8lrsxY1xQMxrvVUM5zSuUTgN77xeyjJBqbXBcfkNB1i+aRW 83trQZft73rsQLRtQom2Fo7j4OW3H5gr X-Received: from mizhang-super.c.googlers.com ([34.105.13.176]) (user=mizhang job=sendgmr) by 2002:a17:902:d58e:b0:1a6:c110:900a with SMTP id k14-20020a170902d58e00b001a6c110900amr1305666plh.3.1687803629637; Mon, 26 Jun 2023 11:20:29 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:15 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-6-mizhang@google.com> Subject: [PATCH v2 5/6] KVM: Documentation: Add the missing description for mmu_valid_gen 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 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769794103357823490?= X-GMAIL-MSGID: =?utf-8?q?1769794103357823490?= Add the description for mmu_valid_gen into kvm_mmu_page description. mmu_valid_gen is used in shadow MMU for fast zapping. Update the doc to reflect that. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index 97d695207e11..cc4bd190c93d 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -208,6 +208,10 @@ Shadow pages contain the following information: The page is not backed by a guest page table, but its first entry points to one. This is set if NPT uses 5-level page tables (host CR4.LA57=1) and is shadowing L1's 4-level NPT (L1 CR4.LA57=1). + mmu_valid_gen: + Used by comparing against kvm->arch.mmu_valid_gen to check whether the + shadow page is obsolete thus a convenient variable for fast zapping. + Note that TDP MMU does not use mmu_valid_gen. gfn: Either the guest page table containing the translations shadowed by this page, or the base page frame for linear translations. See role.direct. From patchwork Mon Jun 26 18:20:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingwei Zhang X-Patchwork-Id: 113093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7692114vqr; Mon, 26 Jun 2023 12:02:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TvwuItDppAt62My7/53lP6PtpjYVJxtl+b+UGRHo2OTGI46W+ly700ts6q1rh1/4HaU86 X-Received: by 2002:a19:2d19:0:b0:4f8:6dbf:401d with SMTP id k25-20020a192d19000000b004f86dbf401dmr13625442lfj.57.1687806156513; Mon, 26 Jun 2023 12:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687806156; cv=none; d=google.com; s=arc-20160816; b=KcTfcfMiTZNEq6VH94EvzWJju5gq7+uJ1tCouBGu29in3e5QG+5EJhgN1DamjdpUU4 TZzxPgaG8keYHWkScivNYvanBbY/XfR6glihxbAV+9AAULTykIXkvQMSnnBm8hSFSyHw qKXSluMZ7pUtXvRv47Els6OoALgTaPaTd1zTMxdbJSA+QTjFdjRbVM11zm9ET2cQvS7R TALWcfaqfM9Zc5Dgy4RxJOh+i0YJHzR+fkcq/zop01WJTRtGKjas9m4EF1UnwOE/jU7P V3AbgsKf0ozvywlGwsz9fi5Y/W2jxBztXUqIyyuhO3pI5i0/m9cD3u875NxYlduoAXGF gH7A== 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=ImRtxMlYFksXesGcg5ZEwinCVjK+1eznyzb1zuEq5IA=; fh=4e3puReJ7DjwMG6rJqHJp2nX/a/7QqKKhs1FjQcufg4=; b=uEL9hu/MctjHxSPmxUCKX8VtxD0d6PT0BVOQ86X3XbzdyCuv91wNceBid65vRXjtON Bic5QYo261sEbs7/T143Og5ugiG+3s0+f9A5QtTRi8Cx1gnLDLY8HNpA4FJ4i2Da0X6y wy6TaUgH69nmaqB9sAUd8hBSffHhTQseWvZUmdhptYhTVDhH1AT6WnI6aulF933HyPqH MDpiZqdhDe4a7h5tTqXWXAcnQE4o3qGpbJCtLQUPZgamU8DaCV0CeyFRj2YVdqWnwDU2 VbwzsWdP+jwe0m+PsypjXuBAjN7JSg2pV8r6n1w4SeYSZMjfuuOJ0/vHUtlGfA2vC4rE hOKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Tdy68PWD; 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 v21-20020aa7d815000000b0051be20673a0si3156273edq.211.2023.06.26.12.01.47; Mon, 26 Jun 2023 12:02:36 -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=Tdy68PWD; 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 S231799AbjFZSUr (ORCPT + 99 others); Mon, 26 Jun 2023 14:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjFZSUi (ORCPT ); Mon, 26 Jun 2023 14:20:38 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999EC10F5 for ; Mon, 26 Jun 2023 11:20:31 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id d2e1a72fcca58-65026629c1eso1577640b3a.0 for ; Mon, 26 Jun 2023 11:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687803631; x=1690395631; 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=ImRtxMlYFksXesGcg5ZEwinCVjK+1eznyzb1zuEq5IA=; b=Tdy68PWDHkjiU3GFNBhBXBkqsqiqqWAGIXJ/q4OjjptAOSfM5EY42+vLqgA8D8nXAS clXF5BXCK0DJ71Va0Wz2nmU5U75ABUVVNq5Soj0T8VDpURZ3pOkkmiT0d6CAOe1ulwju zjeQJ1DH2VB+yypRy/vE4EAQw+QA0GV5wZ7PWldp9hocIQmtrsxFMYgGiycX6CpHqZ+C 255CmNUW5d30tex1Crn09VGfnKT0f9g0h5xWaV48MbkB4xvLFFnOQMwOlGyQja8q+FmG 9OnaPlIw+hwtf7bPt6nXd4VP1MQrnjlW8kFoiViD+b4ievS/+PZxZqEjIARqxF5GbQdU vW4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687803631; x=1690395631; 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=ImRtxMlYFksXesGcg5ZEwinCVjK+1eznyzb1zuEq5IA=; b=XbP76xRJk+LFdjMwm8bXbK1W8c+J89xlWT8zrhBRz4IomRNTwreb3hHtc33ThZhvnN vSyEkNKUnBPzmivVCEIhuu8rYQfBjz+bPBjTIttdLNeTcNjpKuD/OHCQFGHW+nmTk0pp M3bZ9T4C7t+AnOcYhepUc74lqX0+ag77ZYk8HDZCqr76LSsxXGSdnH4f/Suv2ppw6sAw i+YSKidC/81OIpOGUdNLMeHxJDWmhAGUWscvpXdP4Bqte71KM805BZ0Mx1RU+1k5pzCC Cfph8N/rqJAr1e7GH+ru2mXf7b0o4VatfjHFXJjZzLcJTXlxvgpvpjEI1GLXryFHU9nq WBXA== X-Gm-Message-State: AC+VfDz4DwpA3+8s8IE29fBQbWW0GFeYs4H0frgcOZEx5RORgoZbkyoI 3f+cuhPypZTaYjyH+GfQJlIdOPmN+wSv X-Received: from mizhang-super.c.googlers.com ([34.105.13.176]) (user=mizhang job=sendgmr) by 2002:a05:6a00:2d0f:b0:675:b734:d30f with SMTP id fa15-20020a056a002d0f00b00675b734d30fmr1001451pfb.4.1687803631156; Mon, 26 Jun 2023 11:20:31 -0700 (PDT) Reply-To: Mingwei Zhang Date: Mon, 26 Jun 2023 18:20:16 +0000 In-Reply-To: <20230626182016.4127366-1-mizhang@google.com> Mime-Version: 1.0 References: <20230626182016.4127366-1-mizhang@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230626182016.4127366-7-mizhang@google.com> Subject: [PATCH v2 6/6] KVM: Documentation: Add the missing description for tdp_mmu_page 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 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769793028260530916?= X-GMAIL-MSGID: =?utf-8?q?1769793028260530916?= Add the description for tdp_mmu_page into kvm_mmu_page description. tdp_mmu_page is a field to differentiate shadow pages from TDP MMU and non-TDP MMU. When TDP MMU is enabled, sp->tdp_mmu_page=1 indicates a shadow page for L1, while sp->tdp_mmu_page=0 indicates a shadow page for an L2. When TDP MMU is disabled, sp->tdp_mmu_page is always 0. So update the doc to reflect the information. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang --- Documentation/virt/kvm/x86/mmu.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/virt/kvm/x86/mmu.rst b/Documentation/virt/kvm/x86/mmu.rst index cc4bd190c93d..678dc0260a54 100644 --- a/Documentation/virt/kvm/x86/mmu.rst +++ b/Documentation/virt/kvm/x86/mmu.rst @@ -278,6 +278,8 @@ Shadow pages contain the following information: since the last time the page table was actually used; if emulation is triggered too frequently on this page, KVM will unmap the page to avoid emulation in the future. + tdp_mmu_page: + Is 1 if the shadow page is a TDP MMU page. Reverse map ===========