From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.58]) by mx.groups.io with SMTP id smtpd.web10.14.1582827427037962219 for ; Thu, 27 Feb 2020 10:17:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=bHg/FTvw; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.223.58, mailfrom: leo.duran@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BPNm9FNJ8gyPSmrWjTX1PTIMqiMrvRR3ZusHj2Vg3IrPR1g10gOmEZDbfAZaTfFH7/bz0384LQlYxzeCtMWP+TY9bL+CDuAbN9H9ZhyhiAIrIwtZc3Ih0xaNwG7jVjmDvQuGjZNOrVhUstcwQdWQwFvEa3Rs7DJzhUC7dr98noAl0b0bVKFpJyHZdbIFVrd6u/OOaI//jX6iTPdWtQBYba3bNMkiH5K0dXfib98QkrUjZoLpjMRJ86yXhrojlprFKlHh65fQliaRT9U/XF7f4VHiEMjocmlLwUjG5lszaFLcF4Pm0fdH7KhSI/iLgImrK2xHO2br9P2Lxpqw6bOMfw== 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-SenderADCheck; bh=NmAWm0kvL0oSt5LFSczv9gqdp8N4mRnFVTz2bBQhJMc=; b=Sc2pxpOBsPa2IqX0p8AacwGWILLO5HkR+yBG7nRTrDXN+r53TokO/sx1nppvWrM8LxJ4ly6n75z78GJzPEMOAztDKHwuT+zjcQwAr8nyVyaJgfAzUhhyK94wSkMt5Y7T2eHCQoaKAq9R5AkATmcElv4/rdZFhuXjNzBTh3DiPkXHKN5bnN/O8h14n7uDnmyTh2bqnpCCcxUCZxAml6vnC1tuZTosbJyYQQ6muVyeQpAvh/CHa+E3cV1ZoP8d9OnqFeJyiW4/4WDpw4eijPpXqzoSv6MGdAHes5ltCguj9XZHS2xHWz2phrJxS7tHqNhs0/bSwqSruWXhN8vsWmrQXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NmAWm0kvL0oSt5LFSczv9gqdp8N4mRnFVTz2bBQhJMc=; b=bHg/FTvwYdGebROS/XMElArdUFMnxU4eum4tF32d1ldHCyVq+dQUnALjubJcDCmewMCGsa3KHGNVEQtNYU+1kkpaAKockX9fHDvElT0EW5Bn+nMT/hgtdjvQXldfQ4USFpSzmIH/Uyy/JWrtjIHFqgzwBHItW74F6V9DjVEQYr4= Received: from BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1443.namprd12.prod.outlook.com (2603:10b6:405:e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Thu, 27 Feb 2020 18:17:04 +0000 Received: from BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c]) by BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c%7]) with mapi id 15.20.2750.021; Thu, 27 Feb 2020 18:17:04 +0000 From: "Duran, Leo" To: "Ni, Ray" , Laszlo Ersek , "devel@edk2.groups.io" , "Wu, Hao A" , "Fu, Siyuan" CC: "Dong, Eric" Subject: Re: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in MpInitLib Thread-Topic: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in MpInitLib Thread-Index: AQHV7BNuZBsSC+kbJkGHn9DFW2NUaKgspoeAgAB2EYCAAHmSsIAABrIAgAAMX4CAAAR2sIAAEzCAgAAAykCAAMs0AIAAzrJA Date: Thu, 27 Feb 2020 18:17:04 +0000 Message-ID: References: <1582659566-9893-1-git-send-email-leo.duran@amd.com> <734D49CCEBEEF84792F5B80ED585239D5C4542DA@SHSMSX104.ccr.corp.intel.com> <444c59ea-70dc-0edd-d680-add054dad2c5@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5C463F32@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C463F32@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [173.170.80.115] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 678306e0-e9ca-4c9c-6a76-08d7bbb13fb8 x-ms-traffictypediagnostic: BN6PR12MB1443: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 03264AEA72 x-forefront-antispam-report: SFV:NSPM;SFS:(10001)(10009020)(6029001)(4636009)(136003)(366004)(346002)(39860400002)(376002)(396003)(189003)(199004)(7696005)(81166006)(81156014)(76116006)(86362001)(52536014)(53546011)(2906002)(66946007)(6506007)(8936002)(45080400002)(478600001)(64756008)(8676002)(19627235002)(55016002)(4326008)(316002)(966005)(26005)(110136005)(66446008)(33656002)(66556008)(66476007)(186003)(9686003)(5660300002)(71200400001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1443;H:BN6PR12MB1922.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HFQM6NfcCSxXSQt3I70oSxoIu5FgfmdKmRv7KWZOwa6q8MDqPqbKgkLkTBgbXNDiZumkaRIZE2pL3f4hMkGkEzwp+trE6Tq9b8hBEJPMjA2S+L+oqbRMka7j4ioxRy0xakY66tpcjInuZAfD/CVU/TpqDnxyy3yQbVvL8K1t9/naiOEU/voGYhOUb+FltjPm+J3+CmEkEkcMrMs3dNIv9t6aHRBZc2hIK7IsyJvgSsEn2pZneKlXAmr9NPRH6wNu1cHznU2rsUzdK0NHnjPO0izmWT75HDEuT0lw4EBMyPYya6Bdd7SrvyJeaVV1Hso7dOQuxsUIdbJGO5RkDcBRwsnWj2PIKBbmhNX/MU1W8DDygGrw1u5rHlpkxuh9W8dV5wZnqAtbzKAiJu2lpv2oRKh48GD6yuMX/4Oa8+NPE9yXQkjA8p1ubzh5PClxVaY/KB7PACBK7Am010f05i57/za4dMOrMr51GDGmVlCOMSeu4lQTRJjAXG8Q//Jx5XLCqplmm25NPJKrdRKDLwwJ8wc5KyPf4zCkXR9JgA6tlNPQ9+NJ5/CPFR4ClTWB6RruY16b3ZjFeysQ+l3+rm8bnQ== x-ms-exchange-antispam-messagedata: mWIOLneBXHvBII0ixRHQ4WQ6iJY1qdOYNs1w0N3B9hZl/JyR3hlc4zHfg353aTHJ097jLO/HT/ROWr4ef2ZMJuhyzinN9eaUxz3fTl+f0Ts1u0aoY+QDqhACtdpzWTMWUCr7Q7zMrGZM89s5aIuYkA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 678306e0-e9ca-4c9c-6a76-08d7bbb13fb8 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2020 18:17:04.8190 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +z4gps4P5RXqvQfGkiFbkfuvJ1ph+csf0BkGwzu2iuhMS9RANUxR4cjw1ALGTKmj X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1443 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ni, Ray [mailto:ray.ni@intel.com] > Sent: Thursday, February 27, 2020 12:55 AM > To: Duran, Leo ; Laszlo Ersek ; > devel@edk2.groups.io; Wu, Hao A ; Fu, Siyuan > > Cc: Dong, Eric > Subject: RE: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in > MpInitLib >=20 > Leo and all, > I replied in > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzi= ll > a.tianocore.org%2Fshow_bug.cgi%3Fid%3D2556&data=3D02%7C01%7Cleo. > duran%40amd.com%7C40786a41798d4173dd8508d7bb49aaa7%7C3dd8961 > fe4884e608e11a82d994e183d%7C0%7C0%7C637183797396444421&s > data=3DUoLRg%2ByFl%2BxyPB41xu1wOHpsf2euBrSe2HuD4CskTWg%3D&r > eserved=3D0 for a more general question about how uCode is used in AMD > processors. >=20 > Because this package recently exposed a new interface > ShadowMicrocodePpi, I try to involve Leo in the review from AMD uCode's > needs. >=20 > Thanks, > Ray [Duran, Leo] Hi Ray, I just updated the ticket to say: AMD handles microcode patches outside of the context of UEFI. So EDK2 hooks= (ShadowMicrocode PPI, et al) are not required. (Hence my comments in the MpInitLib patch I just submitted) >=20 > > -----Original Message----- > > From: Duran, Leo > > Sent: Thursday, February 27, 2020 1:52 AM > > To: Laszlo Ersek ; Ni, Ray ; > > devel@edk2.groups.io; Wu, Hao A ; Fu, Siyuan > > > > Cc: Dong, Eric > > Subject: RE: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in > > MpInitLib > > > > > > > > > -----Original Message----- > > > From: Laszlo Ersek [mailto:lersek@redhat.com] > > > Sent: Wednesday, February 26, 2020 12:45 PM > > > To: Duran, Leo ; Ni, Ray ; > > > devel@edk2.groups.io; Wu, Hao A ; Fu, Siyuan > > > > > > Cc: Dong, Eric > > > Subject: Re: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in > > > MpInitLib > > > > > > On 02/26/20 17:39, Duran, Leo wrote: > > > > > > > > > > > >> -----Original Message----- > > > >> From: Laszlo Ersek [mailto:lersek@redhat.com] > > > >> Sent: Wednesday, February 26, 2020 11:21 AM > > > >> To: Duran, Leo ; Ni, Ray ; > > > >> devel@edk2.groups.io; Wu, Hao A ; Fu, Siyuan > > > >> > > > >> Cc: Dong, Eric > > > >> Subject: Re: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug > > > >> in MpInitLib > > > >> > > > >> On 02/26/20 16:46, Duran, Leo wrote: > > > >>> BTW, > > > >>> > > > >>> I also considered adding a flag to CPU_MP_DATA to make the usage > > > >>> of > > > >> PlatformId a bit more explicit. > > > >>> E.g., something like CpuMpData- > > > >>> CpuData[ProcessorNumber].IsValidPlatformId... So the init code > > > >>> would look > > > >> like this: > > > >>> > > > >>> // > > > >>> // NOTE: PlatformId is not relevant on AMD platforms. > > > >>> // > > > >>> if (StandardSignatureIsAuthenticAMD ()) { > > > >>> CpuMpData->CpuData[ProcessorNumber].IsValidPlatformId =3D > FALSE; > > > >>> else { > > > >>> PlatformIdMsr.Uint64 =3D AsmReadMsr64 > (MSR_IA32_PLATFORM_ID); > > > >>> CpuMpData->CpuData[ProcessorNumber].PlatformId =3D > > > >> (UINT8)PlatformIdMsr.Bits.PlatformId; > > > >>> CpuMpData->CpuData[ProcessorNumber].IsValidPlatformId =3D TRU= E; > > > >>> } > > > >>> > > > >>> This way "IsValidPlatformId" could be checked prior to using > "PlatformId". > > > >>> Anyway, that seemed a bit overkill, so I opted against it... thou= ghts? > > > >> > > > >> I think a global flag is justified; in the above approach, > "IsValidPlatformId" > > > >> would not vary across "ProcessorNumber", so it does look like > > > >> useless generality. > > > > [Duran, Leo] > > > > Great point, Laszlo. > > > > Indeed, global makes senses in the case! > > > > I can prepare a v2-set to incorporate that. > > > > > > No, sorry, that wasn't what I meant. I didn't try to suggest a global= variable. > > > Instead, I meant that a "global check" (conceptually, i.e. > > > regardless of particular processor number) made sense. > > > > > > I'm also not particularly *against* a global variable. In other > > > words, I didn't try to comment on using a global variable *at all*. > > > > > > Using a global variable might as well work, I just feel that your > > > current patches are good enough. > > [Duran, Leo] > > Great... I hear you. > > Then, I'd prefer not refactoring further at this point.... I hope Ray &= Eric > agree. > > > > Thanks for your feedback! > > Leo. > > > > > > > > Thanks > > > Laszlo