Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1176139imw; Fri, 8 Jul 2022 21:27:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vO1HZj8hFgYLy09tQPwVmPghCrl4/Wz9nbfs6qpTIZTFBV+o60LaxvDKl3xXAdVuf5WnMj X-Received: by 2002:a17:903:2447:b0:16a:3b58:48dd with SMTP id l7-20020a170903244700b0016a3b5848ddmr7128126pls.120.1657340851737; Fri, 08 Jul 2022 21:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657340851; cv=none; d=google.com; s=arc-20160816; b=ntSI57DNpq/u28WBiJgFyLvSXMH8bsysq/ONxOwsR/d2LbH8yiVSGF5SWWtP3JjGW3 FGqAlfTbNc6gzQfZRX11p0RTGZqLamgHyhjdc6x1C9ocTIWFpW5KFHI87O+iMHqSx2Z5 yQ8l1g4dJ7DZHcn+eF8TgSbYNiv3ecQHdDT1Dv3v1BqnkYpkpNYqYCJaVKDmXEiWoqoA QBM4kEcsVUklVYVJSu4CakLlEpIIWCdM3h/70MxJYZHdpGrOurpwS8YNpESh0SHDVx7L na/sDQtKB8oxtd2TvuLRCSMebD3h53Z/YizS4e+0k14oTsIv+HkSKgZGhXO1Iw2MnjXi uwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zWrpjAec6xqPgolIekjuMJs7WhTq4gJR+BYNxVJxFmQ=; b=qeQJk/oGVePEJ/TjxTdooQekw2SISToCx8LsKrcSRnBInrPiu10EXzKxpgJMxZQmQ1 LT/MRtmlhl3s2YCga/Fc9XXYdBlEKwtnT1NlsOqRWc/Mryg129BkQXdK27Pa6mXdK7IK y3D4tTYCi66Uc7rrx7AB4+YwSI1B7ufSUYfdfaDRHIlYpN2nJtAaLN6LtIe7ClzuoM2e YN8Gr43RpDzljpQvqT3Q7WzFhk+daUTxeodNQ9wtJgaAJ0D0HIY/pkiG80T8ifTMFuJR uxI7wgB6UwSqUWmKFKFuDPsRawSZnGQeCg1dtMysxgD4PAgsmwjTv51YQ03KbzITHGZZ m4dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wnp2xdnG; 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 u27-20020a63455b000000b0040d0e25bab3si786822pgk.244.2022.07.08.21.27.20; Fri, 08 Jul 2022 21:27:31 -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=Wnp2xdnG; 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 S229714AbiGIEV6 (ORCPT + 99 others); Sat, 9 Jul 2022 00:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbiGIEVW (ORCPT ); Sat, 9 Jul 2022 00:21:22 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334074B0E2; Fri, 8 Jul 2022 21:21:21 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id p16so397751plo.0; Fri, 08 Jul 2022 21:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zWrpjAec6xqPgolIekjuMJs7WhTq4gJR+BYNxVJxFmQ=; b=Wnp2xdnGn5KBGRzZleKNjfV9hrAVQhe8/tnLookizUDENK3CVs8jj6Hw6RlbC7VKP+ ZmgLZLucVtidp0cjAxivvCWvxIJc1CBifHam7baktIKnX1qNXmEXd4FdxePVpiBNYyhc FXreZaRgR/0dUHkATci5Q2VL5Ku3jB5eMheI2ybKWJkfZarX0+wtWBQW0/g874MA1thQ OOFmIcUiXzFLp79vG1eHBr1eubhDk/ElfwufGLFq9Wa7QtP6KDZF6gFKCmE4xiJUszxM upUUwWfzQP/2+bi7yrjLczN0rmXIbIX2+bXeCwSQYQa/f18SJUbdUUNhvy0H6Uo8n3IE 4xIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zWrpjAec6xqPgolIekjuMJs7WhTq4gJR+BYNxVJxFmQ=; b=lyNd8taCEoOYp3RfHGy2K8PcG9ZI9tmBS54KEWlxao8fqqvPfLejwkrGjA5+ken8cd piYrOLQfzvnNNBK6GK6mucgsdkiavDiBhg5wRE3W2ngsq8nQIgZQMnGL/7cI0AnRkQ5C YYQhOLx0GsKwawlWBA7oYoKR1ilWWAYu9HjsTZBSuaO877Fc7xpidYXWLE0frQ4FpEJE gaGl6LEa1MVwTm9+yonuvFAbqXdBrbiiDre8BOnPmxtKH3ZDawOY6nRmLsq2wAnUntoS Yw2YA5g0FeSLkYdwdb/fV2T+fonsz/63LbRmcMAqKXrkqRlcgELZGIcX+Bv6NF9HQq+Q L9ug== X-Gm-Message-State: AJIora/ElbLjkhAFc2NGO1qKFA+F+kjiF/meA+7xwd/K6BulEFEZLclC ljW8tZZDsW1Y/ZXtPAWvO3o= X-Received: by 2002:a17:902:8b8a:b0:16b:b560:da62 with SMTP id ay10-20020a1709028b8a00b0016bb560da62mr7193984plb.20.1657340480918; Fri, 08 Jul 2022 21:21:20 -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 p64-20020a62d043000000b0052a297324cbsm418687pfg.41.2022.07.08.21.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 21:21:19 -0700 (PDT) Received: by debian.me (Postfix, from userid 1000) id C23851039D5; Sat, 9 Jul 2022 11:21:11 +0700 (WIB) 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, Bagas Sanjaya Subject: [PATCH 08/12] Documentation: kvm: tdx-tdp-mmu: Properly format nested list for EPT state machine Date: Sat, 9 Jul 2022 11:20:34 +0700 Message-Id: <20220709042037.21903-9-bagasdotme@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220709042037.21903-1-bagasdotme@gmail.com> References: <20220709042037.21903-1-bagasdotme@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The state machine list for EPT entry state machine basically use nested bullet lists to describe all possible results. However, the list is badly formatted, hence triggers many indentation warnings. Fix the nested list formatting. Fixes: 7af4efe3263854 ("KVM: x86: design documentation on TDX support of x86 KVM TDP MMU") Signed-off-by: Bagas Sanjaya --- Documentation/virt/kvm/tdx-tdp-mmu.rst | 134 ++++++++++++++----------- 1 file changed, 76 insertions(+), 58 deletions(-) diff --git a/Documentation/virt/kvm/tdx-tdp-mmu.rst b/Documentation/virt/kvm/tdx-tdp-mmu.rst index f43ebb08f5cdad..c403e14fb223aa 100644 --- a/Documentation/virt/kvm/tdx-tdp-mmu.rst +++ b/Documentation/virt/kvm/tdx-tdp-mmu.rst @@ -306,76 +306,94 @@ for EPT violation path by penalizing MapGPA hypercall. 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 The original TDP MMU and race condition -- An old man doll... just what I always wanted! - Clara