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.web09.29095.1577434343081447051 for ; Fri, 27 Dec 2019 00:12:23 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: eric.dong@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Dec 2019 00:12:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,362,1571727600"; d="scan'208";a="269027048" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 27 Dec 2019 00:12:22 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Dec 2019 00:12:22 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Dec 2019 00:12:22 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.71]) with mapi id 14.03.0439.000; Fri, 27 Dec 2019 16:12:20 +0800 From: "Dong, Eric" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Ni, Ray" , Laszlo Ersek , "Zeng, Star" , "Fu, Siyuan" , "Kinney, Michael D" Subject: Re: [PATCH v4 1/6] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info Thread-Topic: [PATCH v4 1/6] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info Thread-Index: AQHVvIfSu0E1Mwxwu0+JvK7+kF9W0qfNoYzg Date: Fri, 27 Dec 2019 08:12:19 +0000 Message-ID: References: <20191227073229.9416-1-hao.a.wu@intel.com> <20191227073229.9416-2-hao.a.wu@intel.com> In-Reply-To: <20191227073229.9416-2-hao.a.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Wu, Hao A > Sent: Friday, December 27, 2019 3:32 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Dong, Eric ; Ni, > Ray ; Laszlo Ersek ; Zeng, Star > ; Fu, Siyuan ; Kinney, Michael > D > Subject: [PATCH v4 1/6] 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 > Reviewed-by: Ray Ni > --- > 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