From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.11054.1593562935740769371 for ; Tue, 30 Jun 2020 17:22:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=RRvIX/Aw; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: guomin.jiang@intel.com) IronPort-SDR: i67zd3pjJHTnKpAl8TvE8v2aR/WI1C+WlyGEkywPHFK9MSXd6pIrRXF/zLsMfRWIeV6UwWWyoq EkW8gvmPn13g== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="231278512" X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="231278512" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 17:22:14 -0700 IronPort-SDR: +bicenP39q4/Jn6TowbVYV6ozDBX4QCCEnH3aQZlkfVjN8zNf8Xl3L/GM79ilIERZ9W8DsEsnG 70sVPq3Px1Vg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,298,1589266800"; d="scan'208";a="281419102" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga006.jf.intel.com with ESMTP; 30 Jun 2020 17:22:14 -0700 Received: from orsmsx155.amr.corp.intel.com (10.22.240.21) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 30 Jun 2020 17:22:13 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX155.amr.corp.intel.com (10.22.240.21) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 30 Jun 2020 17:22:13 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 30 Jun 2020 17:22:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oAgnwJiyHAd1b4PLpCAZKErm4uueZU95IJ7teS2r7W9lSgB1Znugx4KnimAAoJ5n/ndAiJkdgxz4fgolBABQB72dBrQnP8h5clzyeJv8pJ4IRAkFDk35WjJtO4aIRnLA6ZkpEbpeFPg1V6asvWN21v/Bph5Q37mV4HJAXscujF1FM/E+joEnc9PufeC3OII3rEhpSSy+YV8tBH/3dAzEKKDktN7jXRNHxkoUj2IOF/18pMkE0/9CuDLpkSIXlty3oOpUtd9v2WdGV2f9hTh9Ssu1Zri3JoXKyg6PK0pJF9XDRv9CrzFsPPmLBSeeJ2s//qmw/v8XkjfVfctxpKAvGg== 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-SenderADCheck; bh=ckR3zPPLMShCw5KXWzhDu9qXJCE4+HQTcI3yVLMsNgs=; b=D2rSbvA1vanQL79pg3/NJgsHK/LejS6mwaDfMi9dT5NZEbuum3+16pfVlBhntyND0T9ifHiHxUBUAtg1tyuSOHdgFrolYh1CXtKRxQV9aXnSSCE7DBhuX9hC6sDupTVRwTnwpoHQPrF0v7UAYLE2o3sRmG+u+7Gxh755ByKvc0zAZNKf4MPiqQ7oAbkcgtfYrJ+WFE+CAqodxN7rouYmNCI+ErFWxj91f7Z+lF27bs+EbP6wq3nPYi2wLZTbmiz/cTYdT2vfDy1eb0wqc7acujQzib5bcCpBIZMlWan7VUobiSCYMUq3n0AVzLPcBh5K48teJ+TdPoneaiYB4/Tw4w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ckR3zPPLMShCw5KXWzhDu9qXJCE4+HQTcI3yVLMsNgs=; b=RRvIX/AwBQQPpc/RF1CJMvPxYmddXBNBZJF6FkRjlDUubtVeCb870sCgbYVDJAygOeWtAX+ardZ1fAxaXyZ2Zy3pLzALMkLasxGqDvEKGXVPE33NS3EhDdfEc9MXKat76cOUmXY2IJEGEp4VSSxyeGFR0IBSusWHH08YWZqFYfM= Received: from DM6PR11MB2955.namprd11.prod.outlook.com (2603:10b6:5:65::31) by DM6PR11MB3225.namprd11.prod.outlook.com (2603:10b6:5:5b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Wed, 1 Jul 2020 00:22:12 +0000 Received: from DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::e916:c766:fc41:b51d]) by DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::e916:c766:fc41:b51d%5]) with mapi id 15.20.3131.027; Wed, 1 Jul 2020 00:22:12 +0000 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "huangming23@huawei.com" , "Wang, Jian J" , "Wu, Hao A" , "Gao, Liming" CC: "lidongzhan@huawei.com" , "songdongkuang@huawei.com" , "wanghuiqiang@huawei.com" , "qiuliangen@huawei.com" , "shenlimei@huawei.com" , "xiewenyi2@huawei.com" Subject: Re: [edk2-devel] [PATCH edk2 v1 1/1] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Thread-Topic: [edk2-devel] [PATCH edk2 v1 1/1] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Thread-Index: AQHWTdvc/EERFE2Is0WZy87gpc5s7qjwT42QgADH24CAAMWXUA== Date: Wed, 1 Jul 2020 00:22:12 +0000 Message-ID: References: <1593410773-62704-1-git-send-email-huangming23@huawei.com> <1593410773-62704-2-git-send-email-huangming23@huawei.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 36cf7ced-52c3-42e5-67fb-08d81d54cce3 x-ms-traffictypediagnostic: DM6PR11MB3225: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 04519BA941 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wSYDcjRBxwIlFZVF58oleReSYsBXDOdU2R7CwcRFJwf+MYXo8Z78APqhCrh9txuIaNUOqmWobva67XF/EZ4YnDJDkaPHp908orVvMMcobVdH2A6IWTtmDlVB9+nziWHzce4I90oPPy7LXdr1YlKAslB5cZHOjN61OSvuKN9Gxq87rMsMF2chhrmbBFTqndKpTSWzGXe0u/jwF49fIF7ImHUNKXm1x2yjRA1ksHU/YEgA5uI+ooOwEaRkADyzJ8dZ8FmlRjpvLEnM+dRZKw+pf4jFH2Hd3UVym5KoSEA4CWAc5asjxGed+NdQ2nfTiIxQxZ7qy3/tLtYFyc1Ybu6lLiSKbBKnfB/KDhLv49CKlN/rDN6bAsKuhHCQlStDkoSp9arIeXo39pcWNbB1c7pfQg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB2955.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(966005)(71200400001)(110136005)(54906003)(76116006)(316002)(66946007)(86362001)(8936002)(2906002)(6636002)(66476007)(66556008)(66446008)(64756008)(186003)(4326008)(6506007)(52536014)(55016002)(8676002)(478600001)(53546011)(9686003)(33656002)(5660300002)(26005)(83380400001)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: dCg8P0IRwQ9nEuFsDrMxtlCCUCKMmeEjJi8sUJNnvjDndqtOg6EBc0ZAVsQSD1Yu36mjqaboxyxcuF0Fcud8aqNYjmicT3UfBCw6kv7D973PvT6cYzBc92ulcV3Eurk9bVfTMQvcT4JVUdrt26T9LZlIrExbbRcU7LzNYWOWC+LO2IW1RDTk09XKjEPbgGRZaxmPvrU9MO5D7V8MMlcyjHathLO16+sS+WGHrgmY/jXQzAQICbwAg+KtvemSEoeDWc1wb/kKjWOm9XZoywaTMddQDM2QmQBCg1VKoMdlxQsrm2rBl9th9DKbx/rQ2Nb9t/JoGq7hWWMy17Q8yHVVeW4meGW5caoWedmvL0ctXyelYrGpSWLlnmuJAIQPX9HU0UT3H9pwpku4hK10gJFUKoEK5ud7uDZQ76dwQW9xteIrKHTMcuZm8nbkv20JQZaQMzU3D13Jex6QlkOhyDWgrIWpHk3HZmBxq0UJVY24Dxbwx2JKr5vDYeyTApsQmD1k MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2955.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36cf7ced-52c3-42e5-67fb-08d81d54cce3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2020 00:22:12.3449 (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: sBPJz4Nc0vQEkl+JYDJeYeryHGDC62AP9GwJYtMbXBpEcx5h2pFcAG9TEXfwePTqi7uXwxzoKb8osS9Wr2vQsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3225 Return-Path: guomin.jiang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable So I think the key point is why AutoUpdateLangVariable() return success rat= her than fail, if is it reasonable for this case or we need other error han= ding? I am glad to help you but I can't reproduce it until now, can you provide = a step to reproduce it in simulation platform. If it is urgent, I suggest that discuss with your internal team first and = explain that we need consider the risk check it into edk2. Best Regards Guomin > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ming > Huang via groups.io > Sent: Tuesday, June 30, 2020 8:26 PM > To: Jiang, Guomin ; devel@edk2.groups.io; Wang, > Jian J ; Wu, Hao A ; Gao, > Liming > Cc: lidongzhan@huawei.com; songdongkuang@huawei.com; > wanghuiqiang@huawei.com; qiuliangen@huawei.com; > shenlimei@huawei.com; xiewenyi2@huawei.com > Subject: Re: [edk2-devel] [PATCH edk2 v1 1/1] MdeModulePkg/Variable: > Move FindVariable after AutoUpdateLangVariable >=20 >=20 >=20 > =1B$B:_=1B(B 2020/6/30 8:58, Jiang, Guomin =1B$B > Hi Huang, > > > >>From issue statement, I guess that > > 1. AutoUpdateLangVariable() invoked, and it will invoke FindVariable() > > first, at the same time, reclaim occur and Variable.CurrPtr is invalid= , it return > with success 2. UpdateVariable() is invoked when The old Lang's State is= valid > and the new Lang's State is also valid. > > 3. In the situation, FindVariable() checked Lang's State and only enab= le one > Lang's State. But it didn't in fact. > > 4. BmForEachVariable() deadloop in the situation. > > > > Am I right? >=20 > Yes, right. >=20 > Thanks, > Ming >=20 > > > >> -----Original Message----- > >> From: devel@edk2.groups.io On Behalf Of Ming > >> Huang via groups.io > >> Sent: Monday, June 29, 2020 2:06 PM > >> To: devel@edk2.groups.io; Wang, Jian J ; Wu, > >> Hao A ; Gao, Liming > >> Cc: lidongzhan@huawei.com; huangming23@huawei.com; > >> songdongkuang@huawei.com; wanghuiqiang@huawei.com; > >> qiuliangen@huawei.com; shenlimei@huawei.com; > xiewenyi2@huawei.com > >> Subject: [edk2-devel] [PATCH edk2 v1 1/1] MdeModulePkg/Variable: > Move > >> FindVariable after AutoUpdateLangVariable > >> > >> When occur reclaim in AutoUpdateLangVariable(), the CurrPtr of > >> Variable is invalid. The State will be update with wrong position > >> after UpdateVariable in this situation and two valid PlatformLang or = Lang > variables will exist. > >> BmForEachVariable() will enter endless loop while exist two valid > >> PlatformLang variables. So FindVariable() should be invoked atfer > >> AutoUpdateLangVariable(). > >> > >> https://bugzilla.tianocore.org/show_bug.cgi?id=3D2667 > >> > >> Signed-off-by: Ming Huang > >> --- > >> MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 26 > >> ++++++++++---------- > >> 1 file changed, 13 insertions(+), 13 deletions(-) > >> > >> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >> index 1e71fc6..0cec981 100644 > >> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >> @@ -2741,6 +2741,19 @@ VariableServiceSetVariable ( > >> mVariableModuleGlobal->NonVolatileLastVariableOffset =3D (UINTN) > >> NextVariable - (UINTN) Point; > >> } > >> > >> + if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) { > >> + // > >> + // Hook the operation of setting PlatformLangCodes/PlatformLang > >> + and > >> LangCodes/Lang. > >> + // > >> + Status =3D AutoUpdateLangVariable (VariableName, Data, DataSize)= ; > >> + if (EFI_ERROR (Status)) { > >> + // > >> + // The auto update operation failed, directly return to avoid > >> inconsistency between PlatformLang and Lang. > >> + // > >> + goto Done; > >> + } > >> + } > >> + > >> // > >> // Check whether the input variable is already existed. > >> // > >> @@ -2763,19 +2776,6 @@ VariableServiceSetVariable ( > >> } > >> } > >> > >> - if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) { > >> - // > >> - // Hook the operation of setting PlatformLangCodes/PlatformLang = and > >> LangCodes/Lang. > >> - // > >> - Status =3D AutoUpdateLangVariable (VariableName, Data, DataSize)= ; > >> - if (EFI_ERROR (Status)) { > >> - // > >> - // The auto update operation failed, directly return to avoid > inconsistency > >> between PlatformLang and Lang. > >> - // > >> - goto Done; > >> - } > >> - } > >> - > >> if (mVariableModuleGlobal->VariableGlobal.AuthSupport) { > >> Status =3D AuthVariableLibProcessVariable (VariableName, > >> VendorGuid, Data, DataSize, Attributes); > >> } else { > >> -- > >> 2.8.1 > >> > >> > >> > > > > > > >=20 >=20 >=20