From nobody Sun Feb 8 04:34:31 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+107385+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+107385+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1690764429; cv=none; d=zohomail.com; s=zohoarc; b=R+97qeS142q6u2LJmbVSphbwaN1VUNb1Gt6X4DJsOJqCV0JHjs1rLm5MD3zyf+oDmNxGD3SM/FXoZEk66nYVQ6WB+nAe49m7ezBUBOHcv8UFUZZSMKlspGYXmPzdfvSMVHoJFU0Fs8ewT13iaT1KJoVRJtekh0OBJIiPHvGxkX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690764429; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=FubUeNdTHDqJxt/rSqwECZosoO/+9wJQ38LnMiNfX/E=; b=ZcOaxpH2DG+rrAHd+UJkHbQyKUNulFgTfNvOaLbB2Qk/rJnENwzEUs7QCbPh9i0SIrav0lewChI5UxOCChZ4YF1zxWoPu1uYdU3/aYPLKpvywmD5YuIFlUdUauX17NeY8Rbm9sQ0h4+4ThGeuBJmzdstwlIlBtvktCd1Mtnd6GM= 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+107385+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 1690764429436692.5941470932604; Sun, 30 Jul 2023 17:47:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=79EJavX/5XMPt+6SYKdj89J+Rowr3l8IWohLTcrxlqw=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received:From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1690764429; v=1; b=ZF52UkIhipnRLNpoo/ogulXPjGaw999oazgAgz55iBUj5X03cFsnZ1MM5/x50X9NOMpV/fXe nEg/P5wkDTS/pIMb7nxfi6nZE7uAt3flw6ZqJiAn+owN0CO5WJgUbHH7jR32oHpVNLcL2v8wcTJ PeUcmXkRd3RywxjfEc7zGnq0= X-Received: by 127.0.0.2 with SMTP id STa4YY1788612xYVVU6jqXZj; Sun, 30 Jul 2023 17:47:09 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.84911.1690764428041316798 for ; Sun, 30 Jul 2023 17:47:08 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="349191593" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="349191593" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2023 17:46:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="818119053" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="818119053" X-Received: from shwdeqlab1144.ccr.corp.intel.com ([10.239.154.129]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2023 17:46:21 -0700 From: "Dandan Bi" To: devel@edk2.groups.io Cc: Liming Gao , Eric Dong Subject: [edk2-devel] [PATCH v2] MdeModulePkg/SetupBrowser: Load storage via GetVariable for EfiVarStore Date: Mon, 31 Jul 2023 08:46:06 +0800 Message-Id: <20230731004606.1740-1-dandan.bi@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 Reply-To: devel@edk2.groups.io,dandan.bi@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: EWGhXzX9R1anVLDZtpnl6Pw0x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690764430880100002 Content-Type: text/plain; charset="utf-8" For EfiVarStore (EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER), it will call ExtractConfig-GetVariable-HiiBlockToConfig-ConfigToBlock when load storage value in LoadStorage function. It's not necessary and costs lots of time to do the conversion between config and block. So now enhance it to call GetVariable directly. Cc: Liming Gao Cc: Eric Dong Signed-off-by: Dandan Bi Reviewed-by: Eric Dong Reviewed-by: Liming Gao --- v2: Fix coding style issue. .../Universal/SetupBrowserDxe/Setup.c | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/= Universal/SetupBrowserDxe/Setup.c index 5158baf5bd..2f7b11b1aa 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -5634,32 +5634,42 @@ LoadStorage ( ConfigRequest =3D Storage->ConfigRequest; } =20 - // - // Request current settings from Configuration Driver - // - Status =3D mHiiConfigRouting->ExtractConfig ( - mHiiConfigRouting, - ConfigRequest, - &Progress, - &Result - ); - - // - // If get value fail, extract default from IFR binary - // - if (EFI_ERROR (Status)) { - ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormSet= Level, GetDefaultForStorage, Storage->BrowserStorage, TRUE, TRUE); - } else { + if (Storage->BrowserStorage->Type =3D=3D EFI_HII_VARSTORE_EFI_VARIABLE_B= UFFER) { // - // Convert Result from to + // Call GetVariable directly for EfiVarStore // - StrPtr =3D StrStr (Result, L"&GUID=3D"); - if (StrPtr !=3D NULL) { - *StrPtr =3D L'\0'; + Status =3D gRT->GetVariable (Storage->BrowserStorage->Name, &(Storage-= >BrowserStorage->Guid), NULL, (UINTN *)(&(Storage->BrowserStorage->Size)), = Storage->BrowserStorage->EditBuffer); + if (EFI_ERROR (Status)) { + ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormS= etLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE, TRUE); } + } else { + // + // Request current settings from Configuration Driver + // + Status =3D mHiiConfigRouting->ExtractConfig ( + mHiiConfigRouting, + ConfigRequest, + &Progress, + &Result + ); =20 - Status =3D ConfigRespToStorage (Storage->BrowserStorage, Result); - FreePool (Result); + // + // If get value fail, extract default from IFR binary + // + if (EFI_ERROR (Status)) { + ExtractDefault (FormSet, NULL, EFI_HII_DEFAULT_CLASS_STANDARD, FormS= etLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE, TRUE); + } else { + // + // Convert Result from to + // + StrPtr =3D StrStr (Result, L"&GUID=3D"); + if (StrPtr !=3D NULL) { + *StrPtr =3D L'\0'; + } + + Status =3D ConfigRespToStorage (Storage->BrowserStorage, Result); + FreePool (Result); + } } =20 Storage->BrowserStorage->ConfigRequest =3D AllocateCopyPool (StrSize (St= orage->ConfigRequest), Storage->ConfigRequest); --=20 2.39.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 (#107385): https://edk2.groups.io/g/devel/message/107385 Mute This Topic: https://groups.io/mt/100453623/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-