From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.10914.1577263832658408954 for ; Wed, 25 Dec 2019 00:50:33 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2019 00:50:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,353,1571727600"; d="scan'208";a="250048603" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 25 Dec 2019 00:50:32 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Dec 2019 00:50:31 -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; Wed, 25 Dec 2019 16:50:29 +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 v2 3/6] UefiCpuPkg: Add definitions for EDKII microcode patch HOB Thread-Topic: [PATCH v2 3/6] UefiCpuPkg: Add definitions for EDKII microcode patch HOB Thread-Index: AQHVuvkVbhYFtWlGEk6xnCZTacwZz6fKijHQ Date: Wed, 25 Dec 2019 08:50:28 +0000 Deferred-Delivery: Wed, 25 Dec 2019 08:49:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C3AADB5@SHSMSX104.ccr.corp.intel.com> References: <20191225075814.8372-1-hao.a.wu@intel.com> <20191225075814.8372-4-hao.a.wu@intel.com> In-Reply-To: <20191225075814.8372-4-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: Wednesday, December 25, 2019 3:58 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 v2 3/6] UefiCpuPkg: Add definitions for EDKII microcode > patch HOB >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2430 >=20 > This commit will add the definitions for EDKII microcode patch HOB. >=20 > The intention of adding this HOB is to provide a scheme to store the belo= w > information: >=20 > A. The base address and size of the microcode patches that are being > loaded (from flash) into memory; > B. The information of detected microcode patch for each processor within > the system. >=20 > The producer of the HOB will be the UefiCpuPkg/MpInitLib (where the load, > 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 again > later during the boot flow. >=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/UefiCpuPkg.dec | 3 ++ > UefiCpuPkg/Include/Guid/MicrocodePatchHob.h | 50 > ++++++++++++++++++++ > 2 files changed, 53 insertions(+) >=20 > 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, { 0x9= 8, > 0x3e, 0x33, 0x39, 0x28, 0x6, 0x28, 0xe5 }} >=20 > + ## Include/Guid/MicrocodePatchHob.h > + gEdkiiMicrocodePatchHobGuid =3D { 0xd178f11d, 0x8716, 0x418e, { 0xa= 1, > 0x31, 0x96, 0x7d, 0x2a, 0xc4, 0x28, 0x43 }} > + > [Protocols] > ## Include/Protocol/SmmCpuService.h > gEfiSmmCpuServiceProtocolGuid =3D { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x9= 4, > 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..8aaa08b683 > --- /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. Detected 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 the = BSD > License > + which accompanies this distribution. The full text of the license may= 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 ca= n > be > +// consumed by modules that want to detect/apply microcode patches. > +// > +typedef struct { > + // > + // The base address of the microcode patches data after being loaded i= nto > + // memory. > + // > + UINT64 MicrocodePatchAddress; > + // > + // The total size of the loaded microcode patches. > + // > + UINT64 MicrocodePatchRegionSize; > + // > + // The number of processors within the system. > + // > + UINT32 ProcessorCount; > + // > + // An array with 'ProcessorCount' elements that stores the offset (wit= h > + // regard to 'MicrocodePatchAddress') of the detected microcode patch > + // (including the CPU_MICROCODE_HEADER data structure) for each > processor. > + // If no microcode patch is detected for certain processor, the relati= ng > + // element will be set to MAX_UINT64. > + // > + UINT64 ProcessorSpecificPatchOffset[0]; > +} EDKII_MICROCODE_PATCH_HOB; > + > +#endif > -- > 2.12.0.windows.1