From nobody Mon Feb 9 22:38:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59384+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59384+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1589321191; cv=none; d=zohomail.com; s=zohoarc; b=RJ33P8vLsUgkaji4FlKSngajUFhW45oX7s0X37dvczTtJg7Zsl/uErHRaHSU+eQYzix5GVxwfPE/xdSwA0sW66DIaR/E1iKSHpYevOymI4apRZv46JypdZ9/g8gGMPsoEoVEcQb8fpQ9YrLC0/jJTmiJVm3sDaHZ4W0ALb86mJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589321191; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=y5ZWSDpdXf28fCUgALH8liHQr20mxkiaW7P0ELRKq0E=; b=dscPHIA0aiCxmOVBFsmYl1Ygoou5Fds4+l8pVJfpS21ucPx6bOu+RJ1nJIBzm82LgQGlk8bYk/AVJMP6r/oTG8J3md2/cerKWBrqxRaVjtgFPQiNvxHHnfvdiquCeQhUcFbDG7EtY0PwduXJcayQ262eGeRlRn/xZhq6f6UiyC4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59384+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589321191264947.9065465228153; Tue, 12 May 2020 15:06:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Wi3CYY1788612xkMCuXApsKz; Tue, 12 May 2020 15:06:30 -0700 X-Received: from atlmailgw1.ami.com (atlmailgw1.ami.com []) by mx.groups.io with SMTP id smtpd.web12.257.1589321186492124074 for ; Tue, 12 May 2020 15:06:29 -0700 X-AuditID: ac1060b2-0f7ff700000018d4-58-5ebb1de4d971 X-Received: from atlms1.us.megatrends.com (atlms1.us.megatrends.com [172.16.96.144]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by atlmailgw1.ami.com (Symantec Messaging Gateway) with SMTP id 12.73.06356.4ED1BBE5; Tue, 12 May 2020 18:06:28 -0400 (EDT) X-Received: from Oleksiy77.us.megatrends.com (172.16.97.158) by atlms1.us.megatrends.com (172.16.96.144) with Microsoft SMTP Server id 14.3.468.0; Tue, 12 May 2020 18:05:49 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , , , , Subject: [edk2-devel] [PATCH V4 5/6] MdeModulePkg: Add FMP Capsule Image Header extension Date: Tue, 12 May 2020 18:05:42 -0400 Message-ID: <20200512220543.40008-6-oleksiyy@ami.com> In-Reply-To: <20200512220543.40008-1-oleksiyy@ami.com> References: <20200512220543.40008-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsWyRiBhgu4T2d1xBqcumVrMf1tt0T5hNpvF 1Vu/mCzmfZvBarHuo4fFinsb2C06Ov4xObB7bP9+gdFj8Z6XTAFMUQ2MNol5efkliSWpCimp xcm2SgFFmWWJyZVKCpkptkqGSgoFOYnJqbmpeSW2SokFBal5KUp2XAoYwAaoLDNPITUvOT8l My/dVskz2F/XwsLUUtdQyS4kI1UhMy8tvyg3sSQzP08hOT+vBKg6NQUoqpDQzZkx59wzpoIm pYqmT3tYGhgPyXQxcnJICJhItDx6ytjFyMUhJLCLSWLlrp9QzhZGiZ6tp5hAqtgENCUOHJvC CGKLCEhJTDkwEyzOLHCYUaLjE1hcWMBHYufTLvYuRg4OFgFViZ3PU0HCvAKmEte6rrNDLNOQ mLbmLlgrp4CZxLenp8BahYBqjjy6wQpRLyhxcuYTFojxEhIHX7xghqiRlWg7/px9AiP/LCRl s5CULWBkWsUolFiSk5uYmZNebqiXmJupl5yfu4kREn+bdjC2XDQ/xMjEwXiIUYKDWUmEtyVz Z5wQb0piZVVqUX58UWlOavEhRieg+ycyS3GDAhAYI/HGBgZSojCOoYmZibmRuaGlibmxsZI4 7+S1a+KEBNKBMZudmlqQWgQzhImDU6qBce2mz063rL9X8QcH9oQs8Lzh/alvu+7KKxZqjuEC h3W4fqhu3MvHqbjUMszSWWji4rZJLnwK6epZfdsrXhsxuUYEvmG7L/k++XqQaPMz6TOySivF 089E+Kqk9HCYpz8TjvsS/rj34TWP422+IWFfdmmoWex3yTLumLkme3bY2cqpk+91u4QpsRRn JBpqMRcVJwIAfTySjNQCAAA= Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,oleksiyy@ami.com X-Gm-Message-State: hsAF7n0feQJxnR8Of8mAWkaix1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589321190; bh=RhN/MmO7+iSyzfzJyRCex6ZHy79LTL9FUaCTqV3Bt4I=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=c5yxlwQFXTNwg1ZdQdZ+ZC3L39qdWoSKv2Fzum4y5wCoI3aB0kMFwXqbp0/VUK1piyj LhiVTHKZVUrHKpnbKjUAtUEABTs7kGVK2SYZ+Madvu2+l0m8XIWAZ5y6KaEVd+f1knEP/ fwy4nwvdeCKehnzOQ5qRwahJ6sHa+effjT4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add bitmask to structure which gives a binary-inspectable mechanism to determine if a capsule contains an authentication section or depex section. (UEFI 2.8 errata a, mantis 2026) Signed-off-by: Oleksiy Yakovlev --- MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 1 + .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 20 ++++++++++++++++= ---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModuleP= kg/Application/CapsuleApp/CapsuleDump.c index 7e3e072..e3ab199 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c @@ -98,6 +98,7 @@ DumpFmpCapsule ( Print(L" UpdateVendorCodeSize - 0x%x\n", FmpImageHeader->UpdateVend= orCodeSize); if (FmpImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE= _HEADER_INIT_VERSION) { Print(L" UpdateHardwareInstance - 0x%lx\n", FmpImageHeader->UpdateH= ardwareInstance); + Print(L" ImageCapsuleSupport - 0x%lx\n", FmpImageHeader->ImageCapsu= leSupport); } } } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeMod= ulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index 5dda561..f9819a7 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -285,8 +285,10 @@ ValidateFmpCapsule ( DEBUG((DEBUG_ERROR, "ImageHeader->Version(0x%x) Unknown\n", ImageHea= der->Version)); return EFI_INVALID_PARAMETER; } - if (ImageHeader->Version < EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADE= R_INIT_VERSION) { + if (ImageHeader->Version =3D=3D 1) { FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER, UpdateHardwareInstance); + } else { + FmpImageHeaderSize =3D OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMA= GE_HEADER, ImageCapsuleSupport); } if (FmpImageSize < FmpImageHeaderSize) { DEBUG((DEBUG_ERROR, "FmpImageSize(0x%lx) < FmpImageHeaderSize(0x%x)\= n", FmpImageSize, FmpImageHeaderSize)); @@ -521,6 +523,7 @@ DumpFmpCapsule ( DEBUG((DEBUG_VERBOSE, " UpdateVendorCodeSize - 0x%x\n", ImageHead= er->UpdateVendorCodeSize)); if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HE= ADER_INIT_VERSION) { DEBUG((DEBUG_VERBOSE, " UpdateHardwareInstance - 0x%lx\n", ImageH= eader->UpdateHardwareInstance)); + DEBUG((DEBUG_VERBOSE, " ImageCapsuleSupport - 0x%lx\n", ImageHead= er->ImageCapsuleSupport)); } } } @@ -928,9 +931,14 @@ SetFmpImageData ( } else { // // If the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER is version 1, - // Header should exclude UpdateHardwareInstance field + // Header should exclude UpdateHardwareInstance field, and + // ImageCapsuleSupport field if version is 2. // - Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_CAP= SULE_IMAGE_HEADER, UpdateHardwareInstance); + if (ImageHeader->Version =3D=3D 1) { + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_C= APSULE_IMAGE_HEADER, UpdateHardwareInstance); + } else { + Image =3D (UINT8 *)ImageHeader + OFFSET_OF(EFI_FIRMWARE_MANAGEMENT_C= APSULE_IMAGE_HEADER, ImageCapsuleSupport); + } } =20 if (ImageHeader->UpdateVendorCodeSize =3D=3D 0) { @@ -945,6 +953,7 @@ SetFmpImageData ( DEBUG((DEBUG_INFO, "ImageIndex - 0x%x ", ImageHeader->UpdateImageIndex)); if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEAD= ER_INIT_VERSION) { DEBUG((DEBUG_INFO, "(UpdateHardwareInstance - 0x%x)", ImageHeader->Upd= ateHardwareInstance)); + DEBUG((DEBUG_INFO, "(ImageCapsuleSupport - 0x%x)", ImageHeader->ImageC= apsuleSupport)); } DEBUG((DEBUG_INFO, "\n")); =20 @@ -1239,7 +1248,10 @@ ProcessFmpCapsuleImage ( ImageHeader =3D (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)((UIN= T8 *)FmpCapsuleHeader + ItemOffsetList[Index]); =20 UpdateHardwareInstance =3D 0; - if (ImageHeader->Version >=3D EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HE= ADER_INIT_VERSION) { + /// + /// UpdateHardwareInstance field was added in Version 2 + /// + if (ImageHeader->Version >=3D 2) { UpdateHardwareInstance =3D ImageHeader->UpdateHardwareInstance; } =20 --=20 2.9.0.windows.1 Please consider the environment before printing this email. The information contained in this message may be confidential and proprieta= ry to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephon= e at 770-246-8600, and then delete or destroy all copies of the transmissio= n. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59384): https://edk2.groups.io/g/devel/message/59384 Mute This Topic: https://groups.io/mt/74169596/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-