From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.33155.1679450803170909254 for ; Tue, 21 Mar 2023 19:06:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PlfYy4Xz; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679450803; x=1710986803; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZUuvBe4mVKdZMyBOg/BFqUqijvKXHCmNZOPr14Lb92g=; b=PlfYy4XzZ2oQ0qUnaO0OFB0e/U1wfZuMSgQ/zninCZ1vwoEfymK+hva1 dltVlo8KbtVIETdJBELw9ySBzTrE33DnRFBWN2poPfhqw/ITpuPR5swEm dXhYllMzdCbcLwwLINiw7d+RdTuz0CWwqKKFngwbWTX6Cz28IuW+d5T8G F6CeN5FfdaY3n6JxOBnijk1tJ/AaHdsF+EYlSSy9iXZv6jSyZIcoZkrNj T467pkSQ4XWio7njE+4jePmoUC6KXIF39+bwsY+57uqyMIMWLohW0vWLe YtFHqVXS2Xtf2USrq17y0w102Mh/tV+pT7+rt94ZNezuXUacvnZ3wr4uU g==; X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="401676647" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="401676647" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 19:06:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="746123986" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="746123986" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.35]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 19:06:34 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Umang Patel , Jian J Wang , Liming Gao Subject: [Patch 1/2] MdeModulePkg/Include/Ppi: Add FirmwareVolumeShadowPpi Date: Tue, 21 Mar 2023 19:06:25 -0700 Message-Id: <20230322020626.441-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.39.1.windows.1 In-Reply-To: <20230322020626.441-1-michael.d.kinney@intel.com> References: <20230322020626.441-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Umang Patel Add FirmwareVolumeShadow PPI to shadow an FV to memory. Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Patel Umang --- .../Include/Ppi/FirmwareVolumeShadowPpi.h | 61 +++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 + 2 files changed, 64 insertions(+) create mode 100644 MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h diff --git a/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h b/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h new file mode 100644 index 000000000000..a2756cb0ab1e --- /dev/null +++ b/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h @@ -0,0 +1,61 @@ +/** @file + Define PPI to shadow Firmware Volume from flash to Permanent Memory. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+ +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_ +#define PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_ + +// +// Firmware Volume Shadow PPI GUID value +// +#define EDKII_FIRMWARE_VOLUME_SHADOW_PPI_GUID \ + { \ + 0x7dfe756c, 0xed8d, 0x4d77, { 0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } \ + } + +/** + Copy FV to Destination. Length of copy is FV length from FV Header. + + @param[in] FirmwareVolumeBase Base address of FV to shadow. Length of FV + is in FV Header. + @param[in] Destination Pointer to the Buffer in system memory to + shadow FV. + @param[in] DestinationLength Size of Destination buffer in bytes. + + @retval EFI_SUCCESS Shadow complete + @retval EFI_INVALID_PARAMETER Destination is NULL + @retval EFI_INVALID_PARAMETER DestinationLength = 0. + @retval EFI_INVALID_PARAMETER FV does not have valid FV Header. + @retval EFI_INVALID_PARAMETER FV overlaps Destination. + @retval EFI_INVALID_PARAMETER Destination + DestinationLength rolls over 4GB + for 32-bit or 64-bit rollover. + @retval EFI_BUFFER_TOO_SMALL DestinationLength less than FV length from FV + Header. + @retval EFI_UNSUPPORTED FirmwareVolumeBase to FVBase + FVLength does + not support shadow. Caller should fallback to + CopyMem(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_PEI_FIRMWARE_VOLUME_SHADOW)( + IN EFI_PHYSICAL_ADDRESS FirmwareVolumeBase, + IN VOID *Destination, + IN UINTN DestinationLength + ); + +/// +/// This PPI provides a service to shadow a FV from one location to another +/// +typedef struct { + EDKII_PEI_FIRMWARE_VOLUME_SHADOW FirmwareVolumeShadow; +} EDKII_PEI_FIRMWARE_VOLUME_SHADOW_PPI; + +extern EFI_GUID gEdkiiPeiFirmwareVolumeShadowPpiGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index e8058c8bfaec..3eb4a79bf7a0 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -442,6 +442,9 @@ [Guids] gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } } [Ppis] + ## Include/Ppi/FirmwareVolumeShadowPpi.h + gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } } + ## Include/Ppi/AtaController.h gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }} -- 2.39.1.windows.1