From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id E2985740049 for ; Fri, 17 May 2024 09:49:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EjSUr6Hr08c8X0eHCdb4s6ljmMkkYy4GYULzGXtOj/g=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1715939380; v=1; b=3dZsOzHGJES7BuMJ17HrtXZjLjArIwjh7OD5hbO5KDWGeYFl8O+8Mf1P3PexDryi7vy6C4d3 lLodFEShqWC4Ja7SCZmkr6iXDKne/yHFacdFRTfdtdbEdYInZQZ8JCvmZQ2kjKXpQZAiehVjuD+ GirytQTRCiXSOhi7v2XfP6TQTHFR36MFIMf9nAZD+G7klMNnXpb1CXz/PgdQMoI1wpthml2qZvC t7FGQG6GTBWkcmHCZlqqZwVfT2JuDHGOU2eMvwVBK4RXMBHkYTLj+9FxGHLnUaNABHaOw/9f/2i Ep7h4C1Vhkq5w+WFiOItauas7VzFheAoJF3BHTZWd2zPQ== X-Received: by 127.0.0.2 with SMTP id E6YcYY7687511xc6PtUpe8O9; Fri, 17 May 2024 02:49:40 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mx.groups.io with SMTP id smtpd.web10.36016.1715939370910548931 for ; Fri, 17 May 2024 02:49:34 -0700 X-CSE-ConnectionGUID: RA0InO5HSXap9ZVB3DFOEA== X-CSE-MsgGUID: voCXGFsfQkaqOG/WP684cw== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11570289" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11570289" X-Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:49:35 -0700 X-CSE-ConnectionGUID: 6ApFGsiSSMiopcHDwidarQ== X-CSE-MsgGUID: vB/PTjpWQw66Uy68Xp2BFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31739132" X-Received: from unknown (HELO shwdeopenlab702.ccr.corp.intel.com) ([10.239.55.43]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:49:33 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Liming Gao , Jiaxin Wu Subject: [edk2-devel] [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid Date: Fri, 17 May 2024 17:49:09 +0800 Message-Id: <20240517094917.513-2-dun.tan@intel.com> In-Reply-To: <20240517094917.513-1-dun.tan@intel.com> References: <20240517094917.513-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 17 May 2024 02:49:35 -0700 Resent-From: dun.tan@intel.com Reply-To: devel@edk2.groups.io,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: abPIWrSB8ikwmKXO4PbU9kxzx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=3dZsOzHG; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io This commit defines VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used to store the address and size of the buffer that will be used for variable runtime service when the PcdEnableVariableRuntimeCache is TRUE. In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei module will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate needed buffer for different type cache, unblock the buffer and build HOB. Then VariableSmmRuntimeDxe driver will consume the gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache related content. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Liming Gao Cc: Jiaxin Wu --- MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 +++ 2 files changed, 68 insertions(+) diff --git a/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h b/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h new file mode 100644 index 0000000000..c2a8b77945 --- /dev/null +++ b/MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h @@ -0,0 +1,65 @@ +/** @file + This Variable Runtime Cache Info HOB is used to store the address + and the size of the buffer that will be used for variable runtime + service when the PcdEnableVariableRuntimeCache is TRUE. + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef VARIABLE_RUNTIME_CACHE_INFO_H_ +#define VARIABLE_RUNTIME_CACHE_INFO_H_ + +#include + +#define VARIABLE_RUNTIME_CACHE_INFO_HOB_REVISION 1 + +#define VARIABLE_RUNTIME_CACHE_INFO_GUID \ + { \ + 0x0f472f7d, 0x6713, 0x4915, {0x96, 0x14, 0x5d, 0xda, 0x28, 0x40, 0x10, 0x56} \ + } + +#pragma pack(1) +typedef struct { + /// + /// TRUE indicates GetVariable () or GetNextVariable () is being called. + /// When the value is FALSE, the given update (and any other pending updates) + /// can be flushed to the runtime cache. + /// + BOOLEAN ReadLock; + /// + /// TRUE indicates there is pending update for the given variable store needed + /// to be flushed to the runtime cache. + /// + BOOLEAN PendingUpdate; + /// + /// TRUE indicates all HOB variables have been flushed in flash. + /// + BOOLEAN HobFlushComplete; +} CACHE_INFO_FLAG; + +typedef struct { + CACHE_INFO_FLAG *CacheInfoFlag; + /// + /// Buffer reserved for runtime Hob cache + /// + UINT64 RuntimeHobCacheBuffer; + UINTN RuntimeHobCachePages; + /// + /// Buffer reserved for Non-Volatile runtime cache + /// + UINT64 RuntimeNvCacheBuffer; + UINTN RuntimeNvCachePages; + /// + /// Buffer reserved for Volatile runtime cache + /// + UINT64 RuntimeVolatileCacheBuffer; + UINTN RuntimeVolatileCachePages; +} VARIABLE_RUNTIME_CACHE_INFO; +#pragma pack() + +extern EFI_GUID gEdkiiVariableRuntimeCacheInfoHobGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index f7339f0aec..1bf5e31b7c 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -465,6 +465,9 @@ gEdk2JedecSfdpSpiDxeDriverGuid = { 0xBE71701E, 0xB63C, 0x4574, { 0x9C, 0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }} gEdk2JedecSfdpSpiSmmDriverGuid = { 0x95A1E915, 0x195C, 0x477C, { 0x92, 0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }} + ## Include/Guid/VariableRuntimeCacheInfo.h + gEdkiiVariableRuntimeCacheInfoHobGuid = { 0x0f472f7d, 0x6713, 0x4915, { 0x96, 0x14, 0x5d, 0xda, 0x28, 0x40, 0x10, 0x56 }} + [Ppis] ## Include/Ppi/FirmwareVolumeShadowPpi.h gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } } -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119018): https://edk2.groups.io/g/devel/message/119018 Mute This Topic: https://groups.io/mt/106150797/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-