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 26849AC1304 for ; Fri, 17 May 2024 17:55:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6CNBNOCOmSASw2/ghVxsHMD5p6q9cG2VJyuflAfPy98=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels: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-Language:Content-Type; s=20240206; t=1715968512; v=1; b=nvsh6Z+4EVC/dIRdPhUsVr7Dqqy+SFzdomMpyXraYroZ0dL/yiQXLyIZEY8S3IShNBMt5F03 5+983ll740PPZqH+IO9S8K7PiW0xh970OMdYFmg95XhwtIE4VEfocDiRFAdP5pQovrYQf67U894 jmKxjMnI8NPl5wD/gOG/HjrGDRbCo/HdyWli1r0usVVOc9OGeJ0pIAD3knoMIQjYZUGgDVis7zD 9D2Y5Wzsx+vpn8tlCItZETaEyZ8aYDiay6QYlvWIwzmalMVf4WZe+7hkv3RuhZ/mCkhf769Q1YS kR0nn1UeoIXTpV0NxTPt9UsSkbXjKc5uc146MdLhpupFg== X-Received: by 127.0.0.2 with SMTP id w0rzYY7687511x1sqR7MAVAq; Fri, 17 May 2024 10:55:12 -0700 X-Received: from CH1PR05CU001.outbound.protection.outlook.com (CH1PR05CU001.outbound.protection.outlook.com [52.101.193.2]) by mx.groups.io with SMTP id smtpd.web11.1455.1715965788096201444 for ; Fri, 17 May 2024 10:09:48 -0700 X-Received: from BL1PR21MB3160.namprd21.prod.outlook.com (2603:10b6:208:394::10) by MN0PR21MB3535.namprd21.prod.outlook.com (2603:10b6:208:3d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.12; Fri, 17 May 2024 17:09:44 +0000 X-Received: from BL1PR21MB3160.namprd21.prod.outlook.com ([fe80::8526:1b46:61d7:8686]) by BL1PR21MB3160.namprd21.prod.outlook.com ([fe80::8526:1b46:61d7:8686%7]) with mapi id 15.20.7611.010; Fri, 17 May 2024 17:09:44 +0000 From: "Kun Qin via groups.io" To: "Ni, Ray" , "Tan, Dun" , "devel@edk2.groups.io" CC: Liming Gao , Sean Brogan Subject: Re: [edk2-devel] [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid Thread-Topic: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid Thread-Index: AQHaqD+4wfakm1/BA0W6naTE392Kl7GbVWhMgABO8vA= Date: Fri, 17 May 2024 17:09:44 +0000 Message-ID: References: <20240517094917.513-1-dun.tan@intel.com> <20240517094917.513-8-dun.tan@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=4639c382-fc80-450c-89c8-c107026a4b98;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-05-17T16:51:13Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR21MB3160:EE_|MN0PR21MB3535:EE_ x-ms-office365-filtering-correlation-id: f25fe7b3-9255-481f-8eb9-08dc769425f0 x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?USB4e7zb42athOr6ozmTwYz7nt076bSN1ufFWup3IS7og9TDVqFlXeF0xOcE?= =?us-ascii?Q?Rr0KNYUP2cUKSY3f1U6PvqcoqQQ0afte2pj58qo69uuuSYMwyhpdA3ECud2v?= =?us-ascii?Q?UOntb9BelZOuOukIShMDLFCNUDLsB/6UbOybqxLdJ5AhAJdnj/AQAU8YRkxi?= =?us-ascii?Q?cvVhdIEuI/DPLtEU82QTxPEvFSvcicV1HKei2LZqmtzPfbtm/AAZCYJUl4Rm?= =?us-ascii?Q?BKlCT+EQmJWMwVOIaQ5JlhgBCt3plqrMnmI1u3T0IhqC+8EV9QELO/smlMDw?= =?us-ascii?Q?jyIZEiO3pJRH1ANMDiVIChoJPVkxdvlYzk8C+hGYab9Z1NFRb3HLTsX6Cpxq?= =?us-ascii?Q?h1EjRl2SVxg/0rlsuKixnjOHQCJ+7yNZzMsFi9WOuj8WKKpcmgpknmxsZmtA?= =?us-ascii?Q?ReunNt2eqWs7ldC3x+4SnlslnA7qgrfNm1ueLMlZheyyEyVf0R3bJ5lZnwiS?= =?us-ascii?Q?sYD3rYXEbzfMlNfM1KYIniuEVdJP5w5DJF0CAXLqFKKdxORjK+C7HDLAm5Q1?= =?us-ascii?Q?Uy5Jfk8AxW6g1G8/YbBEJD6GybKqohLvdbMPV2ZICstQf3+WhiRTO/j7VAac?= =?us-ascii?Q?8js95EfUnTWzt7bMHwTQe3esGshfjoYREX+nT4UWfsZUxS2Tt+2YOxNxueec?= =?us-ascii?Q?Q0bAmC6FXwHoN3N6cpu4dMQ/63wExtdKq7W+MvW/DP2JsrbiGMcqsji4J3hZ?= =?us-ascii?Q?tibu2z7aTSAShdA4Xe/+TibVAKdEC7VuiBP6Z8kPMAeDEozCkIfhWxu5g/j3?= =?us-ascii?Q?YgMV69Iz4MZGDmJ46fLcZGOxo4gM5dL9CJsa8gBBXg51NhVSE7fAqUq42Yg8?= =?us-ascii?Q?nIfi/RRDQDnlK3bhtnMy3KbmOSm8tlZmIfqy57s7Q83eHAG8+nN7SM6y2zyd?= =?us-ascii?Q?NwMd2fKl7azkeaLggDG7hXi/tHIY9TTdteJNeImNCkaEjMbuTY1aZwPT5iY/?= =?us-ascii?Q?ivQbMPCCcvyhR8YkNoNTeVTEoFoLQIcrzSgqmBFIygsHNp5GJG5fWMzZmlry?= =?us-ascii?Q?PTlpezbSdkMdEwqy2rCg/Qkywq1nDb7+EMNcoQNq/w7v//dn9FeQhxfEQfwm?= =?us-ascii?Q?dgg0Y0eCQBkmL23hfej2pIZErYDfTLXsARbI4DvmnBUE+p8WVAleUiw2GRx6?= =?us-ascii?Q?KklPu6Xb0pHncUJBJK+FXYs2PvaRa9vG48/0TjcrRV/QFsErxM7U23I3AIDo?= =?us-ascii?Q?Ydu+siDBM1fW/JojA0BpyoC+Q4SEpxRhfwuH48DN4RJzbGnL9iH5RqANauzZ?= =?us-ascii?Q?GRruYwwi3HakCfY94Wa6vy/PCvZK+UI3znm1HSbRRA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WJm5GgzUFc3cQZs6LkeA7VUo66YriSNSy14XxvCrnbx0R8in0wi7Ja5j8btI?= =?us-ascii?Q?xH1cvNhIAIAIYs1ICcn/ZyyUEBKbtNN5M7Qhh2pjeSi9c6X7WT/lXxsIFEO+?= =?us-ascii?Q?N9Ztx7OncLIxRtoTFX97Z3CGQOILxnJKYWWUHHWd/8ANqigS7BhXw4I5papM?= =?us-ascii?Q?rIUazpjf5ZchpdHFK+WNyFF0PpAmIaOdJ4K6mJibq79BoefzKZjrOc3k7Liv?= =?us-ascii?Q?taDVQ2fmukcdVQiyLvB7WUN49LBeL9KmE8tBWPeeksBjQBoH6tzjqsHSn6FP?= =?us-ascii?Q?/iXmmlFKBXUOED/6lTf6hcx8f7WXm0QJwik146doRZlvQn7vp5rXLNjh2PzY?= =?us-ascii?Q?ujjgy3NcBzgpEKdXWjCDndkVRzVGp9ccpr8Ejh8YKumYM3Oqao2bTK2ObHJw?= =?us-ascii?Q?KFUTswinZZnsKH6g8VDgqRe7CjzPtLGaX9hD5KxtUyriTDcv/h3ZzQBLeipu?= =?us-ascii?Q?pF5ycSA3p4pvB6X8eEr/lLxxzvhVF3+BGV7UDZMPclNNvp7ofFREYK3Bg95O?= =?us-ascii?Q?qXvqUPUjhE5/oo5iB/yKUM9MxYjchwuwN3whRCRD2RZMWGyeF/a59buY0wbT?= =?us-ascii?Q?PSsD5aD+SS1MVcfCv6Sv88CYmmi3orNrHDLSWywnlPfjD2GVHz+lUW58KCMn?= =?us-ascii?Q?ZjHpJZozpHMLGtL5tqrgYaRWLlDZVv9gu3HsmZs/4T/MCXGR4telsOPJI+i9?= =?us-ascii?Q?cT3nQVbYfnin/JzA4NDTiyPy4LOfg9T06vNlYCa1TsAGqAil+6RbW98vbBzC?= =?us-ascii?Q?ERi0TfX5OjJVDDddb7vEGq9jO381diQeusvtg7gcQxv60qnr1EsDipHvDJQh?= =?us-ascii?Q?5mw8ut8ddnuDFGhiQVx5A0T8Udk2nhgF8YibDdTI0LbBlGDHRPx58oKIIjUi?= =?us-ascii?Q?kKIeI5Rlc8ztV0yaJYpJKI22nmvdd7D5FlhlcquTyYfoEhnBODeBhw9NnzG6?= =?us-ascii?Q?kn+FTwKkuPTCx3zf9e5Jo93l4Vb6FkqjG0Syak34zlezfPbBWFzV5M+7+zRU?= =?us-ascii?Q?eTe5g0aLxJlg5yUR77SGeAdr9wYwRx2Rf3o65NXJBI59xrBPZzPzwxsNpsKt?= =?us-ascii?Q?e6sWn2azC1/DymdoAGlKZ58uNPOnJv547+swrwoZgynW69ReRqrqsBI6i900?= =?us-ascii?Q?GwW7rpLqCFJVl6GtLnB/JtdOV5d9Sb3cnJp78jApRwYEhOhnDtWNn3whNotA?= =?us-ascii?Q?6z1f3r2+5VJz3FCEU5r2ye40SRMBg8PxVnH6Ga3uLLbz8J4Z+s2R7yxCTKm+?= =?us-ascii?Q?AAHGKm2/Of9Tn2Ej5pLXd2T91ltgDw8RpzpUXnID1uft9gGiUQv/lWTJOLsM?= =?us-ascii?Q?7xfzJ+XnmAhSh9Dp+C0VNpDMRBb3zglvVVEzb+E0h2QHkRYBUjhd4uEgottk?= =?us-ascii?Q?pXtidVfZv5rnclByMR0t7j3trrTIlXJH0zVTqzyTDupfK1NQgs69/4jG5s+H?= =?us-ascii?Q?L24afHw1zTbM4aFGxPafZTQWqr93sOkbeejwDY5lgl9nXZgv8l+oJCyIg1d6?= =?us-ascii?Q?Y7rFlSWzbhyqyzJYezlar+BUGhNBmg7pmL2+kcBDRegXt1EeHN2QHIoa7MS9?= =?us-ascii?Q?gB14apAxwD7ktzdtGV/j9v8TmdGmsMRwD0bDHN/LpaKxC7bOvuwhy45Za5TJ?= =?us-ascii?Q?3r49BRbuQ7NS+sXgNGVoGlE=3D?= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR21MB3160.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f25fe7b3-9255-481f-8eb9-08dc769425f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2024 17:09:44.3211 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BqO3YZKsNLBr9S1GAzJZPaqwCU/IcZpSdPbrbZuTcsc6ghwxPIgYYQQ5YuIyDVj+QFMsHKmNh1IN62PVMkFmTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR21MB3535 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 10:55:06 -0700 Resent-From: Kun.Qin@microsoft.com Reply-To: devel@edk2.groups.io,Kun.Qin@microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4uQa5jq5D6GtZxYIFtduUT3cx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BL1PR21MB3160DE3E7B610CC514EFCB05E9EE2BL1PR21MB3160namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=nvsh6Z+4; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_BL1PR21MB3160DE3E7B610CC514EFCB05E9EE2BL1PR21MB3160namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray & Dun, Thanks for adding me to the patch. I think the proposed solution should wor= k. One question, which is actually on the hob creator patch (https://edk2.g= roups.io/g/devel/message/119022), is that I understand the hob creation dep= ends on "gEfiPeiMemoryDiscoveredPpiGuid", but does this routine still run p= roperly if variable PEIM is loaded much later than memory discovered? Regards, Kun From: Ni, Ray Sent: Friday, May 17, 2024 5:10 AM To: Tan, Dun ; devel@edk2.groups.io Cc: Liming Gao ; Kun Qin ;= Sean Brogan Subject: [EXTERNAL] Re: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRunt= imeCacheInfoHobGuid Reviewed-by: Ray Ni > Thanks, Ray ________________________________ From: Tan, Dun > Sent: Friday, May 17, 2024 17:49 To: devel@edk2.groups.io > Cc: Ni, Ray >; Liming Gao > Subject: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHob= Guid Consume gEdkiiVariableRuntimeCacheInfoHobGuid in VariableSmmRuntimeDxe driver to initialize the following variable cache related buffer: *mVariableRuntimeHobCacheBuffer *mVariableRuntimeNvCacheBuffer *mVariableRuntimeVolatileCacheBuffer *mVariableRuntimeCachePendingUpdate *mVariableRuntimeCacheReadLock *mHobFlushComplete The code to to allocate and unblock the buffer for different type cache in VariableSmmRuntimeDxe is also removed in this commit. Signed-off-by: Dun Tan > Cc: Ray Ni > Cc: Liming Gao > Cc: Jiaxin Wu > --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 120= +++++++++++++++++++++++++++++++++++++++++++++++++-------------------------= ---------------------------------------------- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf | 5= +++-- 2 files changed, 52 insertions(+), 73 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeD= xe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 8b42ae7d72..68a249c5ac 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -35,10 +35,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include +#include #include #include +#include #include "PrivilegePolymorphic.h" #include "VariableParsing.h" @@ -56,10 +57,10 @@ VARIABLE_STORE_HEADER *mVariableRuntimeVolati= leCacheBuffer =3D NULL; UINTN mVariableBufferSize; UINTN mVariableRuntimeHobCacheBufferSize; UINTN mVariableBufferPayloadSize; -BOOLEAN mVariableRuntimeCachePendingUpdate; -BOOLEAN mVariableRuntimeCacheReadLock; +BOOLEAN *mVariableRuntimeCachePendingUpdate; +BOOLEAN *mVariableRuntimeCacheReadLock; BOOLEAN mVariableAuthFormat; -BOOLEAN mHobFlushComplete; +BOOLEAN *mHobFlushComplete; EFI_LOCK mVariableServicesLock; EDKII_VARIABLE_LOCK_PROTOCOL mVariableLock; EDKII_VAR_CHECK_PROTOCOL mVarCheck; @@ -180,27 +181,6 @@ InitVariableCache ( *TotalVariableCacheSize =3D ALIGN_VALUE (*TotalVariableCacheSize, sizeof= (UINT32)); - // - // Allocate NV Storage Cache and initialize it to all 1's (like an erase= d FV) - // - *VariableCacheBuffer =3D (VARIABLE_STORE_HEADER *)AllocateRuntimePages = ( - EFI_SIZE_TO_PAGES (*T= otalVariableCacheSize) - ); - if (*VariableCacheBuffer =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - // - // Request to unblock the newly allocated cache region to be accessible = from inside MM - // - Status =3D MmUnblockMemoryRequest ( - (EFI_PHYSICAL_ADDRESS)(UINTN)*VariableCacheBuffer, - EFI_SIZE_TO_PAGES (*TotalVariableCacheSize) - ); - if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) { - return Status; - } - VariableCacheStorePtr =3D *VariableCacheBuffer; SetMem32 ((VOID *)VariableCacheStorePtr, *TotalVariableCacheSize, (UINT3= 2)0xFFFFFFFF); @@ -568,16 +548,16 @@ CheckForRuntimeCacheSync ( VOID ) { - if (mVariableRuntimeCachePendingUpdate) { + if (*mVariableRuntimeCachePendingUpdate) { SyncRuntimeCache (); } - ASSERT (!mVariableRuntimeCachePendingUpdate); + ASSERT (!(*mVariableRuntimeCachePendingUpdate)); // // The HOB variable data may have finished being flushed in the runtime = cache sync update // - if (mHobFlushComplete && (mVariableRuntimeHobCacheBuffer !=3D NULL)) { + if ((*mHobFlushComplete) && (mVariableRuntimeHobCacheBuffer !=3D NULL)) = { if (!EfiAtRuntime ()) { FreePages (mVariableRuntimeHobCacheBuffer, EFI_SIZE_TO_PAGES (mVaria= bleRuntimeHobCacheBufferSize)); } @@ -633,12 +613,12 @@ FindVariableInRuntimeCache ( // a GetVariable () or GetNextVariable () call from being issued until a= prior call has returned. The runtime // cache read lock should always be free when entering this function. // - ASSERT (!mVariableRuntimeCacheReadLock); + ASSERT (!(*mVariableRuntimeCacheReadLock)); - mVariableRuntimeCacheReadLock =3D TRUE; + *mVariableRuntimeCacheReadLock =3D TRUE; CheckForRuntimeCacheSync (); - if (!mVariableRuntimeCachePendingUpdate) { + if (!(*mVariableRuntimeCachePendingUpdate)) { // // 0: Volatile, 1: HOB, 2: Non-Volatile. // The index and attributes mapping must be kept in this order as Find= Variable @@ -698,7 +678,7 @@ Done: } } - mVariableRuntimeCacheReadLock =3D FALSE; + *mVariableRuntimeCacheReadLock =3D FALSE; return Status; } @@ -921,12 +901,12 @@ GetNextVariableNameInRuntimeCache ( // a GetVariable () or GetNextVariable () call from being issued until a= prior call has returned. The runtime // cache read lock should always be free when entering this function. // - ASSERT (!mVariableRuntimeCacheReadLock); + ASSERT (!(*mVariableRuntimeCacheReadLock)); CheckForRuntimeCacheSync (); - mVariableRuntimeCacheReadLock =3D TRUE; - if (!mVariableRuntimeCachePendingUpdate) { + *mVariableRuntimeCacheReadLock =3D TRUE; + if (!(*mVariableRuntimeCachePendingUpdate)) { // // 0: Volatile, 1: HOB, 2: Non-Volatile. // The index and attributes mapping must be kept in this order as Find= Variable @@ -958,7 +938,7 @@ GetNextVariableNameInRuntimeCache ( } } - mVariableRuntimeCacheReadLock =3D FALSE; + *mVariableRuntimeCacheReadLock =3D FALSE; return Status; } @@ -1622,37 +1602,9 @@ SendRuntimeVariableCacheContextToSmm ( SmmRuntimeVarCacheContext->RuntimeHobCache =3D mVariableRuntimeHobC= acheBuffer; SmmRuntimeVarCacheContext->RuntimeVolatileCache =3D mVariableRuntimeVola= tileCacheBuffer; SmmRuntimeVarCacheContext->RuntimeNvCache =3D mVariableRuntimeNvCa= cheBuffer; - SmmRuntimeVarCacheContext->PendingUpdate =3D &mVariableRuntimeCac= hePendingUpdate; - SmmRuntimeVarCacheContext->ReadLock =3D &mVariableRuntimeCac= heReadLock; - SmmRuntimeVarCacheContext->HobFlushComplete =3D &mHobFlushComplete; - - // - // Request to unblock this region to be accessible from inside MM enviro= nment - // These fields "should" be all on the same page, but just to be on the = safe side... - // - Status =3D MmUnblockMemoryRequest ( - (EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheC= ontext->PendingUpdate - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE), - EFI_SIZE_TO_PAGES (sizeof (mVariableRuntimeCachePendingUpdate= )) - ); - if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) { - goto Done; - } - - Status =3D MmUnblockMemoryRequest ( - (EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheC= ontext->ReadLock - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE), - EFI_SIZE_TO_PAGES (sizeof (mVariableRuntimeCacheReadLock)) - ); - if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) { - goto Done; - } - - Status =3D MmUnblockMemoryRequest ( - (EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheC= ontext->HobFlushComplete - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE), - EFI_SIZE_TO_PAGES (sizeof (mHobFlushComplete)) - ); - if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) { - goto Done; - } + SmmRuntimeVarCacheContext->PendingUpdate =3D mVariableRuntimeCach= ePendingUpdate; + SmmRuntimeVarCacheContext->ReadLock =3D mVariableRuntimeCach= eReadLock; + SmmRuntimeVarCacheContext->HobFlushComplete =3D mHobFlushComplete; // // Send data to SMM. @@ -1688,9 +1640,14 @@ SmmVariableReady ( IN VOID *Context ) { - EFI_STATUS Status; - UINTN RuntimeNvCacheSize; - UINTN RuntimeVolatileCacheSize; + EFI_STATUS Status; + UINTN RuntimeNvCacheSize; + UINTN RuntimeVolatileCacheSize; + UINTN AllocatedHobCacheSize; + UINTN AllocatedNvCacheSize; + UINTN AllocatedVolatileCacheSize; + EFI_HOB_GUID_TYPE *GuidHob; + VARIABLE_RUNTIME_CACHE_INFO *VariableRuntimeCacheHob; Status =3D gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOI= D **)&mSmmVariable); if (EFI_ERROR (Status)) { @@ -1717,7 +1674,7 @@ SmmVariableReady ( if (FeaturePcdGet (PcdEnableVariableRuntimeCache)) { DEBUG ((DEBUG_INFO, "Variable driver runtime cache is enabled.\n")); // - // Allocate runtime variable cache memory buffers. + // Get needed runtime cache buffer size and check if auth variables ar= e to be used from SMM // Status =3D GetRuntimeCacheInfo ( &mVariableRuntimeHobCacheBufferSize, @@ -1726,6 +1683,27 @@ SmmVariableReady ( &mVariableAuthFormat ); if (!EFI_ERROR (Status)) { + GuidHob =3D GetFirstGuidHob (&gEdkiiVariableRuntimeCacheInfoHobGuid)= ; + ASSERT (GuidHob !=3D NULL); + VariableRuntimeCacheHob =3D GET_GUID_HOB_DATA (GuidHob); + AllocatedHobCacheSize =3D EFI_PAGES_TO_SIZE (VariableRuntimeCac= heHob->RuntimeHobCachePages); + AllocatedNvCacheSize =3D EFI_PAGES_TO_SIZE (VariableRuntimeCac= heHob->RuntimeNvCachePages); + AllocatedVolatileCacheSize =3D EFI_PAGES_TO_SIZE (VariableRuntimeCac= heHob->RuntimeVolatileCachePages); + + ASSERT ( + (AllocatedHobCacheSize >=3D mVariableRuntimeHobCacheBufferSize) && + (AllocatedNvCacheSize >=3D RuntimeNvCacheSize) && + (AllocatedVolatileCacheSize >=3D RuntimeVolatileCacheSize) + ); + + mVariableRuntimeHobCacheBuffer =3D (VARIABLE_STORE_HEADER *)(UI= NTN)VariableRuntimeCacheHob->RuntimeHobCacheBuffer; + mVariableRuntimeNvCacheBuffer =3D (VARIABLE_STORE_HEADER *)(UI= NTN)VariableRuntimeCacheHob->RuntimeNvCacheBuffer; + mVariableRuntimeVolatileCacheBuffer =3D (VARIABLE_STORE_HEADER *)(UI= NTN)VariableRuntimeCacheHob->RuntimeVolatileCacheBuffer; + mVariableRuntimeCachePendingUpdate =3D &VariableRuntimeCacheHob->Ca= cheInfoFlag->PendingUpdate; + mVariableRuntimeCacheReadLock =3D &VariableRuntimeCacheHob->Ca= cheInfoFlag->ReadLock; + mHobFlushComplete =3D &VariableRuntimeCacheHob->Ca= cheInfoFlag->HobFlushComplete; + mVariableRuntimeHobCacheBufferSize =3D AllocatedHobCacheSize; + Status =3D InitVariableCache (&mVariableRuntimeHobCacheBuffer, &mVar= iableRuntimeHobCacheBufferSize); if (!EFI_ERROR (Status)) { Status =3D InitVariableCache (&mVariableRuntimeNvCacheBuffer, &Run= timeNvCacheSize); diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeD= xe.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.i= nf index e1085653fe..2d16f28674 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf @@ -13,7 +13,7 @@ # may not be modified without authorization. If platform fails to protect= these resources, # the authentication service provided in this driver will be broken, and = the behavior is undefined. # -# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -60,7 +60,7 @@ TpmMeasurementLib SafeIntLib PcdLib - MmUnblockMemoryLib + HobLib [Protocols] gEfiVariableWriteArchProtocolGuid ## PRODUCES @@ -113,6 +113,7 @@ gVarCheckPolicyLibMmiHandlerGuid gEfiEndOfDxeEventGroupGuid gEfiDeviceSignatureDatabaseGuid + gEdkiiVariableRuntimeCacheInfoHobGuid [Depex] gEfiMmCommunication2ProtocolGuid -- 2.31.1.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 (#119055): https://edk2.groups.io/g/devel/message/119055 Mute This Topic: https://groups.io/mt/106150805/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_BL1PR21MB3160DE3E7B610CC514EFCB05E9EE2BL1PR21MB3160namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Ray & Dun,

 

Thanks for adding me to the patch. I think the prop= osed solution should work. One question, which is actually on the hob creat= or patch (https://edk2.groups.io/g/devel/message/119022), is that I understand the hob creation depends on “gEfiPeiMemoryDisco= veredPpiGuid”, but does this routine still run properly if variable P= EIM is loaded much later than memory discovered?

 

Regards,

Kun

 

From: Ni, Ray <ray.ni@intel.com&g= t;
Sent: Friday, May 17, 2024 5:10 AM
To: Tan, Dun <dun.tan@intel.com>; devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>; Kun Qin <Kun.Qin= @microsoft.com>; Sean Brogan <sean.brogan@microsoft.com>
Subject: [EXTERNAL] Re: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVaria= bleRuntimeCacheInfoHobGuid

 

Reviewe= d-by: Ray Ni <ray.ni@intel.com>

&n= bsp;

Thanks,=

Ray


From: Tan, D= un <dun.tan@intel.com>
Sent: Friday, May 17, 2024 17:49
To:
devel@edk2.group= s.io <devel@edk2.groups.io>
Cc: Ni, Ray <
ray.ni@i= ntel.com>; Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCache= InfoHobGuid

 

Consume gEdkiiVariableRuntimeCacheInfoHobGuid in

VariableSmmRuntimeDxe driver to initialize the following

variable cache related buffer:
  *mVariableRuntimeHobCacheBuffer
  *mVariableRuntimeNvCacheBuffer
  *mVariableRuntimeVolatileCacheBuffer
  *mVariableRuntimeCachePendingUpdate
  *mVariableRuntimeCacheReadLock
  *mHobFlushComplete

The code to to allocate
and unblock the buffer for
different type cache in VariableSmmRuntimeDxe is also
removed in this commit.

Signed-off-by: Dun Tan <
dun.tan@intel.com>
Cc: Ray Ni <
ray.ni@intel.com>
Cc: Liming Gao <
gaoliming@byosoft.com.cn>

Cc: Jiaxin Wu <
jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c&nb= sp;  | 120 +++++++++++++++++++++++++++++++++++++++++++++++++----------= -------------------------------------------------------------
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf = |   5 +++--
 2 files changed, 52 insertions(+), 73 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeD= xe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 8b42ae7d72..68a249c5ac 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -35,10 +35,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/DebugLib.h>
 #include <Library/UefiLib.h>
 #include <Library/BaseLib.h>
-#include <Library/MmUnblockMemoryLib.h>
+#include <Library/HobLib.h>
 
 #include <Guid/EventGroup.h>
 #include <Guid/SmmVariableCommon.h>
+#include <Guid/VariableRuntimeCacheInfo.h>
 
 #include "PrivilegePolymorphic.h"
 #include "VariableParsing.h"
@@ -56,10 +57,10 @@ VARIABLE_STORE_HEADER     &nbs= p;     *mVariableRuntimeVolatileCacheBuffer =3D NULL;  UINTN          &nbs= p;            &= nbsp;   mVariableBufferSize;
 UINTN          &nbs= p;            &= nbsp;   mVariableRuntimeHobCacheBufferSize;
 UINTN          &nbs= p;            &= nbsp;   mVariableBufferPayloadSize;
-BOOLEAN           &= nbsp;           &nbs= p; mVariableRuntimeCachePendingUpdate;
-BOOLEAN           &= nbsp;           &nbs= p; mVariableRuntimeCacheReadLock;
+BOOLEAN           &= nbsp;           &nbs= p; *mVariableRuntimeCachePendingUpdate;
+BOOLEAN           &= nbsp;           &nbs= p; *mVariableRuntimeCacheReadLock;
 BOOLEAN          &n= bsp;            = ;  mVariableAuthFormat;
-BOOLEAN           &= nbsp;           &nbs= p; mHobFlushComplete;
+BOOLEAN           &= nbsp;           &nbs= p; *mHobFlushComplete;
 EFI_LOCK          &= nbsp;           &nbs= p; mVariableServicesLock;
 EDKII_VARIABLE_LOCK_PROTOCOL    mVariableLock;
 EDKII_VAR_CHECK_PROTOCOL        mV= arCheck;
@@ -180,27 +181,6 @@ InitVariableCache (
 
   *TotalVariableCacheSize =3D ALIGN_VALUE (*TotalVariableCacheSi= ze, sizeof (UINT32));
 
-  //
-  // Allocate NV Storage Cache and initialize it to all 1's (like an = erased FV)
-  //
-  *VariableCacheBuffer =3D  (VARIABLE_STORE_HEADER *)AllocateRun= timePages (
-            &n= bsp;            = ;            &n= bsp;            = ;   EFI_SIZE_TO_PAGES (*TotalVariableCacheSize)
-            &n= bsp;            = ;            &n= bsp;            = ;   );
-  if (*VariableCacheBuffer =3D=3D NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  //
-  // Request to unblock the newly allocated cache region to be access= ible from inside MM
-  //
-  Status =3D MmUnblockMemoryRequest (
-             (= EFI_PHYSICAL_ADDRESS)(UINTN)*VariableCacheBuffer,
-             E= FI_SIZE_TO_PAGES (*TotalVariableCacheSize)
-             )= ;
-  if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) {<= br> -    return Status;
-  }
-
   VariableCacheStorePtr =3D *VariableCacheBuffer;
   SetMem32 ((VOID *)VariableCacheStorePtr, *TotalVariableCacheSi= ze, (UINT32)0xFFFFFFFF);
 
@@ -568,16 +548,16 @@ CheckForRuntimeCacheSync (
   VOID
   )
 {
-  if (mVariableRuntimeCachePendingUpdate) {
+  if (*mVariableRuntimeCachePendingUpdate) {
     SyncRuntimeCache ();
   }
 
-  ASSERT (!mVariableRuntimeCachePendingUpdate);
+  ASSERT (!(*mVariableRuntimeCachePendingUpdate));
 
   //
   // The HOB variable data may have finished being flushed in th= e runtime cache sync update
   //
-  if (mHobFlushComplete && (mVariableRuntimeHobCacheBuffer != =3D NULL)) {
+  if ((*mHobFlushComplete) && (mVariableRuntimeHobCacheBuffer= !=3D NULL)) {
     if (!EfiAtRuntime ()) {
       FreePages (mVariableRuntimeHobCacheBuf= fer, EFI_SIZE_TO_PAGES (mVariableRuntimeHobCacheBufferSize));
     }
@@ -633,12 +613,12 @@ FindVariableInRuntimeCache (
   // a GetVariable () or GetNextVariable () call from being issu= ed until a prior call has returned. The runtime
   // cache read lock should always be free when entering this fu= nction.
   //
-  ASSERT (!mVariableRuntimeCacheReadLock);
+  ASSERT (!(*mVariableRuntimeCacheReadLock));
 
-  mVariableRuntimeCacheReadLock =3D TRUE;
+  *mVariableRuntimeCacheReadLock =3D TRUE;
   CheckForRuntimeCacheSync ();
 
-  if (!mVariableRuntimeCachePendingUpdate) {
+  if (!(*mVariableRuntimeCachePendingUpdate)) {
     //
     // 0: Volatile, 1: HOB, 2: Non-Volatile.
     // The index and attributes mapping must be kept i= n this order as FindVariable
@@ -698,7 +678,7 @@ Done:
     }
   }
 
-  mVariableRuntimeCacheReadLock =3D FALSE;
+  *mVariableRuntimeCacheReadLock =3D FALSE;
 
   return Status;
 }
@@ -921,12 +901,12 @@ GetNextVariableNameInRuntimeCache (
   // a GetVariable () or GetNextVariable () call from being issu= ed until a prior call has returned. The runtime
   // cache read lock should always be free when entering this fu= nction.
   //
-  ASSERT (!mVariableRuntimeCacheReadLock);
+  ASSERT (!(*mVariableRuntimeCacheReadLock));
 
   CheckForRuntimeCacheSync ();
 
-  mVariableRuntimeCacheReadLock =3D TRUE;
-  if (!mVariableRuntimeCachePendingUpdate) {
+  *mVariableRuntimeCacheReadLock =3D TRUE;
+  if (!(*mVariableRuntimeCachePendingUpdate)) {
     //
     // 0: Volatile, 1: HOB, 2: Non-Volatile.
     // The index and attributes mapping must be kept i= n this order as FindVariable
@@ -958,7 +938,7 @@ GetNextVariableNameInRuntimeCache (
     }
   }
 
-  mVariableRuntimeCacheReadLock =3D FALSE;
+  *mVariableRuntimeCacheReadLock =3D FALSE;
 
   return Status;
 }
@@ -1622,37 +1602,9 @@ SendRuntimeVariableCacheContextToSmm (
   SmmRuntimeVarCacheContext->RuntimeHobCache   = ;   =3D mVariableRuntimeHobCacheBuffer;
   SmmRuntimeVarCacheContext->RuntimeVolatileCache =3D mVariab= leRuntimeVolatileCacheBuffer;
   SmmRuntimeVarCacheContext->RuntimeNvCache   =     =3D mVariableRuntimeNvCacheBuffer;
-  SmmRuntimeVarCacheContext->PendingUpdate    =     =3D &mVariableRuntimeCachePendingUpdate;
-  SmmRuntimeVarCacheContext->ReadLock     = ;        =3D &mVariableRuntimeCacheR= eadLock;
-  SmmRuntimeVarCacheContext->HobFlushComplete   &nb= sp; =3D &mHobFlushComplete;
-
-  //
-  // Request to unblock this region to be accessible from inside MM e= nvironment
-  // These fields "should" be all on the same page, but jus= t to be on the safe side...
-  //
-  Status =3D MmUnblockMemoryRequest (
-             (= EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheContext->Pend= ingUpdate - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE),
-             E= FI_SIZE_TO_PAGES (sizeof (mVariableRuntimeCachePendingUpdate))
-             )= ;
-  if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) {<= br> -    goto Done;
-  }
-
-  Status =3D MmUnblockMemoryRequest (
-             (= EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheContext->Read= Lock - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE),
-             E= FI_SIZE_TO_PAGES (sizeof (mVariableRuntimeCacheReadLock))
-             )= ;
-  if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) {<= br> -    goto Done;
-  }
-
-  Status =3D MmUnblockMemoryRequest (
-             (= EFI_PHYSICAL_ADDRESS)ALIGN_VALUE ((UINTN)SmmRuntimeVarCacheContext->HobF= lushComplete - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE),
-             E= FI_SIZE_TO_PAGES (sizeof (mHobFlushComplete))
-             )= ;
-  if ((Status !=3D EFI_UNSUPPORTED) && EFI_ERROR (Status)) {<= br> -    goto Done;
-  }
+  SmmRuntimeVarCacheContext->PendingUpdate    =     =3D mVariableRuntimeCachePendingUpdate;
+  SmmRuntimeVarCacheContext->ReadLock     = ;        =3D mVariableRuntimeCacheReadLo= ck;
+  SmmRuntimeVarCacheContext->HobFlushComplete   &nb= sp; =3D mHobFlushComplete;
 
   //
   // Send data to SMM.
@@ -1688,9 +1640,14 @@ SmmVariableReady (
   IN  VOID       *Context
   )
 {
-  EFI_STATUS  Status;
-  UINTN       RuntimeNvCacheSize;
-  UINTN       RuntimeVolatileCacheSize;=
+  EFI_STATUS         &nb= sp;         Status;
+  UINTN          &n= bsp;            = ; RuntimeNvCacheSize;
+  UINTN          &n= bsp;            = ; RuntimeVolatileCacheSize;
+  UINTN          &n= bsp;            = ; AllocatedHobCacheSize;
+  UINTN          &n= bsp;            = ; AllocatedNvCacheSize;
+  UINTN          &n= bsp;            = ; AllocatedVolatileCacheSize;
+  EFI_HOB_GUID_TYPE        &n= bsp;   *GuidHob;
+  VARIABLE_RUNTIME_CACHE_INFO  *VariableRuntimeCacheHob;
 
   Status =3D gBS->LocateProtocol (&gEfiSmmVariableProtoco= lGuid, NULL, (VOID **)&mSmmVariable);
   if (EFI_ERROR (Status)) {
@@ -1717,7 +1674,7 @@ SmmVariableReady (
   if (FeaturePcdGet (PcdEnableVariableRuntimeCache)) {
     DEBUG ((DEBUG_INFO, "Variable driver runtime = cache is enabled.\n"));
     //
-    // Allocate runtime variable cache memory buffers.
+    // Get needed runtime cache buffer size and check if au= th variables are to be used from SMM
     //
     Status =3D  GetRuntimeCacheInfo (
            &nb= sp;    &mVariableRuntimeHobCacheBufferSize,
@@ -1726,6 +1683,27 @@ SmmVariableReady (
            &nb= sp;    &mVariableAuthFormat
            &nb= sp;    );
     if (!EFI_ERROR (Status)) {
+      GuidHob =3D GetFirstGuidHob (&gEdkiiVar= iableRuntimeCacheInfoHobGuid);
+      ASSERT (GuidHob !=3D NULL);
+      VariableRuntimeCacheHob    = =3D GET_GUID_HOB_DATA (GuidHob);
+      AllocatedHobCacheSize   &nbs= p;  =3D EFI_PAGES_TO_SIZE (VariableRuntimeCacheHob->RuntimeHobCache= Pages);
+      AllocatedNvCacheSize    = ;   =3D EFI_PAGES_TO_SIZE (VariableRuntimeCacheHob->RuntimeNvC= achePages);
+      AllocatedVolatileCacheSize =3D EFI_PAGES_TO= _SIZE (VariableRuntimeCacheHob->RuntimeVolatileCachePages);
+
+      ASSERT (
+        (AllocatedHobCacheSize >=3D = mVariableRuntimeHobCacheBufferSize) &&
+        (AllocatedNvCacheSize >=3D R= untimeNvCacheSize) &&
+        (AllocatedVolatileCacheSize >= ;=3D RuntimeVolatileCacheSize)
+        );
+
+      mVariableRuntimeHobCacheBuffer  &= nbsp;   =3D (VARIABLE_STORE_HEADER *)(UINTN)VariableRuntimeCacheH= ob->RuntimeHobCacheBuffer;
+      mVariableRuntimeNvCacheBuffer  &n= bsp;    =3D (VARIABLE_STORE_HEADER *)(UINTN)VariableRuntimeC= acheHob->RuntimeNvCacheBuffer;
+      mVariableRuntimeVolatileCacheBuffer =3D (VA= RIABLE_STORE_HEADER *)(UINTN)VariableRuntimeCacheHob->RuntimeVolatileCac= heBuffer;
+      mVariableRuntimeCachePendingUpdate  = =3D &VariableRuntimeCacheHob->CacheInfoFlag->PendingUpdate;
+      mVariableRuntimeCacheReadLock  &n= bsp;    =3D &VariableRuntimeCacheHob->CacheInfoFlag-&= gt;ReadLock;
+      mHobFlushComplete    &n= bsp;            = ;  =3D &VariableRuntimeCacheHob->CacheInfoFlag->HobFlushComp= lete;
+      mVariableRuntimeHobCacheBufferSize  = =3D AllocatedHobCacheSize;
+
       Status =3D InitVariableCache (&mVa= riableRuntimeHobCacheBuffer, &mVariableRuntimeHobCacheBufferSize);
       if (!EFI_ERROR (Status)) {
         Status =3D InitVariableCac= he (&mVariableRuntimeNvCacheBuffer, &RuntimeNvCacheSize);
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeD= xe.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.i= nf
index e1085653fe..2d16f28674 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf<= br> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf<= br> @@ -13,7 +13,7 @@
 #  may not be modified without authorization. If platform fails = to protect these resources,
 #  the authentication service provided in this driver will be br= oken, and the behavior is undefined.
 #
-# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR= >
+# Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR= >
 # Copyright (c) Microsoft Corporation.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -60,7 +60,7 @@
   TpmMeasurementLib
   SafeIntLib
   PcdLib
-  MmUnblockMemoryLib
+  HobLib
 
 [Protocols]
   gEfiVariableWriteArchProtocolGuid     = ;        ## PRODUCES
@@ -113,6 +113,7 @@
   gVarCheckPolicyLibMmiHandlerGuid
   gEfiEndOfDxeEventGroupGuid
   gEfiDeviceSignatureDatabaseGuid
+  gEdkiiVariableRuntimeCacheInfoHobGuid
 
 [Depex]
   gEfiMmCommunication2ProtocolGuid
--
2.31.1.windows.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#119055) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BL1PR21MB3160DE3E7B610CC514EFCB05E9EE2BL1PR21MB3160namp_--