From: "Ni, Ray" <ray.ni@intel.com>
To: "Wu, Hao A" <hao.a.wu@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>,
Laszlo Ersek <lersek@redhat.com>,
"Zeng, Star" <star.zeng@intel.com>,
"Fu, Siyuan" <siyuan.fu@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info
Date: Tue, 24 Dec 2019 02:51:00 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C3A9DD4@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191224013656.13404-2-hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Wu, Hao A <hao.a.wu@intel.com>
> Sent: Tuesday, December 24, 2019 9:37 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni,
> Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Zeng, Star
> <star.zeng@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Kinney, Michael
> D <michael.d.kinney@intel.com>
> Subject: [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID &
> Platform ID info
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2429
>
> 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.
>
> These information will be used in the next commit to decide whether a
> microcode patch will be loaded into memory.
>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
> ---
> UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 ++
> UefiCpuPkg/Library/MpInitLib/MpLib.c | 14 +++++++++++++-
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> 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;
>
> //
> 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;
>
> CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData-
> >CpuInfoInHob;
> CpuInfoInHob[ProcessorNumber].InitialApicId = GetInitialApicId ();
> @@ -559,6 +560,17 @@ InitializeApData (
> CpuMpData->CpuData[ProcessorNumber].Waiting = FALSE;
> CpuMpData->CpuData[ProcessorNumber].CpuHealthy = (BistData == 0) ?
> TRUE : FALSE;
>
> + PlatformIdMsr.Uint64 = AsmReadMsr64 (MSR_IA32_PLATFORM_ID);
> + CpuMpData->CpuData[ProcessorNumber].PlatformId = (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
next prev parent reply other threads:[~2019-12-24 2:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-24 1:36 [PATCH v1 0/4] Microcode related optimizations Wu, Hao A
2019-12-24 1:36 ` [PATCH v1 1/4] UefiCpuPkg/MpInitLib: Collect processors' CPUID & Platform ID info Wu, Hao A
2019-12-24 2:51 ` Ni, Ray [this message]
2019-12-24 1:36 ` [PATCH v1 2/4] UefiCpuPkg/MpInitLib: Reduce the size when loading microcode patches Wu, Hao A
2019-12-24 3:32 ` Ni, Ray
2019-12-24 5:48 ` Wu, Hao A
2019-12-24 1:36 ` [PATCH v1 3/4] UefiCpuPkg: Add definitions for EDKII microcode patch HOB Wu, Hao A
2019-12-24 3:48 ` Ni, Ray
2019-12-24 5:48 ` Wu, Hao A
2019-12-24 8:15 ` Ni, Ray
2019-12-25 5:42 ` Wu, Hao A
2019-12-24 1:36 ` [PATCH v1 4/4] UefiCpuPkg/MpInitLib: Produce " Wu, Hao A
2019-12-24 3:54 ` Ni, Ray
2019-12-25 5:42 ` Wu, Hao A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=734D49CCEBEEF84792F5B80ED585239D5C3A9DD4@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox