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 A6DBAAC09B3 for ; Mon, 31 Jul 2023 05:03:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AbR78YQMxIqNLq4r4p4kV/fekR3x6SzpaMfewit/2fA=; 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:X-Received:X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:x-ld-processed:x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:x-microsoft-antispam-message-info:x-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-Cro ssTenantHeadersStamped:X-OriginatorOrg:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690779824; v=1; b=JF3up4kfq9MCGmkbkrw++Nl5t7mwesl/BfhhSuX9Xl5UzfQEEoNPOc778VOYZ5HzWxmojmMB i5GFiYIMdJtLiMiLmU8iTvSye3VHvde6TeDu4eR2ukLdn93BRbpSakFczoCj1Lp5nQ9o0xMxQEa c/1eWLMRRU0UgywGPmj4XbPs= X-Received: by 127.0.0.2 with SMTP id 489QYY7687511xJsXweBXX1d; Sun, 30 Jul 2023 22:03:44 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.1131.1690779823348609838 for ; Sun, 30 Jul 2023 22:03:43 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="435219246" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="435219246" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2023 22:03:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="1058806895" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="1058806895" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 30 Jul 2023 22:03:42 -0700 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 30 Jul 2023 22:03:41 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Sun, 30 Jul 2023 22:03:41 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sun, 30 Jul 2023 22:03:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UaAsJa3mZXxKm/YMpatv5bLCP9EhjotEcMgSoyLGkUZBUDdbeI3YRKbIaOfFRSfNvg5P3ak2YaHQiatyLwBjdqSpqehNp0y7bzJ4Va4xISLtdY+Ytuj+5QKwROqa0BwMJTjrQnZNqV/XcLG1JY6//Jt/GbJ4Ky0VY+TChMXhnDmyqOQ2dL/bCfGAi3Cv/W2+ukF3lBaFBpE91sVQhpfpY4O8+VyVdfa2d3Xma1q9EjqEKrt5VwomCNylZx03dsbU8T3uHzRTOxP0tSnXH/VTS/BitEkGOfAD4DGZEHdx3M6cr/HdHL1rNurXaSmcugzynNhOpCViroidWAPhVED1CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ertu9ZjK+Kv/UHdpwU68/rFKKLVlpfxjxLzU6ueyJN0=; b=UpQeFJYVvJ9HWUFizMKmFqahjmUhK0rYl1mL5OjJEIEqzBkEQHqM/RYjywWWAtoUa5oQK/W6YaCpTk7TQUe75O2vpq2AhE2xQZAO56wWMenVMgcxHD/jb0tZ8FiFx9VstlBextMN5rhSdnPDgSfOho26dwpJmtu92sk/9y4qnOJB4lMbfE3dfkgs+UTyO13ppb2KUTRLu+AZbBgUUyNb5rhnIv2lMI6vzOGJyQoCkErqLADNZ0LV9mFZkqAIYJGh3NW7oqSQY4Fspkz0csqcOFbr9nPegAFBCar5QWysLsbVf7+CtqE7eLcSntKL5hfPXxi3Hr+tTfVdX/Ggl28OFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from DM4PR11MB6480.namprd11.prod.outlook.com (2603:10b6:8:8d::17) by MN2PR11MB4565.namprd11.prod.outlook.com (2603:10b6:208:26a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul 2023 05:03:39 +0000 X-Received: from DM4PR11MB6480.namprd11.prod.outlook.com ([fe80::a69c:5be9:95fe:6bc6]) by DM4PR11MB6480.namprd11.prod.outlook.com ([fe80::a69c:5be9:95fe:6bc6%6]) with mapi id 15.20.6631.042; Mon, 31 Jul 2023 05:03:39 +0000 From: "Dong, Eric" To: "Bi, Dandan" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/SetupBrowser: Load storage via GetVariable for EfiVarStore Thread-Topic: [PATCH v2] MdeModulePkg/SetupBrowser: Load storage via GetVariable for EfiVarStore Thread-Index: AQHZw0hzCpZ1TW3MiEyzRKWmWbjWMq/TUggg Date: Mon, 31 Jul 2023 05:03:38 +0000 Message-ID: References: <20230731004606.1740-1-dandan.bi@intel.com> In-Reply-To: <20230731004606.1740-1-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB6480:EE_|MN2PR11MB4565:EE_ x-ms-office365-filtering-correlation-id: 58e97c68-9eb6-42f9-c02d-08db918380b6 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 6qBFIk65SBQ4uKnV9oBv8tofxfX+gYoeHsyVJju6z8NQSLDYArmuvO9ufGL8iZe4hEUEDQ30RM82sGVt5jQi/vxox9IIb0YPvXpTReL8JQJKR2k7PRDMt767FBkNMTIRV8C5BLClq0+bT4PxCMFYShHGUBY0xMy13vvkGThiysWyeSx34Aopbmza/HmwMv+4ZQsQavfhvSWoCot0GTqlJOUT5pMKa4hGrmOJjVetodFaz9bLjOmTLF3l5ZNQFgqlUuBA4OC0eU0AwFSHNqacS6pcrk1xN4K3SkngtW/y46xZnbLpRG3Gvp3Ser3oBFnQD0/s6D9hk+POTE8jpME0VYWuVTEsTK1gsEH3IxYt8Cspg6C0X5baNrWSBjYefy+trZE37IDL49j+B6JCih9veWLPOpQorwkpo/e/RKrH77+raj191V3t9WHLBMD3lb71y/RlGBa0tQ+IJZM98Voo9of1ECLLA5XKXiAfxyV81Zvky6j3iEGWpwQtYgaMaATCFPR5Oq5t/sEdIQNAv6yV1EIs2kOktr0V0WSMbaJwfwHSj4uLIwDC+CXQNP2qZ0+5hHOd1tJuHdtoTUw7i7kLAi1AnLv8fNetcOCaX9HoubMeD1Rr8gVLxhtBwkcyR87t x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1W/RF0K8r5rkWZwTTRB/5wxGZMpZF7k8RCsdRnMGkuGa4iSYjbu+fv2SagnE?= =?us-ascii?Q?/bb5MIYc3bUQb8/WYw7moUs+5ZB91arizTpEu1B4QgWAXg85qbnLgGH15+/z?= =?us-ascii?Q?1HWONsYUrCpjYz05po2HhSn52nC9W+mG0ViV/RF1wICFWoUtWL8UBqdpdXQN?= =?us-ascii?Q?SFlFi30rLMJrMU42L9qFxgGomYeXwaI6nXsftv5J9TrnDZG32okjOkUB/MiR?= =?us-ascii?Q?uULacsZLyUNYh2KfLmqD3wBHc7e7UpuezAI5y+qEun8vava+koTJYd/gg57s?= =?us-ascii?Q?7BDfWv4xHmyrAIuHLndq7B2n5HJu1K7bfVblZ4EdtAKh7kNou6aDc438lZbr?= =?us-ascii?Q?wHodEm0sfgyXFmqFR7+Zq7QxGXfSG+x7E9jsmDfrCxvv37mh3MGXxRqO/tL2?= =?us-ascii?Q?/jybNL6tzAjnSJrQBX79nhJEPVcTED15EzxO84PAXNbz+SF2+1+VKkXewean?= =?us-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8I0wALYPc3XzGkuiPWSv9+G+O?= =?us-ascii?Q?FCXo9eaWvOytxQ5oqRkvvA7TzLKHZbCqAz2s7MqZ6Z0rOT+T9YJWcMDFZ+cT?= =?us-ascii?Q?H02ztbxJ2y9bV3hQ0B2MnpgM/TskW5scIW5JK0IXHfi9f68ZMLTIJI+SLIC5?= =?us-ascii?Q?bpWcMScAZHYKfWP6BbS4+T+ftLgj5SDQTgwfAIgESLXxbyLZwEWv95UmKczE?= =?us-ascii?Q?gDUlsPl9X4rECSyoscFBaYRzKnewL6iknW5iaFMM?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6480.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e97c68-9eb6-42f9-c02d-08db918380b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 05:03:38.9051 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ygG59OVpKhPrCc6V53T2ctfeo0qvnBOPgf4wEFNaG+WMl6iDAbBSRSDIDgN+zJCDQ/9eqL2x9PVzw5SMK+ci2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4565 X-OriginatorOrg: intel.com 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,eric.dong@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: f4nQB1pPjaB3wFznUVWi4EbHx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=JF3up4kf; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Eric Dong -----Original Message----- From: Bi, Dandan =20 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 For EfiVarStore (EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER), it will call Extrac= tConfig-GetVariable-HiiBlockToConfig-ConfigToBlock when load storage value = in LoadStorage function. It's not necessary and costs lots of time to do th= e conversion between config and block. So now enhance it to call GetVariable directly. Cc: Liming Gao Cc: Eric Dong Signed-off-by: Dandan Bi --- 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=20 + 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,=20 + FormSetLevel, GetDefaultForStorage, Storage->BrowserStorage, TRUE,=20 + 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); -- 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 (#107393): https://edk2.groups.io/g/devel/message/107393 Mute This Topic: https://groups.io/mt/100453623/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-