From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5C16CCA47B for ; Mon, 27 Jun 2022 23:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240947AbiF0XFu (ORCPT ); Mon, 27 Jun 2022 19:05:50 -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 Precedence: bulk List-ID: X-Mailing-List: kvm@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