From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.10296.1577252551764623666 for ; Tue, 24 Dec 2019 21:42:32 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Dec 2019 21:42:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,353,1571727600"; d="scan'208";a="419167314" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 24 Dec 2019 21:42:31 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Dec 2019 21:42:31 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Dec 2019 21:42:30 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by shsmsx102.ccr.corp.intel.com ([169.254.2.109]) with mapi id 14.03.0439.000; Wed, 25 Dec 2019 13:42:29 +0800 From: "Wu, Hao A" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Dong, Eric" , Laszlo Ersek , "Zeng, Star" , "Fu, Siyuan" , "Kinney, Michael D" Subject: Re: [PATCH v1 3/4] UefiCpuPkg: Add definitions for EDKII microcode patch HOB Thread-Topic: [PATCH v1 3/4] UefiCpuPkg: Add definitions for EDKII microcode patch HOB Thread-Index: AQHVufqnSYtLiUzUBEOBQyf63eNbx6fIapsAgAHtgKA= Date: Wed, 25 Dec 2019 05:42:28 +0000 Message-ID: References: <20191224013656.13404-1-hao.a.wu@intel.com> <20191224013656.13404-4-hao.a.wu@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C3AA107@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C3AA107@SHSMSX104.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ni, Ray > Sent: Tuesday, December 24, 2019 4:16 PM > To: Wu, Hao A; devel@edk2.groups.io > Cc: Dong, Eric; Laszlo Ersek; Zeng, Star; Fu, Siyuan; Kinney, Michael D > Subject: RE: [PATCH v1 3/4] UefiCpuPkg: Add definitions for EDKII microco= de > patch HOB >=20 > I suggest to let the DetectedPatchOffset points to the microcode header i= nstead > of microcode data. > Consumers can use the offset to get more information from header than jus= t > the microcode data. Yes. I will handle this as well in the next version of the series. Best Regards, Hao Wu >=20 > > -----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 ; N= i, > > Ray ; Laszlo Ersek ; Zeng, Star > > ; Fu, Siyuan ; Kinney, Michae= l > > D > > Subject: [PATCH v1 3/4] UefiCpuPkg: Add definitions for EDKII microcode > > patch HOB > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2430 > > > > This commit will add the definitions for EDKII microcode patch HOB. > > > > The intention of adding this HOB is to provide a scheme to store the be= low > > information: > > > > A. The base address and size of the microcode patches that are being > > loaded (from flash) into memory; > > B. The information of applied microcode patch for each processor within > > the system. > > > > The producer of the HOB will be the UefiCpuPkg/MpInitLib (where the loa= d, > > detect and apply of the microcode happen). The consumer of the HOB can > > be > > modules that want to detect/apply the microcode patch by themselves aga= in > > later during the boot flow. > > > > 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/UefiCpuPkg.dec | 3 ++ > > UefiCpuPkg/Include/Guid/MicrocodePatchHob.h | 50 > > ++++++++++++++++++++ > > 2 files changed, 53 insertions(+) > > > > diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec > > index 797f948631..45b267ac61 100644 > > --- a/UefiCpuPkg/UefiCpuPkg.dec > > +++ b/UefiCpuPkg/UefiCpuPkg.dec > > @@ -63,6 +63,9 @@ [Guids] > > ## Include/Guid/CpuFeaturesInitDone.h > > gEdkiiCpuFeaturesInitDoneGuid =3D { 0xc77c3a41, 0x61ab, 0x4143, { 0= x98, > > 0x3e, 0x33, 0x39, 0x28, 0x6, 0x28, 0xe5 }} > > > > + ## Include/Guid/MicrocodePatchHob.h > > + gEdkiiMicrocodePatchHobGuid =3D { 0xd178f11d, 0x8716, 0x418e, { 0= xa1, > > 0x31, 0x96, 0x7d, 0x2a, 0xc4, 0x28, 0x43 }} > > + > > [Protocols] > > ## Include/Protocol/SmmCpuService.h > > gEfiSmmCpuServiceProtocolGuid =3D { 0x1d202cab, 0xc8ab, 0x4d5c, { 0= x94, > > 0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }} > > diff --git a/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h > > b/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h > > new file mode 100644 > > index 0000000000..3667fc3786 > > --- /dev/null > > +++ b/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h > > @@ -0,0 +1,50 @@ > > +/** @file > > + The microcode patch HOB is used to store the information of: > > + A. Base address and size of the loaded microcode patches data; > > + B. Applied microcode patch for each processor within system. > > + > > + Copyright (c) 2019, Intel Corporation. All rights reserved.
> > + This program and the accompanying materials > > + are licensed and made available under the terms and conditions of th= e BSD > > License > > + which accompanies this distribution. The full text of the license m= ay be > > found at > > + http://opensource.org/licenses/bsd-license.php. > > + > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, > > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > + > > +**/ > > + > > +#ifndef _MICROCODE_PATCH_HOB_H_ > > +#define _MICROCODE_PATCH_HOB_H_ > > + > > +extern EFI_GUID gEdkiiMicrocodePatchHobGuid; > > + > > +// > > +// The EDKII microcode patch HOB will be produced by MpInitLib and it = can > > be > > +// consumed by modules that want to detect/apply microcode patches. > > +// > > +typedef struct { > > + // > > + // The base address of the microcode patches data after being loaded= into > > + // memory. > > + // > > + UINT64 MicrocodePatchAddress; > > + // > > + // The total size of the loaded microcode patches. > > + // > > + UINT64 MicrocodePatchRegionSize; > > + // > > + // The number of processors within the system. > > + // > > + UINT32 ProcessorNumber; > > + // > > + // An array with 'ProcessorNumber' elements that stores the offset (= with > > + // regard to 'MicrocodePatchAddress') of the applied microcode patch= for > > each > > + // processor. > > + // If no microcode patch is applied for certain processor, the relat= ing > > + // element will be set to MAX_UINT64. > > + // > > + UINT64 DetectedPatchOffset[0]; > > +} EDKII_MICROCODE_PATCH_HOB; > > + > > +#endif > > -- > > 2.12.0.windows.1