From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.2963.1571106112527058869 for ; Mon, 14 Oct 2019 19:21:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZAgSvG5H; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 19:21:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,297,1566889200"; d="scan'208";a="194383280" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga008.fm.intel.com with ESMTP; 14 Oct 2019 19:21:52 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 19:21:51 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 19:21:51 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.56) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 19:21:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ok17lJKAVZPqkEfLp/PHhzsuQnNEFSwor+EP/JlZUZkY2Bly3TqSQ8Vvqf6M5lzlI8U/z9cuAIDWecFmnTLtWlyy/WY/aJohFIbsxFRoQ+t/8BOtgojngbP28pkRP6lbMMaUrLoT/T1yv3Fvufny6MU9SDlrKEHOq8PIdHR0CglFZhPHjeCSkWw9M2OgMnXYUhmv7aND7Rp93vTlcqwxzVyl3lka/YqWm2gBNLyuYpS/k38PX9ReSgucTRE16+GPXiza0pQwv7s3u62ukVGQizHwelatlev6zKuXu7tz+zNSOPVgWwtVSz5SQ0WSn7XbPrqZNbxzfaZwjh67I6g4Eg== 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=yVeWEgyIOc18Fa3lH3/DIQX35LUIvc7ByDffco+cZ6Y=; b=QQRBX5y9vxwhePpE+/zJhNvCRejs++UtAS3jBBPIzw+EqI0YPVdzs1LIZYK6GOST3AUdhlMxpYG4B/Zagx+gFe29FLPC4u4W7bWoutbPU+ESffHAvG5Ks8o5Bpa75bQMM11I1g0LbfhkVSmvmiTMTLNdNlDo4X7TC8njo2lw5GsSWV97vWpPdeW5mh+nuHUb1WcePfjNsG7wuCNSwgb9amZvYhPpJwtgIUZCWru0zMJe3VnasBrYAffJwBccej67m5raSaytp3Ve+yDVUcnzga0xtx3EG9G1QPs0z9hfWBxVnjhKwPVOwlU6KJs7HK80DdbXdLoArAhExrMmlJ+T3A== 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=yVeWEgyIOc18Fa3lH3/DIQX35LUIvc7ByDffco+cZ6Y=; b=ZAgSvG5HHC5iZECMBYCtL8aF0IecKO9ljnV6pb0EFCUI/HuKS8kJ2XFU8n+AQsInLhzGoBvl/WM2kaCC5ORlFNJufRU9uLenmlOMLUumO9ky2y7SBtPzY4lpbsRYFyST2Koe1esl44raUHPMo5AOlCmmbvdM5jzV848UeQxMI9I= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB3209.namprd11.prod.outlook.com (20.176.120.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Tue, 15 Oct 2019 02:21:35 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755%6]) with mapi id 15.20.2347.023; Tue, 15 Oct 2019 02:21:35 +0000 From: "Kubacki, Michael A" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Topic: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Index: AQHVgtYIOTkrtkYpnka2pkFh7v6JB6da6TAggAALuWA= Date: Tue, 15 Oct 2019 02:21:35 +0000 Message-ID: References: <20191014212616.18376-1-michael.a.kubacki@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C322E81@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C322E81@SHSMSX104.ccr.corp.intel.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2IwMjg2ZDUtMzExOS00ZDhlLTg2MjMtMjc0MDIwNmY0NWM2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRzNPQzJqVzJUVTFTckoxZUdzNGNJbVl2KzZzd0JcLzFnS2RaZ3hLT0Mwa2J0OEZQcTJFVktVSVl6XC9UYnBKWHZWIn0= 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: b2efcbef-d6ef-4cc4-a1de-08d751166719 x-ms-traffictypediagnostic: DM6PR11MB3209: 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:7691; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(136003)(396003)(39860400002)(376002)(346002)(189003)(199004)(13464003)(11346002)(26005)(186003)(52536014)(4326008)(55016002)(6436002)(53546011)(33656002)(478600001)(256004)(14444005)(102836004)(6506007)(110136005)(446003)(71190400001)(71200400001)(76176011)(476003)(9686003)(25786009)(14454004)(486006)(6246003)(99286004)(316002)(5660300002)(7696005)(64756008)(305945005)(6116002)(66446008)(81156014)(76116006)(3846002)(86362001)(74316002)(2501003)(8936002)(7736002)(107886003)(81166006)(2906002)(229853002)(66556008)(66476007)(8676002)(66946007)(66066001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB3209;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: 8NDMRWMMQHxFc2JXtdDdNvyaNZazdKGy9TvzQfD3jeg6+e8A1rLDZXS2fqh1w9bAxpP+92BferXsrrWEv5Etm9ya0UuNFyMnFwfhZcQmuD57HWvesRmd495Be7ok2shrYV4JIrX2uswFa3WuSpcPWiLNGG+vYXEFoHn1IzMue7kpbRXDe5DZV5/qFL6+uoIGSS4EXzE95/Wk3J9soHhNvTVZhtRG1TrZDN7qCxOLwDymZDi7wDwQDqJ72ND5PliDqmRQpsPhXI8TkDF8YDayQzexH44/DEdeSsknPN/ZsWQbF4qyN+Sl5eUPXeUtOuiVlyVW1iz3y4gnYySgJVa3DhErXm6yKgJe7g6NhF6oro8K/nM6Jb8y6b5WlQlJKyd02Vdlss67Y/MHGba9a9lpgUp7ZTU2+XZit4xzhKguRt8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b2efcbef-d6ef-4cc4-a1de-08d751166719 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 02:21:35.5748 (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: 55+0nZMTqfJ4U+hLUUmlG8gpgLfdJS+xOZmb+fPzIygaZvmp08ag/3yrR9bM30N30eviSai1hSiqJA7DU/09iLwf0IWNbOQ5z7qVahUb/74= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3209 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The two library instances work within the constraints of PEI, DXE, Runtime = DXE, and SMM. I cannot find how a single instance can support all these environments (in = as clean a manner) as is done with the two instances. Relevant constraints: * PEI: Cannot write to global variable * Runtime DXE / SMM: Boot Services are not available outside module entry p= oint Solution: * PEI instance: Always retrieve the value from a HOB (use heap for R/W). * DXE, Runtime DXE, SMM instance: Retrieve the value from the HOB in the en= try point (constructor) when the driver is dispatched and Boot Services are available= and store the value in a global variable so it can be accessed in Runtime DXE and SMM= . Two separate instances resolve these requirements quite naturally. How would you propose meeting the same level of support with one instance? Thanks, Michael > -----Original Message----- > From: Ni, Ray > Sent: Monday, October 14, 2019 6:30 PM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Chaganty, Rangasai V > Subject: RE: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: > Reduce library API >=20 > Reviewed-by: Ray Ni >=20 > Mike, > Thanks for reducing the API. >=20 > For the other comments I raised (single library instance usable for PEI a= nd > DXE), do you have any comments? >=20 >=20 > > -----Original Message----- > > From: Kubacki, Michael A > > Sent: Tuesday, October 15, 2019 5:26 AM > > To: devel@edk2.groups.io > > Cc: Chaganty, Rangasai V ; Ni, Ray > > > > Subject: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: > > Reduce library API > > > > Removes the following functions from FirmwareBootMediaLib.h: > > * FirmwareBootMediaIsSpi () > > * FirmwareBootMediaIsUfs () > > * FirmwareBootMediaIsEmmc () > > * FirmwareBootMediaIsNvme () > > > > It is preferred to have a single method to retrieve the firmware boot > media. > > To reduce overall maintenance effort over time, the > > FirmwareBootMediaIsXxx () pattern is removed in favor of returning the > > firmware boot media type via GetFirmwareBootMediaType (). > > > > Cc: Sai Chaganty > > Cc: Ray Ni > > Signed-off-by: Michael Kubacki > > --- > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm > > wareBootMediaLib.inf | 1 - > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareB > > ootMediaLib.inf | 1 - > > Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > > | 48 --------- > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBoo > > tMediaLib.c | 109 -------------------- > > 4 files changed, 159 deletions(-) > > > > diff --git > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > r > > mwareBootMediaLib.inf > > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > r > > mwareBootMediaLib.inf > > index 83ed5f04af..7e10b5f7a7 100644 > > --- > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > r > > mwareBootMediaLib.inf > > +++ > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmm > > +++ FirmwareBootMediaLib.inf > > @@ -27,7 +27,6 @@ > > # > > > > [Sources] > > - FirmwareBootMediaLib.c > > DxeSmmFirmwareBootMediaLib.c > > > > [Packages] > > diff --git > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmw > > ar > > eBootMediaLib.inf > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmw > > ar > > eBootMediaLib.inf > > index 063c4027d3..ff1da31387 100644 > > --- > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmw > > ar > > eBootMediaLib.inf > > +++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiF > > +++ ir > > +++ mwareBootMediaLib.inf > > @@ -22,7 +22,6 @@ > > LIBRARY_CLASS =3D FirmwareBootMediaLib > > > > [Sources] > > - FirmwareBootMediaLib.c > > PeiFirmwareBootMediaLib.c > > > > [Packages] > > diff --git > > a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > > b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > > index aca9593a84..b36ebacf30 100644 > > --- > > a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h > > +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaL > > +++ ib > > +++ .h > > @@ -55,52 +55,4 @@ FirmwareBootMediaIsKnown ( > > VOID > > ); > > > > -/** > > - Determines if the platform firmware is booting from SPI. > > - > > - @retval TRUE Platform firmware is booting from SPI > > - @retval FALSE Platform firmware is booting from a non-SPI devi= ce or > the > > boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsSpi ( > > - VOID > > - ); > > - > > -/** > > - Determines if the platform firmware is booting from UFS. > > - > > - @retval TRUE Platform firmware is booting from UFS > > - @retval FALSE Platform firmware is booting from a non-UFS devi= ce or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsUfs ( > > - VOID > > - ); > > - > > -/** > > - Determines if the platform firmware is booting from eMMC. > > - > > - @retval TRUE Platform firmware is booting from eMMC > > - @retval FALSE Platform firmware is booting from a non-eMMC dev= ice > or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsEmmc ( > > - VOID > > - ); > > - > > -/** > > - Determines if the platform firmware is booting from NVMe. > > - > > - @retval TRUE Platform firmware is booting from NVMe. > > - @retval FALSE Platform firmware is booting from a non-NVMe dev= ice > or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsNvme ( > > - VOID > > - ); > > - > > #endif > > diff --git > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firmware > > B > > ootMediaLib.c > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firmware > > B > > ootMediaLib.c > > deleted file mode 100644 > > index 11a14d172d..0000000000 > > --- > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firmware > > B > > ootMediaLib.c > > +++ /dev/null > > @@ -1,109 +0,0 @@ > > -/** @file > > - This library identifies the firmware boot media device. > > - > > - The firmware boot media device is used to make system > > initialization decisions in the boot flow dependent > > - upon firmware boot media. Note that the firmware boot media is the > > storage media that the boot firmware is stored on. > > - It is not the OS storage media which may be stored upon a different > > non- volatile storage device. > > - > > - This file contains library implementation common to all boot phases. > > - > > -Copyright (c) 2019, Intel Corporation. All rights reserved.
> > -SPDX-License-Identifier: BSD-2-Clause-Patent > > - > > -**/ > > - > > -#include > > -#include > > -#include > > - > > -/** > > - Determines if the platform firmware is booting from SPI. > > - > > - @retval TRUE Platform firmware is booting from SPI > > - @retval FALSE Platform firmware is booting from a non-SPI devi= ce or > the > > boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsSpi ( > > - VOID > > - ) > > -{ > > - EFI_STATUS Status; > > - FW_BOOT_MEDIA_TYPE BootMedia; > > - > > - Status =3D GetFirmwareBootMediaType (&BootMedia); > > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaSpi) { > > - return FALSE; > > - } else { > > - return TRUE; > > - } > > -} > > - > > -/** > > - Determines if the platform firmware is booting from UFS. > > - > > - @retval TRUE Platform firmware is booting from UFS > > - @retval FALSE Platform firmware is booting from a non-UFS devi= ce or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsUfs ( > > - VOID > > - ) > > -{ > > - EFI_STATUS Status; > > - FW_BOOT_MEDIA_TYPE BootMedia; > > - > > - Status =3D GetFirmwareBootMediaType (&BootMedia); > > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaUfs) { > > - return FALSE; > > - } else { > > - return TRUE; > > - } > > -} > > - > > -/** > > - Determines if the platform firmware is booting from eMMC. > > - > > - @retval TRUE Platform firmware is booting from eMMC > > - @retval FALSE Platform firmware is booting from a non-eMMC dev= ice > or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsEmmc ( > > - VOID > > - ) > > -{ > > - EFI_STATUS Status; > > - FW_BOOT_MEDIA_TYPE BootMedia; > > - > > - Status =3D GetFirmwareBootMediaType (&BootMedia); > > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaEmmc) { > > - return FALSE; > > - } else { > > - return TRUE; > > - } > > -} > > - > > -/** > > - Determines if the platform firmware is booting from NVMe. > > - > > - @retval TRUE Platform firmware is booting from NVMe. > > - @retval FALSE Platform firmware is booting from a non-NVMe dev= ice > or > > the boot media is unknown > > -**/ > > -BOOLEAN > > -EFIAPI > > -FirmwareBootMediaIsNvme ( > > - VOID > > - ) > > -{ > > - EFI_STATUS Status; > > - FW_BOOT_MEDIA_TYPE BootMedia; > > - > > - Status =3D GetFirmwareBootMediaType (&BootMedia); > > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaNvme) { > > - return FALSE; > > - } else { > > - return TRUE; > > - } > > -} > > -- > > 2.16.2.windows.1 >=20