From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.49454.1680249725543829991 for ; Fri, 31 Mar 2023 01:02:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JN8mfKTP; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680249725; x=1711785725; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=/YH4PLq8nkhhDOSX02NU0474kv9rKE49s1hwfCz3RWc=; b=JN8mfKTPOEWVV7hhgAC6G3aQKwg6wdBQtZMF7k5pKCbNyrbNt3mp5Yut C5XQkaxExDr/vrsJWWeWEwG08Oki/yFimieiUvrpnIdFM3eK/yI1xqIrk 9dxgbZO8uFBQomkS1Tan9gRkX80OGL2gE673RtZdLQGqnflEN8SR6iZmC BnIW1FV54DEQQEtpHxgCurALCLv6DFXLksDbgvuJBZq7nnXKk4lScv8PJ mcbYhtrOFTqOyV30CCSqelvt7QjkHdfDV5KwQL5lkFViBzhcjrrQN/MXO eTrCjuKTCRwtzG6CPOPfakIkqHJlY14/ghefWGqfahC2Je/9a9nnF5kEE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="343047055" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="343047055" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2023 01:02:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="662339349" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="662339349" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga006.jf.intel.com with ESMTP; 31 Mar 2023 01:02:03 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 31 Mar 2023 01:02:02 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 31 Mar 2023 01:02:02 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 31 Mar 2023 01:02:02 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.47) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Fri, 31 Mar 2023 01:02:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FeGV9/6f3+G8A9e+PJ5im1cvWKIuxyzcywQn4nvF93vhH3iSSBQH8ooI9dwhOw63LyO49PZqrkpzU5agf9AuPxdOWvBl9R3S/fvbuoKynyNp9LqYBJCg8xja8OQJpINafRL/1SB9Syf+5tKWDmKNwqw8uOo/wNSnqv5bXF2arpLnZl7rgHHZr20POM2+4wfzm+CY5Zt2nNyHSuV7NKuNFKEMii+O2+Og1uUvNFFB6UmxS0eX9/3MvPLbhmQfeAr5YtHg3JRD4tj7TQtU3HDM7j5qAfgLjl+m2zfZLJWVNIZf4sAz5udhbbf5DthowaC917D5yj+62K4wY1BnmTjkaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q0UYCK3A/oj4B8tDXLHnBlV+bPj9M2Q8TKycwGOAApg=; b=HXSCSse0L6BBDAFgtuIMHE22QA2uryZ5a02Dtv63jwsbG5YdUHqh0UD4KqxKew76wzepsdj42c9OfBmT2kK2wTZHQv2IhnttygFsHcRwq7B2PL4u/+H6EGnhju4qOxdE9wenENcRWChwrDR4dgoLU649etFxwbn4CK9DTa9d2ewAepYLbS0ARl9zoGfEOK1hPnQi5xPcGFaiixLWek9QBNwAaWIsTZemi7oycJ+L0a5NElu6G1o3Cv/i132KfarZBEC+1PvdAmGZc5A4Xb8O/gCP3TixorFQTh3qeuvN0Rc/pYjeq5QYUt02njtsLYlmEwsUmP0wKCTnZePnnfjlPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by PH7PR11MB5957.namprd11.prod.outlook.com (2603:10b6:510:1e0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.35; Fri, 31 Mar 2023 08:02:00 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69%8]) with mapi id 15.20.6222.035; Fri, 31 Mar 2023 08:02:00 +0000 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Ni, Ray" , "kraxel@redhat.com" , "Xu, Min M" , "Liu, Zhiguang" CC: Tom Lendacky Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA Thread-Topic: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA Thread-Index: AQHZXFDgJtZZxfQaVEqr06ue07EIf68QRGOOgAJgZlCAAFQXAIAAAS6AgAAaTYCAAXQBwIAADRug Date: Fri, 31 Mar 2023 08:02:00 +0000 Message-ID: References: <174E9488256AAAA5.22739@groups.io> <17509A92F1FF60E5.28404@groups.io> <17517033A2B187E0.12651@groups.io> In-Reply-To: <17517033A2B187E0.12651@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|PH7PR11MB5957:EE_ x-ms-office365-filtering-correlation-id: bc3c3160-17fa-410c-a7d1-08db31be34fc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DGE2g6mwNyqiAtJ6bxm3ZOSorRjbkQ5TYsFN99Io5+9w2vufvDJn/Wf8WJXmDz+rxuDAGzDaguaB9agtwFONJxtiYOHvGddBaPuVwIuCzC0KKDMK9qlNZznWusy+PX7QdUTPyQM/Qm6jbMDB4cq+u2SurWYPzkmi9t/ErjvXldathrn18v8BP9m2kOpNjMqodoN6EBszU9MirRs+yHEU7NwmgZj5yAMrvUjW9ceV2cFIBYe3Y2cMcB9RcQpwaoqFW+9TAS1eJ0uRQmllcgTCgPTekwRmC+LPPpdujUGvKjsA48THyVxlsQLC94Z8GxPen1399h7P7p6VibvWxiQbxewzTMPIRM7HFm0Qf7y/3ouOKG0C6AZpMpRr9bNWrCuclgatieOakgHi80MNCnls9rNx/hJKLGo2/g9xOpD2brh5dvM7xk/q8qlDhKIyd5IUEhwWhgDwXNXemeeNhC52shIXhf6DUTMGRsjoTx00j3uax/ra3TdmUeS4VT2UHDn6LeXsUG4OMFDSowBAdQlX5Ut3JT3FcIXQ+UapAP5MX4sx/XkM8suTe5u9x8PQqFDtik7KsSuGVtKwL9NoT0NAXAEBGAa5rJiCr0m7/e7u6NZBlzXWRLdHmcZaRkxUsbM1+2kZDoMU44BvZk4MWNHsqA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(366004)(346002)(136003)(396003)(39860400002)(451199021)(478600001)(6636002)(86362001)(38070700005)(110136005)(26005)(7696005)(6506007)(316002)(53546011)(9686003)(38100700002)(66899021)(966005)(71200400001)(64756008)(66946007)(76116006)(66556008)(82960400001)(66446008)(186003)(66476007)(4326008)(122000001)(33656002)(83380400001)(41300700001)(8676002)(55016003)(52536014)(5660300002)(8936002)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Rq1ojLnLKa70QhXm1veGT4LOO5D1ywUzltNjtOwxxvTSM96sQLQlVbABVqwj?= =?us-ascii?Q?/NwiJIjQ9voFrj8q3hKo9+/uqfnz3aJmApcpIiPdv9ewgy1cC+a5WFvqO0X4?= =?us-ascii?Q?UVVzcmDYDqLS21VDXzvPXLwdxoapEndHbFAiiE6e73qRpBTDQ+9vkOwR1wbZ?= =?us-ascii?Q?YzGSuXgXu0zgFNx8geT+ala+DxOYjS7OHKnxg0/X24A3fFNMEnRWK1/dH3bI?= =?us-ascii?Q?sd0cjOimVNP3QB6NMghE+rVW/qx0r7oM8u4zT6IzRGqneMqrJSx7Eio7jOze?= =?us-ascii?Q?ymN3Kq4U9Y/RqBchAH0SEitISCr2+GcMBlLQiVB0EEusR4QHXfX063oy40bV?= =?us-ascii?Q?G4oGBBT8bBv3IP3uMR+NBYdjdo3VUSnTm8BSSPkZWJ7KyulfsjMLlr4DJeMD?= =?us-ascii?Q?fFk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d9Xv7OkrZQatItBGc+lvRtucKVhIYZ?= =?us-ascii?Q?LZlkbg2tsbRKKVmlM56ZGjco6t0DFxNdZZPlDq6/dgtmUO8/QuFASRjTqNHA?= =?us-ascii?Q?6EL2K+CwSOUuzGZPELPmEAcqgWnF3c6yEPAyUp5NRWHn+JKjMxmvxQYzyxGM?= =?us-ascii?Q?q2ZqN+mSToGxuiUYuNzSglcB7I/Er1U1FbzJ8sjz6g/p+iUYiPKxX5bbgo+r?= =?us-ascii?Q?04nSBmD4XNxG9aR/iEvDnFcOp4/jD/t9Q2j865bJAZ21Gqx0SrvhMvPbfEmx?= =?us-ascii?Q?iagb9lqXb1jWKVNgw+k=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc3c3160-17fa-410c-a7d1-08db31be34fc X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2023 08:02:00.5191 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WeIDTzNRZS+uD8/HHEfuc8TavGlyoMdx/+NtA++TQ3iRAdgN/3AhsHT7AqABWUD6VBHPy/ke5w0DOwqtUFZppA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5957 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Gerd, Can you give a Reviewed-by/Acked-by for the patch series? > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Friday, March 31, 2023 3:25 PM > To: kraxel@redhat.com; Xu, Min M ; Liu, Zhiguang > > Cc: devel@edk2.groups.io; Tom Lendacky > Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from > CPU max PA >=20 > @Xu, Min M, can you check if Gerd's comment is valid? >=20 > Gerd, > This Bugzilla captures the same idea: > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3394 > Originally from Laszlo. +@Liu, Zhiguang who will work on patch submission > later. >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: kraxel@redhat.com > > Sent: Thursday, March 30, 2023 5:03 PM > > To: Ni, Ray > > Cc: devel@edk2.groups.io; Tom Lendacky > > Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS > from CPU max PA > > > > Hi, > > > > > For tdx, the actual max physical address bits is decreased by the > KEY_ID_BITS bits. > > > But the max physical address bits reported from CPUID instruction don= 't > change. > > > > I guess the physical address bits calculation for tdx needs adjustment > > then. Right now we have: > > > > if (TdIsEnabled ()) { > > if (TdSharedPageMask () =3D=3D (1ULL << 47)) { > > PhysMemAddressWidth =3D 48; > > } else { > > PhysMemAddressWidth =3D 52; > > } > > } > > > > > > See PlatformAddressWidthInitialization() in PlatformInitLib/MemDetect.c > > > > Which would be the third place needing the same logic. Maybe worth > > thinking about a helper function in a library somewhere, so we don't > > cut&paste the same code snippet again and again ... > > > > take care, > > Gerd >=20 >=20 >=20 >=20 >=20