From nobody Sun Feb 8 08:27:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+88650+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88650+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452701; cv=none; d=zohomail.com; s=zohoarc; b=WItxPdWQvi+1eoPa6VKQXeyDGeZl0pQgfltQNTz0jprg6I0BALigG2wRgPnI6u3gOBPjx2QXiZv91WQcvMqPtxfieBKdrzjmBazHs4zZM7ceERe3QM+JUfQDMEu2pi19CAjsUGvA6fTpJy9zLSIJL5C83K4c7sF/XY9g6+W8u/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452701; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SN6oS6RVEUduzWTNp9sW1FKtec1/mY+49wJxhTGnr+g=; b=Jh0kSf+RSdw0uTxWrffht27eA3p6rbnaPl9HKezZJ9lUu35ftyHJwk8ZAOckRfMEyPxKC/0Hd3YkR2NKWVNnqXrD0HneYpn9vkxm1v+puv3J6RWk6YJSFVECz+fLYW7Ip5I+duaO8DYj+YOLWecJpLmdwruT6Kt0biFJrEtB5S8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88650+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1649452701598461.47088834347153; Fri, 8 Apr 2022 14:18:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0XI8YY1788612xblxn1MTBk2; Fri, 08 Apr 2022 14:18:21 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.707.1649452700666903228 for ; Fri, 08 Apr 2022 14:18:20 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 6555B20B9CEF; Fri, 8 Apr 2022 14:18:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6555B20B9CEF From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB Date: Fri, 8 Apr 2022 17:17:26 -0400 Message-Id: <20220408211733.1332-2-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,mikuback@linux.microsoft.com X-Gm-Message-State: OgyZMRx5ELSnTYuHGV9fCOcXx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452701; bh=udSgu00Y/Yg022UgomQwySY7lSmfWIbpXafWh+lGLsQ=; h=Cc:Date:From:Reply-To:Subject:To; b=Uvj6h5Czo+InrHxLt+pi4jxt0wmttMqpjW/6glEyT3wTvB4cK+fmwv1pPkxho4mTTIE ry6a3gerP+/1WQiZcD48I/4oPfRCddVblteGabGY/rZ2sW4tSvnzL5rNIULyiESX0smz4 /wThls2YDJC0sXuawY3MwXsaIvwJVAvIYcA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452703385100003 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds a new GUID that is used to identify a HOB that passes variable flash information to UEFI variable drivers in HOB consumption phases such as DXE, Traditional MM, and Standalone MM. This information was previously passed directly with PCDs such as EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize. However, the Standalone MM variable driver instance does not have direct access to the PCD database. Therefore, this HOB will first be considered as the source for variable flash information and if platforms do not produce the HOB, reading the information from the PCDs directly will be a backup to provide backward compatibility. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 ++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 4 ++ 2 files changed, 43 insertions(+) diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/I= nclude/Guid/VariableFlashInfo.h new file mode 100644 index 000000000000..e526e362aab9 --- /dev/null +++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h @@ -0,0 +1,39 @@ +/** @file + This file defines the GUID and data structure used to pass information a= bout + a variable store mapped on flash (i.e. a MMIO firmware volume) to the DX= E and MM environment. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef VARIABLE_FLASH_INFO_H_ +#define VARIABLE_FLASH_INFO_H_ + +#define VARIABLE_FLASH_INFO_HOB_GUID \ + { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc= , 0x90 }} + +#define VARIABLE_FLASH_INFO_HOB_VERSION 1 + +extern EFI_GUID gVariableFlashInfoHobGuid; + +#pragma pack (push, 1) + +/// +/// This structure can be used to describe UEFI variable +/// flash information. +/// +typedef struct { + UINT32 Version; + EFI_PHYSICAL_ADDRESS NvStorageBaseAddress; + UINT64 NvStorageLength; + EFI_PHYSICAL_ADDRESS FtwSpareBaseAddress; + UINT64 FtwSpareLength; + EFI_PHYSICAL_ADDRESS FtwWorkingBaseAddress; + UINT64 FtwWorkingLength; +} VARIABLE_FLASH_INFO; + +#pragma pack (pop) + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -226,6 +226,10 @@ [Guids] # Include/Guid/SmmVariableCommon.h gSmmVariableWriteGuid =3D { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0= xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }} =20 + ## Guid of the variable flash information HOB. + # Include/Guid/VariableFlashInfo.h + gVariableFlashInfoHobGuid =3D { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2= , 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }} + ## Performance protocol guid that also acts as the performance HOB guid = and performance variable GUID # Include/Guid/Performance.h gPerformanceProtocolGuid =3D { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E,= 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } } --=20 2.28.0.windows.1 -=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 (#88650): https://edk2.groups.io/g/devel/message/88650 Mute This Topic: https://groups.io/mt/90345653/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-