From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.9583.1636682039624416155 for ; Thu, 11 Nov 2021 17:53:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=YiIglZbX; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10165"; a="230518661" X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="230518661" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 17:53:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="504687900" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga008.jf.intel.com with ESMTP; 11 Nov 2021 17:53:58 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 11 Nov 2021 17:53:57 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 11 Nov 2021 17:53:57 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 11 Nov 2021 17:53:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdP3DUF+0/b4bdEbt/QU6uQeFwNjBWIu3dpplb7ZrwFwkpn9zQcQlvYVRXiI/BHIe+wcKpeUCB42B01DXn2rTQNTFE706JmpX6we8GqIlH6JxyiY0lQEsNIMXmbUUN34YvCihZzDmTceGSopOjb9EEKj2FHtieNIxqjU9zgcxkeRDLxqNS09+lXDi+1Z0PQCbZ1ccLQ3KV48sOY63zEFxzG0Ghr9PI4OEUl2W53YvG2OLJZ4F5IUXJNboWc8qsgf75/6VHvY/AbyBW7B/hi9b2vqEOBue4xKN6dQsrBORP4eYgMtoArwwfgiAjGLQwSuogYuxryHH7+VqmEcQFRMyQ== 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=xOZht9NrlzwcpHtB0IljbQMvFvL7omz623lWNt4wbL8=; b=U6m4BsiGHymvvE2FVECUlVVE7XT07dxaDP6xJLmcAzCOi9nEHCgCp05PansGWEZwvHhVA8CxF7I5SwCfs694dEFbuIG4pdZo5XgOuEy501j7Iv9+ApEOuocB8DJLdAz4sPrOn66kCLLc5x3HuJUXlG9eZ7xKvQCz9AQSgIUGPWvmr6wjzpdIuj7GRr52e8SbGI1b22F2IjyvKZ/kM3pGNfoGAodcPftACiil8jqQppjTjvM/bS70FPY3nqrlxMUHYP2yLdNsOo4ax4Gws1XIx9SMx6RSJFA/L87/AxkaIjsVmtHDWJoSguutnTW2CDAPnXndaEQvsoIMbw+D6i3RbQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xOZht9NrlzwcpHtB0IljbQMvFvL7omz623lWNt4wbL8=; b=YiIglZbXMnfwKlWORQnvzwGYs1n9FnwxET+yedoQtlWSQ4xZwioIOJTdja0/moXe7iky83x+aAOqAVv3BIC2aEX52eAxu+YswOLL5W6w0eMEHLA/XF+Lo1/8lbEQbjmklJkjQeJn0uDw4TK64FGqM7ZAs+8SiaENHrYvJ/nGDs0= Received: from BN0PR11MB5696.namprd11.prod.outlook.com (2603:10b6:408:14b::11) by BN6PR11MB1524.namprd11.prod.outlook.com (2603:10b6:405:d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.20; Fri, 12 Nov 2021 01:53:56 +0000 Received: from BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778]) by BN0PR11MB5696.namprd11.prod.outlook.com ([fe80::317e:de35:e920:7778%3]) with mapi id 15.20.4669.013; Fri, 12 Nov 2021 01:53:56 +0000 From: "Ni, Ray" To: Brijesh Singh , "devel@edk2.groups.io" CC: James Bottomley , "Xu, Min M" , "Yao, Jiewen" , Tom Lendacky , "Justen, Jordan L" , Ard Biesheuvel , Erdem Aktas , "Michael Roth" , Gerd Hoffmann , "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , "Kumar, Rahul1" , "Dong, Eric" , Michael Roth Subject: Re: [PATCH v12 27/32] UefiCpuPkg/MpInitLib: use BSP to do extended topology check Thread-Topic: [PATCH v12 27/32] UefiCpuPkg/MpInitLib: use BSP to do extended topology check Thread-Index: AQHX1oCVBahUbd5ajUWKEf11K36796v/ImDQ Date: Fri, 12 Nov 2021 01:53:56 +0000 Message-ID: References: <20211110221457.2397234-1-brijesh.singh@amd.com> <20211110221457.2397234-28-brijesh.singh@amd.com> In-Reply-To: <20211110221457.2397234-28-brijesh.singh@amd.com> 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-office365-filtering-correlation-id: cac80813-4736-40d0-e902-08d9a57f4989 x-ms-traffictypediagnostic: BN6PR11MB1524: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wXdLrU6HIoGEXB1RIcbZCD2OIKLU8QcKgtrjRjr0UtCzRrceFFceoVjSaQR1E7dAt4dG3qRzxpwIFryJpxlnnU42djsmA7pFfxe7dxfAL2xuhHev/BVdBUng+oOcvy1rXVurg0gPikmT/pN+rRi9XPyhU+naJ70EvuK/+4FqmyyO/IACxPjrzOUrx2xtXM4BdnPV+84ieb20RlBhDvlzj4hINpjhJxjzImnJwVETEBNoGeLsRCmxQucBBdr23AY2i1O0P8pdsLbjxgt+NY2EFhXJfFh6gmWQ61wQPGhKE0teNlyp0na3cXGTa85gyW3SQDw2Mc9m6MKCVok4s0JL7xu3R7yM0/gE0JVwAZ1BYuyODM9wwHOuqezcyjPwE8LrNHMGrawz8e7iRQeWtH9e59gepfvZSNYul28zDy3VH4GCMi05L48K5GLBsyP6MPrvNwhdZwhbd+lj0XklbcCVst8giITXJR1O486o6w26ekD8vwHMQT1FNwkd1/TfiR3J9xTPLcYuLCh9OKOd5F/kkN5IZe2RVUyF/RV7+YJMesaLjK+KPSvCABmozXWpVWCVM6ACUtwGKTzsJm+dwWkJnzlGv1zusNDlW/vAXXKzo5ur2q5HM+wQylDAAf5NuXhkzgqX0z5zPFB7w/r4VUq3BOExk6K3+8RwSrpEUJWdqRex3VQgkKOhlBFBLVvP58dUn1lNu1tkZgVrS9qs40TOw9i2cQD4D01oMdUlG7gjPlk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR11MB5696.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(366004)(122000001)(76116006)(66556008)(64756008)(5660300002)(66446008)(66476007)(33656002)(4326008)(52536014)(9686003)(71200400001)(66946007)(186003)(38100700002)(508600001)(38070700005)(86362001)(8936002)(7696005)(55016002)(6506007)(26005)(82960400001)(2906002)(110136005)(54906003)(8676002)(316002)(309714004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ShMQUeOZO3Q3cY55Fig+6br5EzAn4JMDUkwim7RedjKOTNBVEm8gHv68k8gn?= =?us-ascii?Q?hWL1+pcVXHIK81YI0aZ6uqsweCp5WLXQLkuTBF4N2e/2xrct4MSql3m4mXX2?= =?us-ascii?Q?VKODELP4A+2AxecPaCCkVeWqR79GGYUjqwHnjvc4ypMcMjMROCZk1jhcKu5V?= =?us-ascii?Q?tpKi8o8m1697gd516g/H95dJJnTZIOQRn+3Xkye6tiPdHJhBOtUoqSz8Xqer?= =?us-ascii?Q?39XdgxjXHg6mzevRWV15KILPtlUsTbHvEtazDElqjIBd0QTcadiBmxaOkC2V?= =?us-ascii?Q?X0coho0Mpf3dlCPFJe6XZGDO+r4YST2durQu7bRXRQLmzFurVPZUHYpfYKlj?= =?us-ascii?Q?CKo6h5i2uQw8rA2rQD9nGwHuFxLkIy4qgZANliT52xNmKKJ8S67mW0J/wvTh?= =?us-ascii?Q?eMUz6CQoA+Be0Qs7kaWSHF1DLJn1VwqWiSWf/Qqe/lDEfXTQR7HOADSYXRaY?= =?us-ascii?Q?BJ9CMdKz2ZRmDj7LMzSDXeXLMVGEy0MgnttKNRtwRHiN0UXVEaW179xi1XAQ?= =?us-ascii?Q?hlGyS6OKUXuArOMu9ZMFtb1uNChU1CfAx4IsCI1rqAy4GZjBANorCOpt4Uby?= =?us-ascii?Q?MiQ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9N6?= =?us-ascii?Q?wGpaZ+UNDZ3+Q158eNkkYMVJcL+icQKVhUpMIEFqetIrcJRCSsyWxjK9sNmr?= =?us-ascii?Q?sGzTysPJH0QMnVCzxODb7Gs4Y/8Yu1DGbI1dLkK8g45pn7rCsbUyCy7AhEIj?= =?us-ascii?Q?KiklzRYLNohD5SwFWF2fnA8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5696.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cac80813-4736-40d0-e902-08d9a57f4989 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2021 01:53:56.0510 (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: izCKyX9uLilzxpoEC8Dz40KKMJ++/tR7NtNZ6D0H3RhPUlMi4TUFSQzvxiGsRMgWrfPLAdqv8Jg4NkQRUkBWaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1524 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 3 comments: > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -224,6 +224,7 @@ typedef struct { > BOOLEAN SevEsIsEnabled; > BOOLEAN SevSnpIsEnabled; > UINTN GhcbBase; > + BOOLEAN ExtTopoAvail; > } MP_CPU_EXCHANGE_INFO; 1. Can you please group all SEV-ES fields together? Those might include followings: BOOLEAN SevEsIsEnabled; BOOLEAN SevSnpIsEnabled; UINTN GhcbBase; BOOLEAN ExtTopoAvail; >=20 > + if (ExchangeInfo->SevSnpIsEnabled) { > + AsmCpuid (CPUID_SIGNATURE, &StdRangeMax, NULL, NULL, NULL); > + if (StdRangeMax >=3D CPUID_EXTENDED_TOPOLOGY) { > + CPUID_EXTENDED_TOPOLOGY_EBX ExtTopoEbx; > + > + AsmCpuid (CPUID_EXTENDED_TOPOLOGY, NULL, &ExtTopoEbx.Uint32, NULL,= NULL); > + ExchangeInfo->ExtTopoAvail =3D !!ExtTopoEbx.Bits.LogicalProcessors= ; > + } > + } > + 2. With the grouping, can you please create a routine such as FillExchangeI= nfoDataSevEs (...) in AmdSev.c? > // > // Get the BSP's data of GDT and IDT > // > diff --git a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc b/UefiCpuPkg/Library/= MpInitLib/MpEqu.inc > index 01668638f245..aba53f57201c 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc > +++ b/UefiCpuPkg/Library/MpInitLib/MpEqu.inc > @@ -94,6 +94,7 @@ struc MP_CPU_EXCHANGE_INFO > .SevEsIsEnabled: CTYPE_BOOLEAN 1 > .SevSnpIsEnabled CTYPE_BOOLEAN 1 > .GhcbBase: CTYPE_UINTN 1 > + .ExtTopoAvail: CTYPE_BOOLEAN 1 > endstruc 3. can you please do same group in NASM struct?