Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3444972iog; Mon, 27 Jun 2022 16:35:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sc91zpfHH9UIt7IoN83jWdgg4VYMW6si3VH+qcmJHP7xMVFsPi1omqpOE8DO8n6ZZgpvGK X-Received: by 2002:a17:902:ea95:b0:16a:3084:2925 with SMTP id x21-20020a170902ea9500b0016a30842925mr650091plb.166.1656372934947; Mon, 27 Jun 2022 16:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656372934; cv=none; d=google.com; s=arc-20160816; b=ts3B8J6SX7Wzsed34EjzzeeRwbdNER9rpGvCxXWg1Qyu5UXKTIUB9itSINpkVfFZSR MQDu5wm6cpjoMk9EWgp6yg9MhVMQD9ICN55Zbwcss2xDgQtbmRJZM9lx5+E+dlAZzq+j Rcy7nnAhqaPipzK88yHWi4W7GiX8WPwoXS4yAkyPAcbTRygybcqHlmE0ex8lzN6Mh92I 399mlsQ0jycXcOMy4lzLa6kVlpxxuj+Te+EqlvHlraK+ePKBSAcW+x1IOvVJr/X6IXoT w9dPEvJLxdtDa5WM58rzgt59s7GKwYSFayHJfvptRLOqN2zxpuuJxXyswcGylDCnhAQH EZ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=ju9Erhqz2TR8bfY6TXXrDX/2VA+J3EXT3zkqg0yd2fc=; b=Hha+HY+MehdMMvNVJQlpdygfWrmpekU1IRTnW9T1Wr73o2jTz2jyyNS3f89EsIbFaI yPxwk+9NYQRILYktz3fYcy3WNdwmjbFNd5V9icUkR+UZN2SJmaUWafTQoyZmrwsx2Qk6 B0kTTEFRftM++4YCpgnqU+pAaPYuoanCdKNSbA4s5lfn604A68i5Ycl5cTCxtqh6g8RR mE+CpA24xVjL8kWTgR+2aDSxn9h6Zfe4Bf3XyRdbEEf+g5tXwm99CaHfAk33VErkrKKZ I3OQbem/3tp7HL7z+BStccOcDGJZ/gpW3i3Bb4cj53LFDBXNN+ThzfZgkg7Pib3ibNWn ZY2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d8aq18CY; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020a170902f09100b0016aacf4e97fsi6162375pla.328.2022.06.27.16.35.23; Mon, 27 Jun 2022 16:35:34 -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=@intel.com header.s=Intel header.b=d8aq18CY; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241210AbiF0XFw (ORCPT + 99 others); Mon, 27 Jun 2022 19:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241325AbiF0XFq (ORCPT ); Mon, 27 Jun 2022 19:05:46 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0452822505; Mon, 27 Jun 2022 16:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656371145; x=1687907145; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=uLaA/4ndZpFufF/4En6ObZrDG4ixWE8Z0A/2SpuaNbw=; b=d8aq18CYMTKcyQS9sq6WJjQiQIllJ5rEeuk7cHA7utkEFgtbnUoGvix4 Ag+rqDJ5ymib+wXS5nLedQ10qULLG5ywP5XwdiklSYaVmNtRC++QNS/LP /s9Z34Y15yXIAiqs/jbKYGb+mNPppPndN9vmfjd3xDTvwl95kOF8o09SH XXdpLfJf4MBXCn/y0sFJ7YHFi7R8knj+qHGoCVR/RNwH11E1Foyw0Ggil 0f9F5NFiUzs/cUb+gTnsRRA5Ou8fCppCXZ8XgyDxdG48vEUKcAUh39z8c UbnMLSedTR41N/qN/Db/Ni5fWo7nDsuJZikDICgOG5/tD4PA3Bxk++aHl Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="367895815" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="367895815" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 16:05:45 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="622723951" Received: from iiturbeo-mobl.amr.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.212.89.183]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 16:05:42 -0700 Message-ID: Subject: Re: [PATCH v5 15/22] x86/virt/tdx: Allocate and set up PAMTs for TDMRs From: Kai Huang To: Dave Hansen , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, pbonzini@redhat.com, len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, isaku.yamahata@intel.com Date: Tue, 28 Jun 2022 11:05:40 +1200 In-Reply-To: <3253e9fa-14f8-085e-5f13-bb70fea89abf@intel.com> References: <3253e9fa-14f8-085e-5f13-bb70fea89abf@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 Mon, 2022-06-27 at 15:57 -0700, Dave Hansen wrote: > On 6/27/22 15:50, Kai Huang wrote: > > > Are Kirill's magic 0/1/2 numbers the same as > > >=20 > > > TDX_PG_4K, > > > TDX_PG_2M, > > > TDX_PG_1G, > > >=20 > > > ? > > Yes they are the same. Kirill uses 0/1/2 as input of TDX_ACCEPT_PAGE T= DCALL.=20 > > Here I only need them to distinguish different page sizes. > >=20 > > Do you mean we should put TDX_PG_4K/2M/1G definition to asm/tdx.h, and > > try_accept_one() should use them instead of magic 0/1/2? >=20 > I honestly don't care how you do it as long as the magic numbers go away > (within reason). OK. I'll write a patch to replace 0/1/2 magic numbers in try_accept_one(). --=20 Thanks, -Kai