Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1362451pxb; Thu, 24 Mar 2022 18:47:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxku2OtC6dGRgS7tKN1e+S578tMVpPXV0F0GFtnUfaTe0IkVNoS8aR4r/6iIJ6Ip2y4snEi X-Received: by 2002:a50:9d47:0:b0:40f:9d3d:97b6 with SMTP id j7-20020a509d47000000b0040f9d3d97b6mr10127551edk.392.1648172847333; Thu, 24 Mar 2022 18:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648172847; cv=none; d=google.com; s=arc-20160816; b=vhSzg53F1evm7mhnv7m35VtjKYawALuKZ5B9hHbaXAsvlwyubJFoayCWf7t8FjF3yQ rnA307fJ13Lf8Ea7tblrFQnIEQES2oICKEAQo3T+h05cJZ3AVIQEzLy4/yUVvG1P/ZHa nHJaKqiZ+2L1uiqIRpVgAoLFi2zFJUggHNE8agm3HrlAN1mrXq1RM7ALa3msfaiYD30w IJvzDefdnw45XsyDGWArD0ArmO6y8VrB6i52AbX7dxOY9NomA0L0y79vLs3dThZyEvcM cHDNEeDT8q7DRKoKwp+lMHQ1u4o3MUpEkSdtr6EuVnSpOCD6mclEcd4BvCMeKUsDs1Pa csDw== 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=va6vB0JxaeEC/9iYPBXdEorJ6d/FgW4lIryhnUZxEn8=; b=FKdB/Eyr9oBkOcYkPWEwBZGS2aPASPwD3ksERw9c2zyUyKSFwfV2gjiylxQOV8uD/W BKNIVGzEE6ziLjnaSxzdz+Ya6XfB7sdZvu2lsS2VEoyQVlccdX35heI7e4RCdW5LaiFw Br+9ukzvYV1N+rTW3u3YfC5SC7PoBI1eroA2E5k8D9S2W3R8iVorRzBhlukozFhj66Kz 62jUhe3Y1rYPSgPFjvA0Z6xPchVzs9B3y+gczkJn8TpJYIuxsBXucZzLjcZqmRNGZK+h lA3v9Io/ClVFw7OD5Tv2CzGMwsrYNCdtoqX4f8nN68UMGRS280TW5KHYBzyYDEfv5oZj LwVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HWEQ5au8; 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 fl2-20020a1709072a8200b006dfa6e85cc5si982318ejc.136.2022.03.24.18.47.02; Thu, 24 Mar 2022 18:47:27 -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=HWEQ5au8; 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 S1352485AbiCXSI1 (ORCPT + 99 others); Thu, 24 Mar 2022 14:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236126AbiCXSIZ (ORCPT ); Thu, 24 Mar 2022 14:08:25 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762EEB6E65; Thu, 24 Mar 2022 11:06:52 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id p8so4567761pfh.8; Thu, 24 Mar 2022 11:06:52 -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=va6vB0JxaeEC/9iYPBXdEorJ6d/FgW4lIryhnUZxEn8=; b=HWEQ5au8ofgr8daab02R4CLe5wfB7+XNGyC/qTPF+vbNamIIdvtzVYJH/yeNDPah5H zHCjZUcz0Gm3jgnM9mjyIygMHl2mAX9cafsxTwn2GRkjlAXukGRgMczAvjfTdsj+iIQ5 rRqODA67hnV+atDl7NNH57+moI3ulEG9UM8kiQT94JVPQZfeR+4UdP/f8pi8H5zu57tf AEbz/THuxjNqjIgtqpHh6Slk4EXvdcuUE91S3Qjh9vMZuNy8tL2mzxML5WtYOXTZgCQ5 jy0JPfizWmRtsgySF7RUYctMGGvdA9AGxmD4K4w+p2l5oLY0Wr77A5jUbsBh+bNE3QRy Vh8g== 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=va6vB0JxaeEC/9iYPBXdEorJ6d/FgW4lIryhnUZxEn8=; b=X9Fv4g6srOAFsaKnj6ERazNPMOUXxHBbdFX5moytBHiR7FIA3B5V6p1fLZD3sp9Wi1 5Yf1pyaTfWvqm14flxKX5nblBTvZHb2H2MXmVsL8PIu2FQv4TVNlmpluEGZBb9WSY+E7 vKf0P78aCtn8HdTPs70xOrOnfMtfa1P2ofs8W8WmAOESVt6CzmFmdGHIerIS+johvmrm 0KBYB+bEp9PF82bqJZfifkge90v94FXzQdpAY+SkVZcG+33xXhggywfI2tje+Zw39cpn pT8QEbptiHMplcK5Cq4lrQGu/q9Zn4MAu2iq89c4k5WPQnLvDe7hDh4xevItvw/n6O0X yDRg== X-Gm-Message-State: AOAM531mNrxhVpAkDBk+34Au005Dj+ytZWmeDiYmjKvDiesrLI4pbpeS izQiELtzxNm1qexv2EuY16o= X-Received: by 2002:a05:6a00:228f:b0:4fa:e4c9:7b3b with SMTP id f15-20020a056a00228f00b004fae4c97b3bmr5926163pfe.61.1648145211800; Thu, 24 Mar 2022 11:06:51 -0700 (PDT) Received: from localhost ([192.55.54.52]) by smtp.gmail.com with ESMTPSA id z14-20020aa7888e000000b004f79f59827asm4054292pfe.139.2022.03.24.11.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 11:06:51 -0700 (PDT) Date: Thu, 24 Mar 2022 11:06:48 -0700 From: Isaku Yamahata To: Kai Huang Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, dave.hansen@intel.com, seanjc@google.com, pbonzini@redhat.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, peterz@infradead.org, tony.luck@intel.com, ak@linux.intel.com, dan.j.williams@intel.com, isaku.yamahata@intel.com, isaku.yamahata@gmail.com Subject: Re: [PATCH v2 13/21] x86/virt/tdx: Allocate and set up PAMTs for TDMRs Message-ID: <20220324180648.GB1212881@ls.amr.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sun, Mar 13, 2022 at 11:49:53PM +1300, Kai Huang wrote: > diff --git a/arch/x86/virt/vmx/tdx.c b/arch/x86/virt/vmx/tdx.c > index 1939b64d23e8..c58c99b94c72 100644 > --- a/arch/x86/virt/vmx/tdx.c > +++ b/arch/x86/virt/vmx/tdx.c > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > #include > #include "tdx.h" > > @@ -66,6 +67,16 @@ > #define TDMR_START(_tdmr) ((_tdmr)->base) > #define TDMR_END(_tdmr) ((_tdmr)->base + (_tdmr)->size) > > +/* Page sizes supported by TDX */ > +enum tdx_page_sz { > + TDX_PG_4K = 0, > + TDX_PG_2M, > + TDX_PG_1G, > + TDX_PG_MAX, > +}; > + > +#define TDX_HPAGE_SHIFT 9 > + > /* > * TDX module status during initialization > */ > @@ -893,7 +904,7 @@ static int create_tdmrs(struct tdmr_info **tdmr_array, int *tdmr_num) > * them. To keep it simple, always try to use one TDMR to cover > * one RAM entry. > */ > - e820_for_each_mem(e820_table, i, start, end) { > + e820_for_each_mem(i, start, end) { This patch doesn't change e820_for_each_mem. This hunk should go into the previous patch? thansk, -- Isaku Yamahata