From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B8FC2AC0B43 for ; Wed, 2 Aug 2023 05:08:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZRe8CiXaJNdq0Stt58Gwv1VYJIyHdbhCz9Trk/YGSzU=; c=relaxed/simple; d=groups.io; h=From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1690952884; v=1; b=S7K80tlPkTUCsy5o2ZetI4HT7H17tRfYYvHbx1J+XnmKiXFzuTyBT5jPlmtxjGX2QNsrL721 py0TWMaVTWEzK4iwuUnbMEB5X1p+ckKcveMDXuR8rmEQrp8pekhgIfxtOnpXNWA91LfNYIX3Jo3 MJIXpvJZIdM6pHpjZrPPjfbE= X-Received: by 127.0.0.2 with SMTP id 9hXRYY7687511xRMyqKiRAWE; Tue, 01 Aug 2023 22:08:04 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web11.7876.1690952883111242159 for ; Tue, 01 Aug 2023 22:08:03 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 7FF21A32E011 for ; Wed, 2 Aug 2023 13:07:59 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 6D564A32E00B for ; Wed, 2 Aug 2023 13:07:59 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id B0EFFA32E005 for ; Wed, 2 Aug 2023 13:07:54 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 02 Aug 2023 13:07:51 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: "'Dong, Eric'" , "'Bi, Dandan'" , References: <20230731004606.1740-1-dandan.bi@intel.com> In-Reply-To: Subject: =?UTF-8?B?W2VkazItZGV2ZWxdIOWbnuWkjTogW1BBVENIIHYyXSBNZGVNb2R1bGVQa2cvU2V0dXBCcm93c2VyOiBMb2FkIHN0b3JhZ2UgdmlhIEdldFZhcmlhYmxlIGZvciBFZmlWYXJTdG9yZQ==?= Date: Wed, 2 Aug 2023 13:07:52 +0800 Message-ID: <003b01d9c4ff$4a6f8f30$df4ead90$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQL/K4pml0+M9gQc8lw6vsr1Gju1fwI9FuqxrXm+c0A= 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,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OgHWJq88UvD4BUAous5nnk6sx7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=S7K80tlP; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Dandan: Have you collected the performance data for this enhancement? Is the updated one better than before? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Dong, Eric > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA7=D4=C231=C8=D5 13:04 > =CA=D5=BC=FE=C8=CB: Bi, Dandan ; devel@edk2.groups.i= o > =B3=AD=CB=CD: Gao, Liming > =D6=F7=CC=E2: RE: [PATCH v2] MdeModulePkg/SetupBrowser: Load storage via > GetVariable for EfiVarStore >=20 > Reviewed-by: Eric Dong >=20 > -----Original Message----- > From: Bi, Dandan > Sent: Monday, July 31, 2023 8:46 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Dong, Eric > > Subject: [PATCH v2] MdeModulePkg/SetupBrowser: Load storage via > GetVariable for EfiVarStore >=20 > For EfiVarStore (EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER), it will call > ExtractConfig-GetVariable-HiiBlockToConfig-ConfigToBlock when load storag= e > 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. >=20 > Cc: Liming Gao > Cc: Eric Dong > Signed-off-by: Dandan Bi > --- > v2: Fix coding style issue. >=20 > .../Universal/SetupBrowserDxe/Setup.c | 54 +++++++++++-------- > 1 file changed, 32 insertions(+), 22 deletions(-) >=20 > 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, > FormSetLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE, > TRUE); > - } else { > + if (Storage->BrowserStorage->Type =3D=3D > + EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) { > // > - // 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, > + FormSetLevel, 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, > FormSetLevel, 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 > (Storage->ConfigRequest), Storage->ConfigRequest); > -- > 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 (#107446): https://edk2.groups.io/g/devel/message/107446 Mute This Topic: https://groups.io/mt/100499712/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-