From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.42]) by mx.groups.io with SMTP id smtpd.web09.9635.1582730702189793992 for ; Wed, 26 Feb 2020 07:25:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=Hc4cXDko; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.42, mailfrom: leo.duran@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WiJ9g9Zybza+3UbB5W/V50q4nY36l/1GowXXVciyBuzCLyZkPlrkMHI969kTmQVvJcfy19Xotm3dDCSq++nH95nV4zkGxxRU6aLI1HC7Y07B5XPbFBJnKf0QEvJxFaWqYze6FvnvD5cRizLu7i0KLaqIlhBA9tURyMAJiBNrMFzQIENo5gnaqvslA5SMEN0k/GDWY1uH4nWy1721vOP4HckYE19Ku77SsqcWdkZSoYoud7JAfiC5kDIcUOr4KNS5THQCizLySFx+Gt6dCgAxjxp6RHeV06zY49VtkHpx5ciHVckR6etotPqbX5yC4AyVcFpqDd9oC3vy3Q6Jrd5UFw== 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=eGUcJTOWlsXf83ee5Dxy6YoWF8Ms6i+qSFNJIjMOOyk=; b=kQBzw8eA73JU5ZUVn1sAKhRhaOkfQgULwa/vEKiiVHZDELpenDBXNje0WybIJVVaTZVS9A+V/KLESbrA6JlKWmC6ajP9kYrQ3ui2xm9ZPoA27/sigEjNs8Yd4DUx+p9F01kdYvPpHrkCqxINfuMcmLuOM4NfowY9dO3xQaCqTFD26XwP8D42/GE3nVJV2Jvf2nZqPNIBoyqqM3XnzL8zKLNVVceuajDVpjm9t5O3s6cIfmTzRjWWf9tKL7/WQqszR92ifYGhziKklYWCLBCC2UB/0zg/jDG4VrMYFevRDyIs4bZE925CW3uRjTaDcIqX6i3y8AodZqoJBeN+0IijVA== 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=eGUcJTOWlsXf83ee5Dxy6YoWF8Ms6i+qSFNJIjMOOyk=; b=Hc4cXDkoI2HiHUxbN4kNFWF0yZyD0aQ2Hj2VdVYzhcRMPb4I1phOK81KtSphUmQIQYqAfiAWLNcLmI+nQ2SjpJBbXcNmp/BM6sAI3RUa5cY12BgAhQj0Hs73EKsVFNOXByeFLPad0aYVLmJC6F2MYA/XGXR6J9ZDG5FiMnEQVJA= Received: from BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1635.namprd12.prod.outlook.com (2603:10b6:405:3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Wed, 26 Feb 2020 15:25:01 +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; Wed, 26 Feb 2020 15:25:00 +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+kbJkGHn9DFW2NUaKgspoeAgAB2EYCAAHmSsA== Date: Wed, 26 Feb 2020 15:25:00 +0000 Message-ID: References: <1582659566-9893-1-git-send-email-leo.duran@amd.com> <734D49CCEBEEF84792F5B80ED585239D5C4542DA@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C4542DA@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: 5b1d7b90-e020-424d-4b75-08d7bad00bc8 x-ms-traffictypediagnostic: BN6PR12MB1635: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0325F6C77B x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6029001)(4636009)(136003)(39860400002)(396003)(346002)(376002)(366004)(189003)(199004)(76116006)(71200400001)(66476007)(66556008)(53546011)(55016002)(64756008)(66946007)(6506007)(66446008)(26005)(2906002)(186003)(4326008)(8936002)(81166006)(316002)(33656002)(9686003)(81156014)(7696005)(86362001)(110136005)(52536014)(478600001)(8676002)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1635;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: DL05bje6yW9bOqhR4EQAn1gJMmWeySmsiplvdpRK35jH+3cWjYT5GFf27Y7STs8mMpAzsSVzdEK53tAvXdJeefkd07zvhEB+yk3YSJLY32YJRYQjTAl2VfRODI57Zb9fNuTXtjd+/fjQPBovJoDMxYjy2TdWIG+sKzs8/ir3CoJp8olqzocvG2H05in56nEYf1ZQHhadpMIAqotZiYzGDG/sOtD50IWuto2gQSRbK8w+LP5GvHQShQ9/tDTf/YyeHUREoRZe6en+D0QHWFWfbBXf4EChw2eeQFfkQVTnFa/YO2owb6uLTYTtX6EQVO0PKRrRNPJSekCHLmjCczUIdRJToD2VG5SCaJW6CK+GEFFHzxxoiofDRLAapCxKfIeHjTJh1QJA6Qs/XnSwyf/bLWSPFG01VBGPm5NFBcRpfB9Ep0VcDHTqFgL/8q8I8XlV x-ms-exchange-antispam-messagedata: uStMWIhXdF+F8vd9KCffY8mumSkEnEOFAr+Fd4zi24FdWuDm+UeIgx4oq8VHi1np8bsBCEJxoawtGKIXOKtv19falqJnLD6ma8p4xK7nVRciNK/IIS3O4KqRfskNd9FMRd8WYDMOypUu9NnWKELPuw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b1d7b90-e020-424d-4b75-08d7bad00bc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2020 15:25:00.8804 (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: /e1aAeZ4A/YtrpqabUdRNUuga0qiySSGlIpprmK5I4z3GGykcNEvvgEVdJ8GGKNw X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1635 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: Wednesday, February 26, 2020 2:57 AM > To: Laszlo Ersek ; devel@edk2.groups.io; Duran, Leo > ; Wu, Hao A ; Fu, Siyuan > > Cc: Dong, Eric > Subject: RE: [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in > MpInitLib >=20 > Leo, >=20 > > > BTW, reading the PlatformId MSR was already being done by > > > MicrocodeDetect(), but it never affected AMD-based platforms as the > > > flow never gets that far, since the Detect routine bails out early wh= en it > finds the size of the patch is zero. >=20 > You are saying that PlatformId MSR access is not performed by CPU in old > code because of the zero size uCode. > But now with Hao or Siyuan's change, the PlatformId MSR access is always > performed even when there is no uCode. It sounds like a regression to > optimization to me. > Did you evaluate the path to avoid accessing PlatformID MSR when uCode > doesn't exist? So that the API to detect AMD processor is not needed at a= ll. [Duran, Leo]=20 Hi Ray, I think your summary is pretty accurate, except that I'd say that avoiding = a READ from the PlatformId MSR should happen solely based on the fact that the MSR simply does not exist o= n AMD processors. Then as a result of that, the usage of the PlatformId (as it relates to mi= crocode or anything else) must then be dealt with separately. To that end, I think I covered all cases where the MSR is being read, and a= lso where PlatformId is being used. (I also added comments for each case) Thanks, Leo. >=20 > Thanks, > Ray