From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.887.1577155864336038960 for ; Mon, 23 Dec 2019 18:51:04 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2019 18:51:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,350,1571727600"; d="scan'208";a="229512585" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 23 Dec 2019 18:51:03 -0800 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Dec 2019 18:51:03 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Dec 2019 18:51:02 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.72]) with mapi id 14.03.0439.000; Tue, 24 Dec 2019 10:51:00 +0800 From: "Ni, Ray" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Dong, Eric" , Laszlo Ersek , "Zeng, Star" , "Fu, Siyuan" , "Kinney, Michael D" Subject: Re: [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info Thread-Topic: [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info Thread-Index: AQHVufqnzvzWyz5b8kqcUMZZOaN9bafIlTBA Date: Tue, 24 Dec 2019 02:51:00 +0000 Deferred-Delivery: Tue, 24 Dec 2019 02:49:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C3A9DD4@SHSMSX104.ccr.corp.intel.com> References: <20191224013656.13404-1-hao.a.wu@intel.com> <20191224013656.13404-2-hao.a.wu@intel.com> In-Reply-To: <20191224013656.13404-2-hao.a.wu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Wu, Hao A > Sent: Tuesday, December 24, 2019 9:37 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Dong, Eric ; Ni, > Ray ; Laszlo Ersek ; Zeng, Star > ; Fu, Siyuan ; Kinney, Michael > D > Subject: [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID & > Platform ID info >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2429 >=20 > This commit will collect the CPUID and Platform ID information for each > processor within system. They will be stored in the CPU_AP_DATA structure= . >=20 > These information will be used in the next commit to decide whether a > microcode patch will be loaded into memory. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Star Zeng > Cc: Siyuan Fu > Cc: Michael D Kinney > Signed-off-by: Hao A Wu > --- > UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 14 +++++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h > b/UefiCpuPkg/Library/MpInitLib/MpLib.h > index 8fa07b12c5..4440dc2701 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -122,6 +122,8 @@ typedef struct { > UINT64 CurrentTime; > UINT64 TotalTime; > EFI_EVENT WaitEvent; > + UINT32 ProcessorSignature; > + UINT8 PlatformId; > } CPU_AP_DATA; >=20 > // > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index d32adf0780..d5077e080e 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -548,7 +548,8 @@ InitializeApData ( > IN UINT64 ApTopOfStack > ) > { > - CPU_INFO_IN_HOB *CpuInfoInHob; > + CPU_INFO_IN_HOB *CpuInfoInHob; > + MSR_IA32_PLATFORM_ID_REGISTER PlatformIdMsr; >=20 > CpuInfoInHob =3D (CPU_INFO_IN_HOB *) (UINTN) CpuMpData- > >CpuInfoInHob; > CpuInfoInHob[ProcessorNumber].InitialApicId =3D GetInitialApicId (); > @@ -559,6 +560,17 @@ InitializeApData ( > CpuMpData->CpuData[ProcessorNumber].Waiting =3D FALSE; > CpuMpData->CpuData[ProcessorNumber].CpuHealthy =3D (BistData =3D=3D 0)= ? > TRUE : FALSE; >=20 > + PlatformIdMsr.Uint64 =3D AsmReadMsr64 (MSR_IA32_PLATFORM_ID); > + CpuMpData->CpuData[ProcessorNumber].PlatformId =3D (UINT8) > PlatformIdMsr.Bits.PlatformId; > + > + AsmCpuid ( > + CPUID_VERSION_INFO, > + &CpuMpData->CpuData[ProcessorNumber].ProcessorSignature, > + NULL, > + NULL, > + NULL > + ); > + > InitializeSpinLock(&CpuMpData->CpuData[ProcessorNumber].ApLock); > SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle); > } > -- > 2.12.0.windows.1