Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1188307imw; Fri, 8 Jul 2022 21:50:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdQn1+a3nMBq57ZVYQY58A8GxduVqTRr2UFS+RPEEaj54DJTDM08TrcawPbw6HqDGJtk/Y X-Received: by 2002:a63:de04:0:b0:412:b0b0:88a2 with SMTP id f4-20020a63de04000000b00412b0b088a2mr6011254pgg.585.1657342223505; Fri, 08 Jul 2022 21:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657342223; cv=none; d=google.com; s=arc-20160816; b=F7anSStA+vZcLwTLh0Yu9nK78OfpB/872LgRfVBDC8+NLo/oPPO1i7k53TJDdFFfga G70UpN4PAuBBMpP1jx87f8tZvp9FHL9OybprdQoj6sxw76aHcP2bvSJJHzB2dG2U7tws zY9SPCUxKBGA5xH6Md1AJ32ZT70YgdxdO8lQz7Ml4s0eWBGTF6XKlrL531vM4IeVVsqT YocYkbuZU5GT4Zb+mnOlR/zI8DUuKCVSppLEwTHUwYgpb0GBqCoKCxNwur49O2Zoy5qe x52h7trO0UElIVw0dh06OTcuZPk9UKylRpNQQf9KSOi8NLff8CGC67wRP5Zrme1PMqdI o3Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wblxU4ocX/6b7hDTeD8JaMDf+To2t7CvwCLO5H9GvsE=; b=sDmXfhqEqQ+GnLljlIVzeJDHGrSBG11eEP/iDTtBl5WoR5Vfkluhx9p/DezDfFmvJl wR0pn8tS9D31bHdGLtektoH4TPe80pGgtxJG5nCZAuTt7GqHgpcxgUfq2gVelHCO8HoH sZV+yXUuTATHVFkI+mdg+sVV9CL2XL2z8gthBS1AiowM0085BmegYQf/CbRJKhSxSHCJ S8x9Pmpbk8488HjOAuSC0lq7NrQFbxkrBfl/nfyrphouTpAlXQmCo0aNhb0hUlixk3t5 tB9bKkPPFiAVVwCOFQgU+UfJEroZbsqan8ILmVFm8/6DpN+B/CaX80RJic8WzQ4L2BDD JUsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EeqPE2Cr; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a63b10c000000b00415cb3d4bbcsi1004319pgf.727.2022.07.08.21.50.10; Fri, 08 Jul 2022 21:50:23 -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=@gmail.com header.s=20210112 header.b=EeqPE2Cr; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiGIE0j (ORCPT + 99 others); Sat, 9 Jul 2022 00:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiGIE0b (ORCPT ); Sat, 9 Jul 2022 00:26:31 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A60EDFB8; Fri, 8 Jul 2022 21:26:30 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id f11so380493plr.4; Fri, 08 Jul 2022 21:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wblxU4ocX/6b7hDTeD8JaMDf+To2t7CvwCLO5H9GvsE=; b=EeqPE2CrKN+kONWxDFSM7+E3+N5RHT+v5JkHhvJIPY8wOjsSUwXCrWaGuzRtlk05zm GGin0I+CEMC18DH9ZDL/k+cuGRbO6TF5Bg5P6RHBmh5xI8oglkgQLbbUdveOCcfHd6Cc HUIr3SrOPsaPHx/5evo00JtyP3HjCRRKK2Ech5WDoMYfECR67CBOcFLI+NHyIR9dY3Zy qYxezJCG6MeuIIwvLtdscAO9K+uB0qAAzcPhs4/MFQNw0E8ZkvK/AuSm7/OFACXXgrdf CXSbPtjTp9f53F35kRSInDk6XyH8USHI2zDGIMdhoMtw4zj8dmz8m1zlboC9giV4PFdr VW1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wblxU4ocX/6b7hDTeD8JaMDf+To2t7CvwCLO5H9GvsE=; b=Q38YGyTNAAP2GDKASITtaw4zlQhBKaORKYqmxNenvTpsUt8ZAEvYYOd4ClF41EDuLn Cr5vU8OD6QRfGrAJBSgTik3857XAtiIXSKB/yB3fWBt9hMeIgyhnG/HPDuYRbkE54hZ8 yghXzcZ+rnhAWkCmBveYd6EL+drCUztEzmzJ28L2WAHlVKNlYompP0be9s75FzPw5pOC NVTkRqVMKN2MxdOOLwsfEWGIPcETurp9NiMpOqpORQDnY2/0eh0HaEbd0WxLVT7L1DRY /Km9Oj9yzhEeuN7RytsnD8FmtVgAmOqnv2tZ2+4wGGLBM0clttr3/K/O++EXGcKBFi/4 w4TQ== X-Gm-Message-State: AJIora+Snn+yQpVa1Gi135Quq4nUAOq/JFegcJSLHQXcS7ugBmBcIrWe 2WRThDBW4ODyLUusHu0dO+ZXUZqjo5U= X-Received: by 2002:a17:902:9301:b0:16a:1c68:f8d6 with SMTP id bc1-20020a170902930100b0016a1c68f8d6mr7105053plb.72.1657340789768; Fri, 08 Jul 2022 21:26:29 -0700 (PDT) Received: from debian.me (subs02-180-214-232-88.three.co.id. [180.214.232.88]) by smtp.gmail.com with ESMTPSA id f8-20020a17090ab94800b001ef42b3c5besm254697pjw.23.2022.07.08.21.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 21:26:29 -0700 (PDT) Received: by debian.me (Postfix, from userid 1000) id 4CC9C100151; Sat, 9 Jul 2022 11:26:26 +0700 (WIB) Date: Sat, 9 Jul 2022 11:26:26 +0700 From: Bagas Sanjaya To: linux-doc@vger.kernel.org Cc: Paolo Bonzini , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Isaku Yamahata , Kai Huang , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/12] Documentation: kvm: tdx-tdp-mmu: Properly format nested list for EPT state machine Message-ID: References: <20220709042037.21903-1-bagasdotme@gmail.com> <20220709042037.21903-9-bagasdotme@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220709042037.21903-9-bagasdotme@gmail.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Sat, Jul 09, 2022 at 11:20:34AM +0700, Bagas Sanjaya wrote: > The state machine of EPT entry > ------------------------------ > -(private EPT entry, shared EPT entry) = > - (non-present, non-present): private mapping is allowed > - (present, non-present): private mapping is mapped > - (non-present | SPTE_SHARED_MASK, non-present | SPTE_SHARED_MASK): > - shared mapping is allowed > - (non-present | SPTE_SHARED_MASK, present | SPTE_SHARED_MASK): > - shared mapping is mapped > - (present | SPTE_SHARED_MASK, any) invalid combination > +* (private EPT entry, shared EPT entry) > > -* map_gpa(private GPA): Mark the region that private GPA is allowed(NEW) > - private EPT entry: clear SPTE_SHARED_MASK > - present: nop > - non-present: nop > - non-present | SPTE_SHARED_MASK -> non-present (clear SPTE_SHARED_MASK) > + * (non-present, non-present): > + private mapping is allowed > + * (present, non-present): > + private mapping is mapped > + * (non-present | SPTE_SHARED_MASK, non-present | SPTE_SHARED_MASK): > + shared mapping is allowed > + * (non-present | SPTE_SHARED_MASK, present | SPTE_SHARED_MASK): > + shared mapping is mapped > + * (present | SPTE_SHARED_MASK, any): > + invalid combination > > - shared EPT entry: zap the entry, clear SPTE_SHARED_MASK > - present: invalid > - non-present -> non-present: nop > - present | SPTE_SHARED_MASK -> non-present > - non-present | SPTE_SHARED_MASK -> non-present > +* map_gpa (private GPA): Mark the region that private GPA is allowed(NEW) > > -* map_gpa(shared GPA): Mark the region that shared GPA is allowed(NEW) > - private EPT entry: zap and set SPTE_SHARED_MASK > - present -> non-present | SPTE_SHARED_MASK > - non-present -> non-present | SPTE_SHARED_MASK > - non-present | SPTE_SHARED_MASK: nop > + * private EPT entry: clear SPTE_SHARED_MASK > > - shared EPT entry: set SPTE_SHARED_MASK > - present: invalid > - non-present -> non-present | SPTE_SHARED_MASK > - present | SPTE_SHARED_MASK -> present | SPTE_SHARED_MASK: nop > - non-present | SPTE_SHARED_MASK -> non-present | SPTE_SHARED_MASK: nop > + * present: nop > + * non-present: nop > + * non-present | SPTE_SHARED_MASK -> non-present (clear SPTE_SHARED_MASK) > > -* map(private GPA) > - private EPT entry > - present: nop > - non-present -> present > - non-present | SPTE_SHARED_MASK: nop. looping on EPT violation(NEW) > + * shared EPT entry: zap the entry, clear SPTE_SHARED_MASK > > - shared EPT entry: nop > + * present: invalid > + * non-present -> non-present: nop > + * present | SPTE_SHARED_MASK -> non-present > + * non-present | SPTE_SHARED_MASK -> non-present > > -* map(shared GPA) > - private EPT entry: nop > +* map_gpa (shared GPA): Mark the region that shared GPA is allowed(NEW) > > - shared EPT entry > - present: invalid > - present | SPTE_SHARED_MASK: nop > - non-present | SPTE_SHARED_MASK -> present | SPTE_SHARED_MASK > - non-present: nop. looping on EPT violation(NEW) > + * private EPT entry: zap and set SPTE_SHARED_MASK > > -* zap(private GPA) > - private EPT entry: zap the entry with keeping SPTE_SHARED_MASK > - present -> non-present > - present | SPTE_SHARED_MASK: invalid > - non-present: nop as is_shadow_present_pte() is checked > - non-present | SPTE_SHARED_MASK: nop as is_shadow_present_pte() is > - checked > + * present -> non-present | SPTE_SHARED_MASK > + * non-present -> non-present | SPTE_SHARED_MASK > + * non-present | SPTE_SHARED_MASK: nop > > - shared EPT entry: nop > + * shared EPT entry: set SPTE_SHARED_MASK > > -* zap(shared GPA) > - private EPT entry: nop > + * present: invalid > + * non-present -> non-present | SPTE_SHARED_MASK > + * present | SPTE_SHARED_MASK -> present | SPTE_SHARED_MASK: nop > + * non-present | SPTE_SHARED_MASK -> non-present | SPTE_SHARED_MASK: nop > > - shared EPT entry: zap > - any -> non-present > - present: invalid > - present | SPTE_SHARED_MASK -> non-present | SPTE_SHARED_MASK > - non-present: nop as is_shadow_present_pte() is checked > - non-present | SPTE_SHARED_MASK: nop as is_shadow_present_pte() is > - checked > +* map (private GPA) > + > + * private EPT entry > + > + * present: nop > + * non-present -> present > + * non-present | SPTE_SHARED_MASK: nop. looping on EPT violation(NEW) > + > + * shared EPT entry: nop > + > +* map (shared GPA) > + > + * private EPT entry: nop > + > + * shared EPT entry: > + > + * present: invalid > + * present | SPTE_SHARED_MASK: nop > + * non-present | SPTE_SHARED_MASK -> present | SPTE_SHARED_MASK > + * non-present: nop. looping on EPT violation(NEW) > + > +* zap (private GPA) > + > + * private EPT entry: zap the entry with keeping SPTE_SHARED_MASK > + > + * present -> non-present > + * present | SPTE_SHARED_MASK: invalid > + * non-present: nop as is_shadow_present_pte() is checked > + * non-present | SPTE_SHARED_MASK: nop as is_shadow_present_pte() is > + checked > + > + * shared EPT entry: nop > + > +* zap (shared GPA) > + > + * private EPT entry: nop > + > + * shared EPT entry: zap > + > + * any -> non-present > + * present: invalid > + * present | SPTE_SHARED_MASK -> non-present | SPTE_SHARED_MASK > + * non-present: nop as is_shadow_present_pte() is checked > + * non-present | SPTE_SHARED_MASK: nop as is_shadow_present_pte() is > + checked IMO, the state machine lists above should have used tables instead. -- An old man doll... just what I always wanted! - Clara