From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on072a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::72a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40C991A1DEB for ; Tue, 11 Oct 2016 02:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VIcLSQiKWGmH0ovSS0Huk2KR4CEvOWOSMmioeE8UZW4=; b=J3gpBi0MZjQE6EATWapj34Ay0BNWYlDXR/FI8RvhYTyZXlBf7vBClvTHc4QvXLgNCWFfHGrJjU6X4GHJAUdBlCCNg4N/MXhQn3xAxubZNwXsl8fwvSiqe//8NMxDge/FoUEJUVqf0fAYAZo4Aau0Bm1EPXGlWcjfhrU2TDhoHB8= Received: from BY1PR03MB1355.namprd03.prod.outlook.com (10.162.109.25) by BY1PR03MB1355.namprd03.prod.outlook.com (10.162.109.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Tue, 11 Oct 2016 09:32:42 +0000 Received: from BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) by BY1PR03MB1355.namprd03.prod.outlook.com ([10.162.109.25]) with mapi id 15.01.0659.018; Tue, 11 Oct 2016 09:32:42 +0000 From: Sean Brogan To: Jiewen Yao , "edk2-devel@lists.01.org" CC: Michael D Kinney , Feng Tian , Chao Zhang , Liming Gao , Star Zeng Thread-Topic: [edk2] [PATCH V2 06/50] MdeModulePkg/CapsuleLib: Add ProcessCapsules() API. Thread-Index: AQHSGxVaEdExuEN6skmAhn/B2xszJqCjDXGA Date: Tue, 11 Oct 2016 09:32:42 +0000 Message-ID: References: <1475238128-22448-1-git-send-email-jiewen.yao@intel.com> <1475238128-22448-7-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1475238128-22448-7-git-send-email-jiewen.yao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sean.brogan@microsoft.com; x-originating-ip: [50.46.222.147] x-ms-office365-filtering-correlation-id: 0ac26895-eea4-4187-6aa9-08d3f1b98d14 x-microsoft-exchange-diagnostics: 1; BY1PR03MB1355; 7:dO6KiV4sWkb/vTWLXjYhBgXcUBz7U5jsOF8ke6mo8rXXuxpMiM4DFtQodovpp2zqTSjoID/6BiGavYPz5qk4ii55uX4u9WY38CvqZGhoaJihz3FMHrdHYPeVOJbxi5XncCKmRQMNKfZCzN9kR2f3VhDNsJLP2BWiJ1nBfUK3Mi0Y1rae4Dqbf2R3bP3+b45/Q5X6dNL45H3U0d6F1077aXCesYTtEgLMgRSCuY6QQUWibsbcVRVPp8k7pyKYUrBLqGh1x8SN6cuzaOWqzAaNnJjqf1E4//8V8mlX0ehy/f39j55+32aiL63Q0zKzGDI54d+F4/PTXsiM5xhNh+n6uz6XPdY/1g53cVMyFQJm3fWDVcov0xtoKiY47bjYUziE x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1355; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038); SRVR:BY1PR03MB1355; BCL:0; PCL:0; RULEID:; SRVR:BY1PR03MB1355; x-forefront-prvs: 00922518D8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(13464003)(377454003)(189002)(54356999)(3660700001)(50986999)(106356001)(8990500004)(68736007)(9686002)(8936002)(33656002)(2906002)(189998001)(4326007)(86362001)(11100500001)(575784001)(66066001)(19580395003)(3280700002)(5005710100001)(106116001)(6116002)(3846002)(102836003)(19580405001)(105586002)(10090500001)(81166006)(99286002)(76176999)(81156014)(10290500002)(10400500002)(101416001)(8676002)(86612001)(586003)(92566002)(122556002)(2900100001)(15975445007)(77096005)(5002640100001)(2501003)(76576001)(2950100002)(97736004)(7846002)(87936001)(74316002)(5001770100001)(7696004)(305945005)(7736002)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR03MB1355; H:BY1PR03MB1355.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2016 09:32:42.5319 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1355 Subject: Re: [PATCH V2 06/50] MdeModulePkg/CapsuleLib: Add ProcessCapsules() API. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 09:32:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Comment about calling ProcessCapsules twice will break in some scenarios. = For example windows capsule update will stage multiple capsules at once. I= f it mixes capsules from both stages and you use memory to preserve capsule= contents you will lose your non system capsule because of the reboot. =20 2nd - For capsules that are not FMP or update capsules but capsules being r= equested to be put in the system table you will still need to process them = even though the boot mode should not be BOOT_ON_FLASH_UPDATE. =20 Thanks Sean > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Jiewen Yao > Sent: Friday, September 30, 2016 5:21 AM > To: edk2-devel@lists.01.org > Cc: Michael D Kinney ; Feng Tian > ; Chao Zhang ; Liming Gao > ; Star Zeng > Subject: [edk2] [PATCH V2 06/50] MdeModulePkg/CapsuleLib: Add > ProcessCapsules() API. >=20 > ProcessCapsules() API can be used by platform BDS to process all capsules= . >=20 > Cc: Feng Tian > Cc: Star Zeng > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Chao Zhang > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > Reviewed-by: Liming Gao > --- > MdeModulePkg/Include/Library/CapsuleLib.h | 45 ++++++++++++++++++-- > 1 file changed, 42 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Include/Library/CapsuleLib.h > b/MdeModulePkg/Include/Library/CapsuleLib.h > index 487cb0f..659c077 100644 > --- a/MdeModulePkg/Include/Library/CapsuleLib.h > +++ b/MdeModulePkg/Include/Library/CapsuleLib.h > @@ -2,7 +2,7 @@ >=20 > This library class defines a set of interfaces for how to process caps= ule image > updates. >=20 > -Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made availa= ble > under the terms and conditions of the BSD License that accompanies this > distribution. > The full text of the license may be found at @@ -20,7 +20,9 @@ WITHOUT > WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR > IMPLIED. > The firmware checks whether the capsule image is supported > by the CapsuleGuid in CapsuleHeader or if there is other specific info= rmation > in > the capsule image. > - > + > + Caution: This function may receive untrusted input. > + > @param CapsuleHeader Pointer to the UEFI capsule image to be check= ed. >=20 > @retval EFI_SUCESS Input capsule is supported by firmware. > @@ -35,7 +37,9 @@ SupportCapsuleImage ( > /** > The firmware-specific implementation processes the capsule image > if it recognized the format of this capsule image. > - > + > + Caution: This function may receive untrusted input. > + > @param CapsuleHeader Pointer to the UEFI capsule image to be proce= ssed. >=20 > @retval EFI_SUCESS Capsule Image processed successfully. > @@ -47,4 +51,39 @@ ProcessCapsuleImage ( > IN EFI_CAPSULE_HEADER *CapsuleHeader > ); >=20 > +/** > + > + This routine is called to process capsules. > + > + Caution: This function may receive untrusted input. > + > + If the current boot mode is NOT BOOT_ON_FLASH_UPDATE, this routine doe= s > nothing. > + If the current boot mode is BOOT_ON_FLASH_UPDATE, the capsules > + reported in EFI_HOB_UEFI_CAPSULE are processed. If there is no > + EFI_HOB_UEFI_CAPSULE, this routine does nothing. > + > + This routine should be called twice in BDS. > + 1) The first call must be before EndOfDxe. The system capsules is proc= essed. > + If device capsule FMP protocols are exposted at this time, the devi= ce > + capsules are processed. > + Each individual capsule result is recorded in capsule record variab= le. > + System may reset in this function, if reset is required by capsule. > + > + 2) The second call must be after EndOfDxe and after ConnectAll, so tha= t all > + device capsule FMP protocols are exposed. > + The system capsules are skipped. If the device capsules are NOT pro= cessed > + in first call, they are processed here. > + Each individual capsule result is recorded in capsule record variab= le. > + System may reset in this function, if reset is required by capsule. > + > + @retval EFI_SUCCESS There is no error when processing caps= ules. > + @retval EFI_OUT_OF_RESOURCES No enough resource to process capsules= . > + > +**/ > +EFI_STATUS > +EFIAPI > +ProcessCapsules( > + VOID > + ); > + > #endif > -- > 2.7.4.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel