From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=hmogHra0; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: michael.a.kubacki@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Thu, 03 Oct 2019 00:54:56 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 00:54:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,251,1566889200"; d="scan'208,217";a="366968744" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 03 Oct 2019 00:54:55 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 00:54:55 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 00:54:54 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.50) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 00:54:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V4sfNqSMOVgx/FNQdJkWVtFwRhE00+xoJQiWtCm3PMFyBsOLhUmg7326sXD/omX3IvL9F5sDYmjI3GgpK+xl1NiSZb9BU6zC1NUyIFgrDG/J1JK2R90ntCKiPNyU54sRjH0TEaQNCjgxazP2aexQC1BKI4JRwCa+KFrAi2vuvCLUyFSuPrjPXsmdyn09Hy3EvKgjRtjMr6sT5HsgEtdGSBabGTqhPMxs2UICyu/xS9GaiEzqv8mVKR7v/460+0abBXONMOGmE3YT336fJ9T4JOW8kVinYPBpCskWno2eupNAh3h6gjDAAN6AbGiGgJcs67IiG+LIexS84UbkA1UYeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h61Ayq8L0IYn/68Yvah/+EmqHoqBAqCTYqHzH8hyyJE=; b=WcoSxPdFpKSXzlISvEi8o2LOuijlWWmxEdhRXfupfAEbpb3AstWzyDWCjiCkLIgJm4nhnQsOQ1/dphnFjUkuI3cwPh4rduUHb0SsTtrnYWEy0KIxNkhn7fWgQpHgJbuCZwbrEc2f+N6+1QJoxNYNPfcDXOVR1hiJtVw43Pj6jYKwE8z2BopHVMBW5Q6JHDpzE6W8Km41ElsSD9GSmuau1FEwo6lwXH08BtGCArnFnDEe/qRW0RtHLQpiyOyEczG6PuPUA3p/Zjmdbl1kfJ6DAAgAcrRobjoc/NrNwFoLiKmbXaaUrznhkjksD3220KT9+5+dOFpTslrZF9FZesls2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h61Ayq8L0IYn/68Yvah/+EmqHoqBAqCTYqHzH8hyyJE=; b=hmogHra0UK/aGNVIVafW8Hhr9Cr/IcCQiyQMFizsJVEDQPvUktQFQE8JDSA2+YIBJgSaaXmtJfndTx1fHlO9AuCVdus69BF523tbHG4yEp+Edeyg6WXY/L5akG+t+49h3oVv38vngVmUh05S/0rNhBDESz0cjpBLZqZpoGLoNwQ= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB3260.namprd11.prod.outlook.com (20.176.121.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Thu, 3 Oct 2019 07:54:37 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e%3]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 07:54:37 +0000 From: "Kubacki, Michael A" To: "afish@apple.com" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Dong, Eric" , "Gao, Liming" , "Ni, Ray" Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator Thread-Topic: [edk2-devel] [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator Thread-Index: AQHVd/XI0MuHFQNjtkOEcbKKkAGKsKdH+pKQgAALMkCAAE31gIAAMwaA Date: Thu, 3 Oct 2019 07:54:37 +0000 Message-ID: References: <20191001011547.14588-1-michael.a.kubacki@intel.com> <56807650-1B30-4A3F-BF9D-6A98F945DA95@apple.com> In-Reply-To: <56807650-1B30-4A3F-BF9D-6A98F945DA95@apple.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDRiOGJjZWItZjg0Zi00MjkyLTk4MGMtNGM0NjEzNzE3ZWM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNkxuTFRoMVBHXC8rN3NyYXpMNVdNWmNWWVF0OFlTbkdSNGJjQm5DeDJNelF1QTJoYU5ud2ZCdFZxZ0VudExjbVoifQ== dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ac7fbcb1-1a85-4c44-cfbc-08d747d6f02f x-ms-traffictypediagnostic: DM6PR11MB3260: x-ms-exchange-purlcount: 5 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 01792087B6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39860400002)(136003)(346002)(396003)(13464003)(189003)(199004)(81156014)(66946007)(66066001)(76116006)(5660300002)(9686003)(54906003)(236005)(6306002)(55016002)(102836004)(4326008)(66556008)(66446008)(7736002)(8676002)(74316002)(66476007)(64756008)(6436002)(476003)(26005)(6116002)(790700001)(3846002)(110136005)(966005)(76176011)(7696005)(54896002)(229853002)(478600001)(486006)(446003)(11346002)(81166006)(186003)(316002)(14454004)(6246003)(107886003)(33656002)(52536014)(6506007)(53546011)(86362001)(606006)(25786009)(256004)(2501003)(8936002)(14444005)(30864003)(71200400001)(71190400001)(2906002)(99286004);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB3260;H:DM6PR11MB3834.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oc6pS/XcNwbEvhObilUeBQCAxn5Qn+WfVEC5uxN6eWiU+TAqFpFMu+SqnCk7sUbc7tkzZiiwoqtJxqngI4ZS5meyu8PdudorbtjHKb2pfErlqOc1xv6ckxXotQhfxwCaRMkG1n8CqAxBojEhUG1XqJbxV1ph69zlhkyaa/Xn81N2q8QUky5mZxVSWManSOuj87tPICr+ewUPHrTXgCoC60Vkf2NDqnEwQid/KcS2QrjPaphFoW2EnRTCAc4yTcezC7nD1V74kJREIC7ccxbnt3cKmeKmMOmZN2pp77uW84+n54bws4G9hTLQLhWx+W1mku5SSgDocY1AXK8HzO3HqEeSNKjD4+bx3dy8gYlJG66mUoumm3/ykBzwz7ziG4FojHsHUZCWhOH/NF7Fa7Lo74YmHEEKi5qHT8qNChmjdRJigMeWrkMsNc58exSjvZUWdeBcL5fAVlBrydJ+rVebAQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ac7fbcb1-1a85-4c44-cfbc-08d747d6f02f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2019 07:54:37.3273 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UAgwE3ddeqKQKIGcOszTrp1BhaKyodTOB4BeBcOQOUrOOISR6eG3fRMOgcriBa7n/DkkY+lvPqN+Y4YrOD5yR+o/o921zYKpHNaeVd8Ngwg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3260 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR11MB3834CB380CD176B405A7F0ECB59F0DM6PR11MB3834namp_" --_000_DM6PR11MB3834CB380CD176B405A7F0ECB59F0DM6PR11MB3834namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for sharing. You articulated well why I also don't think this is req= uired in MdePkg. My description of the reset vector problem was kind of incomplete. While the = x86 reset vector is fixed at the top of the address space, that does not mean that a FV has= to be mapped to it (or any SPI flash based content). SEC has made that assumption. For exampl= e, the top address space could be mapped to another random access memory with x86 ins= tructions. In this case, assumptions previously made in SecCore such as calculating t= he BFV size as follows are invalid: SecCoreData.BootFirmwareVolumeSize =3D (UINTN)(0x100000000ULL - (UINTN) = BootFirmwareVolume); In a system with NAND media, the BFV could be located in CAR at a base of = 4GB-xKB/MB with execution entry via a jump from the code at top of memory. In this particu= lar case, the FvLength field can more reliably determine the FV size. These patches use a GUIDed HOB. It just hides that detail behind a functio= n API largely added for convenience so firmware boot media consumers do not need to handle the= HOB related logic. Thanks, Michael From: afish@apple.com Sent: Wednesday, October 2, 2019 9:20 PM To: devel@edk2.groups.io; Kubacki, Michael A Cc: Chaganty, Rangasai V ; Dong, Eric ; Gao, Liming ; Ni, Ray Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 0/3] Add FW Boot Media= Device Indicator Since I was around back in the Intel Tiano days and I've worked on all the= PI specs I can share the history. The reset vector is a hardware thing. It is usually at the top or bottom o= f the address space. For x86 it is at the TOP of the ROM and that is why th= e FV has a VoluteTop file GUID that places the file at the end of the FV, t= hus the end of that file is the reset vector. If the reset vector is low th= en the FV header starts with a 16 byte ZeroVector that can contain the rese= t jump instruction. The other architecture that is out there is a mask ROM,= and the mask ROM is the reset vector, and that code hands off to the 2nd l= evel, and sometimes that can be in DRAM or ROM. The PI FVs (Firmware Volumes) are abstracted by Firmware Volume Blocks (FV= B) the FVB instances abstract the storage media for the firmware. Thus from= a PI spec point of view there is not need to define the storage type of th= e "ROM". That is just an implementation detail, that needs to be managed by= the implementation. If you think about in UEFI disk are abstracted by the Block IO protocol. W= e can boot an OS from any Block device, and the firmware does not need to k= now what kind of disk it is. The purpose of the Block IO protocol is to abs= tract all possible implementations o block devices. For the "Boot ROM", FVB= is the same kind of abstraction. So you can implement PI with out knowing = the media type. Managing the media type was is a platform abstraction, thus= there is no need for a boot media abstraction in the MdePkg. That being said the PI architecture is abstract to a fault. It was designe= d to abstract all possible future platforms. If there are a family of platf= orms that share common properties it makes sense to build a platform abstra= ction package that a set of platforms can share. This is the intent of the = PI architecture and the EDKII source base. The MdePkg implements the UEFI and PI specs, and other industry standards,= with some common libs thrown in. So the MdePkg is not the place to put som= e implementation hint about the Media Device. You could use a GUIDed HOB fo= r that if needed? Thanks, Andrew Fish On Oct 2, 2019, at 8:02 PM, Kubacki, Michael A > wrote: In platforms built for boot media other than SPI flash there has been a co= mpelling need for silicon and platform code to be aware of the firmware boot media = but apart from the UEFI variable driver (which is a special case being address= ed here - https://github.com/makubacki/edk2/tree/storage_agnostic_uefi_variab= les), this has not been the case for edk2 repository packages. In some cases, co= de in SEC has made assumptions about the reset vector or FIT pointer that do not nec= essarily translate to storage media that does not support MMIO. These cases have be= en handled more gracefully than checking the firmware boot media technology. = This is just an observation, not necessarily a case for it to stay in IntelSilicon= Pkg (which does make it accessible to Intel silicon and platform code). I suppose the firmware boot media properties could be treated in a similar= manner to Boot Mode as defined in the Platform Initialization spec. If this was d= one, it may make more sense to abstract the technology impact onto firmware, for examp= le, whether it supports MMIO or not (NOR vs NAND flash) instead of what is def= ined here with specific technologies such as eMMC and UFS. Otherwise, the speci= fication describing this would be subject to constant expansion over time keeping p= ace with new technologies and cross-generation code (not silicon or platform specif= ic drivers) may base conditionals on something like eMMC when its algorithm really app= lies to all NAND media (which, again, has been the proven observation thus far out= side silicon and platform code). With that said, I see the firmware boot technology details being more pert= inent to silicon and platform code so that's why this change is made now. It can im= mediately address existing needs for these details in silicon and platform code. So= me form of the firmware boot media details in a more generic package could be useful = but it will likely not align closely with the scope of information needed at this= level and is an undertaking, that in my opinion, is separate but compatible with the wo= rk done here. -----Original Message----- From: Chaganty, Rangasai V > Sent: Wednesday, October 2, 2019 4:03 PM To: Kubacki, Michael A >; devel@edk2.groups.io Cc: Dong, Eric >; Gao, Lim= ing >; Ni, Ray > Subject: RE: [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator I am not sure if there is a silicon scope around the FirmwareBootMediaLib. Have we considered adding this interface to MdePkg, instead? -----Original Message----- From: Kubacki, Michael A Sent: Monday, September 30, 2019 6:16 PM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V >; Dong, Eric >; Gao, Liming >; Ni, Ray > Subject: [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator This patch series introduces a mechanism for determining the firmware boot media device. This allows the firmware boot media to be discovered through a standardized API. Traditionally, most systems have only supported firmware storage on SPI flash. Presently, several other storage technologies are being used to sto= re boot system firmware such as eMMC, UFS, and NVMe. The API for all board, platform, and silicon code to consume the firmware boot media device is provided by the FirmwareBootMediaLib in IntelSiliconPkg. A driver (FirmwareBootMediaInfoPei) is added to BoardModulePkg to serve as a consistent location for reporting the firmware boot device informatio= n. In order to abstract the potentially hardware-specific details to determin= e the boot media (for platforms that support multiple firmware boot media devices), the driver retrieves the boot media information using a new libr= ary class introduced called FirmwareBootMediaInfoLib. A default instance of th= is library class is provided in BoardModulePkg that always returns SPI flash.= This is intended to serve as a default implementation of the library for the mo= st common scenario and to easily allow a board package to substitute the logi= c required to determine the boot media in more complex scenarios. Ultimately, FirmwareBootMediaInfoPei produces a HOB containing the firmware boot media device information so it can be used in the HOB consumer phase. Cc: Sai Chaganty > Cc: Eric Dong > Cc: Liming Gao > Cc: Ray Ni > Signed-off-by: Michael Kubacki > Michael Kubacki (3): IntelSiliconPkg/FirmwareBootMediaLib: Add library BoardModulePkg/FirmwareBootMediaInfoLib: Add library BoardModulePkg/FirmwareBootMediaInfoPei: Add module Platform/Intel/BoardModulePkg/BoardModulePkg.dec | 3 + Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec = | 4 +- Platform/Intel/BoardModulePkg/BoardModulePkg.dsc | 5 + Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc = | 4 +- Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe diaInfoPei.inf | 46 +++++++++ Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei FirmwareBootMediaInfoLib.inf | 35 +++++++ Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm wareBootMediaLib.inf | 43 ++++++++ Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.inf | 38 +++++++ Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLi b.h | 26 +++++ Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h | 106 +++++++++++++++++++ Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe diaInfoPei.c | 76 ++++++++++++++ Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei FirmwareBootMediaInfoLib.c | 24 +++++ Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm wareBootMediaLib.c | 107 +++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo tMediaLib.c | 109 ++++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.c | 82 +++++++++++++++ 15 files changed, 706 insertions(+), 2 deletions(-) create mode 100644 Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe diaInfoPei.inf create mode 100644 Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei FirmwareBootMediaInfoLib.inf create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm wareBootMediaLib.inf create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.inf create mode 100644 Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLi b.h create mode 100644 Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h create mode 100644 Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe diaInfoPei.c create mode 100644 Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei FirmwareBootMediaInfoLib.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm wareBootMediaLib.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo tMediaLib.c create mode 100644 Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.c -- 2.16.2.windows.1 --_000_DM6PR11MB3834CB380CD176B405A7F0ECB59F0DM6PR11MB3834namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thanks for sharing. You articulated well why I also= don’t think this is required in MdePkg. My

description of the reset vector problem was kind of= incomplete. While the x86 reset vector

is fixed at the top of the address space, that does= not mean that a FV has to be mapped to it

(or any SPI flash based content). SEC has made that= assumption. For example, the top

address space could be mapped to another random acc= ess memory with x86 instructions.

In this case, assumptions previously made in SecCor= e such as calculating the BFV size as follows are invalid:

  SecCoreData.BootFirmwareVolumeSize =3D (UINT= N)(0x100000000ULL - (UINTN) BootFirmwareVolume);

 

In a system with NAND media, the BFV could be locat= ed in CAR at a base of 4GB-xKB/MB with

execution entry via a jump from the code at top of = memory. In this particular case, the FvLength

field can more reliably determine the FV size.=

 

These patches use a GUIDed HOB. It just hides that = detail behind a function API largely added

for convenience so firmware boot media consumers do= not need to handle the HOB related logic.

 

Thanks,

Michael

 

From: af= ish@apple.com <afish@apple.com>
Sent: Wednesday, October 2, 2019 9:20 PM
To: devel@edk2.groups.io; Kubacki, Michael A <michael.a.kubacki@= intel.com>
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Don= g, Eric <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com&g= t;; Ni, Ray <ray.ni@intel.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 0/3] Add FW Boo= t Media Device Indicator

 

Since I was around back in the Intel Tiano days and= I've worked on all the PI specs I can share the history. <= /p>

 

The reset vector is a hardware thing. It is usually= at the top or bottom of the address space. For x86 it is at the TOP of the= ROM and that is why the FV has a VoluteTop file GUID that places the file = at the end of the FV, thus the end of that file is the reset vector. If the reset vector is low then the FV = header starts with a 16 byte ZeroVector that can contain the reset jump ins= truction. The other architecture that is out there is a mask ROM, and the m= ask ROM is the reset vector, and that code hands off to the 2nd level, and sometimes that can be in DRAM o= r ROM. 

 

The PI FVs (Firmware Volumes) are abstracted by Fir= mware Volume Blocks (FVB) the FVB instances abstract the storage media for = the firmware. Thus from a PI spec point of view there is not need to define= the storage type of the "ROM". That is just an implementation detail, that needs to be managed by the impleme= ntation. 

 

If you think about in UEFI disk are abstracted by t= he Block IO protocol. We can boot an OS from any Block device, and the firm= ware does not need to know what kind of disk it is. The purpose of the Bloc= k IO protocol is to abstract all possible implementations o block devices. For the "Boot ROM", FVB is the= same kind of abstraction. So you can implement PI with out knowing the med= ia type. Managing the media type was is a platform abstraction, thus there = is no need for a boot media abstraction in the MdePkg. 

 

That being said the PI architecture is abstract to = a fault. It was designed to abstract all possible future platforms. If ther= e are a family of platforms that share common properties it makes sense to = build a platform abstraction package that a set of platforms can share. This is the intent of the PI architect= ure and the EDKII source base. 

 

The MdePkg implements the UEFI and PI specs, and ot= her industry standards, with some common libs thrown in. So the MdePkg is n= ot the place to put some implementation hint about the Media Device. You co= uld use a GUIDed HOB for that if needed?

 

Thanks,

 

Andrew Fish



On Oct 2, 2019, at 8:02 PM, Kubacki, Michael A <= michael.a.kubacki@intel.com<= /a>> wrote:

 

In platforms built for boot media other than SPI = flash there has been a compelling
need for silicon and platform code to be aware of the firmware boot media = but
apart from the UEFI variable driver (which is a special case being address= ed
here - 
= https://github.com/makubacki/edk2/tree/storage_agnostic_uefi_variables),
this has not been the case for edk2 repository packages. In some cases, co= de in SEC
has made assumptions about the reset vector or FIT pointer that do not nec= essarily
translate to storage media that does not support MMIO. These cases have be= en
handled more gracefully than checking the firmware boot media technology. = This is
just an observation, not necessarily a case for it to stay in IntelSilicon= Pkg (which
does make it accessible to Intel silicon and platform code).

I suppose the firmware boot media properties could be treated in a similar= manner
to Boot Mode as defined in the Platform Initialization spec. If this was d= one, it may
make more sense to abstract the technology impact onto firmware, for examp= le,
whether it supports MMIO or not (NOR vs NAND flash) instead of what is def= ined
here with specific technologies such as eMMC and UFS. Otherwise, the speci= fication
describing this would be subject to constant expansion over time keeping p= ace with
new technologies and cross-generation code (not silicon or platform specif= ic drivers)
may base conditionals on something like eMMC when its algorithm really app= lies to
all NAND media (which, again, has been the proven observation thus far out= side
silicon and platform code).

With that said, I see the firmware boot technology details being more pert= inent to
silicon and platform code so that's why this change is made now. It can im= mediately
address existing needs for these details in silicon and platform code. &nb= sp;Some form of
the firmware boot media details in a more generic package could be useful = but it
will likely not align closely with the scope of information needed at this= level and is
an undertaking, that in my opinion, is separate but compatible with the wo= rk done here.


-----Original Mess= age-----
From: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
Sent: Wednesday, October 2, 2019 4:03 PM
To: Kubacki, Michael A <= michael.a.kubacki@intel.com>;
devel@edk2.groups.io
Cc: Dong, Eric <eric.dong@intel.= com>; Gao, Liming <liming= .gao@intel.com>;
Ni, Ray <ray.ni@intel.com> Subject: RE: [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device
Indicator

I am not sure if there is a silicon scope around the FirmwareBootMediaLib.=
Have we considered adding this interface to MdePkg, instead?

-----Original Message-----
From: Kubacki, Michael A
Sent: Monday, September 30, 2019 6:16 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Dong, Eric
<eric.dong@intel.com>; Ga= o, Liming <liming.gao@intel.com<= /a>>; Ni, Ray
<
ray.ni@intel.com>
Subject: [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device
Indicator

This patch series introduces a mechanism for determining the firmware boot=
media device. This allows the firmware boot media to be discovered through=
a standardized API.

Traditionally, most systems have only supported firmware storage on SPI flash. Presently, several other storage technologies are being used to sto= re
boot system firmware such as eMMC, UFS, and NVMe.

The API for all board, platform, and silicon code to consume the firmware<= br> boot media device is provided by the FirmwareBootMediaLib in
IntelSiliconPkg.

A driver (FirmwareBootMediaInfoPei) is added to BoardModulePkg to serve as a consistent location for reporting the firmware boot device informatio= n.
In order to abstract the potentially hardware-specific details to determin= e
the boot media (for platforms that support multiple firmware boot media devices), the driver retrieves the boot media information using a new libr= ary
class introduced called FirmwareBootMediaInfoLib. A default instance of th= is
library class is provided in BoardModulePkg that always returns SPI flash.= This
is intended to serve as a default implementation of the library for the mo= st
common scenario and to easily allow a board package to substitute the logi= c
required to determine the boot media in more complex scenarios.
Ultimately, FirmwareBootMediaInfoPei produces a HOB containing the
firmware boot media device information so it can be used in the HOB
consumer phase.

Cc: Sai Chaganty <rang= asai.v.chaganty@intel.com>
Cc: Eric Dong <eric.dong@intel.c= om>
Cc: Liming Gao <liming.gao@inte= l.com>
Cc: Ray Ni <ray.ni@intel.com>= ;
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>

Michael Kubacki (3):
 IntelSiliconPkg/FirmwareBootMediaLib: Add library
 BoardModulePkg/FirmwareBootMediaInfoLib: Add library
 BoardModulePkg/FirmwareBootMediaInfoPei: Add module

Platform/Intel/BoardModulePkg/BoardModulePkg.dec
|   3 +
Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec     =             &nb= sp;            =             &nb= sp;      |   4
+-
Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
|   5 +
Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc     =             &nb= sp;            =             &nb= sp;      |   4
+-

Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
diaInfoPei.inf           = ;       |  46 ++++&= #43;++++

Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei
FirmwareBootMediaInfoLib.inf |  35 +++++++= ;

Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm
wareBootMediaLib.inf        |  43 = ++++++++

Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.inf          &nbs= p;|  38 +++++++

Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLi
b.h            &nbs= p;            &= nbsp;|  26 +++++
Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h
| 106 +++++++++++++= 3;+++++

Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
diaInfoPei.c           &= nbsp;        |  76 ++&= #43;+++++++++++

Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei
FirmwareBootMediaInfoLib.c   |  24 +++++= ;

Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm
wareBootMediaLib.c          |= 107 ++++++++++++++= +++++

Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo tMediaLib.c           &n= bsp;    | 109 ++++++++&= #43;+++++++++++

Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.c           =   |  82 ++++++++++&#= 43;++++
15 files changed, 706 insertions(+), 2 deletions(-)  create mode = 100644
Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
diaInfoPei.inf
create mode 100644
Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei
FirmwareBootMediaInfoLib.inf
create mode 100644
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm
wareBootMediaLib.inf
create mode 100644
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.inf
create mode 100644
Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLi
b.h
create mode 100644
Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h
create mode 100644
Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
diaInfoPei.c
create mode 100644
Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/Pei
FirmwareBootMediaInfoLib.c
create mode 100644
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm
wareBootMediaLib.c
create mode 100644
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo tMediaLib.c
create mode 100644
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB ootMediaLib.c

--
2.16.2.windows.1



 

--_000_DM6PR11MB3834CB380CD176B405A7F0ECB59F0DM6PR11MB3834namp_--