From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.42543.1590453590633148898 for ; Mon, 25 May 2020 17:39:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kHtzXIYy; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: guomin.jiang@intel.com) IronPort-SDR: rtDpCpiueW8pBt3GOudcMLFIUnuSpD1yfMcvudAtwHg+EmuFedBzu1ryRGrDoLx3j5cUAdKkNN auDdsYfAXqAQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2020 17:39:49 -0700 IronPort-SDR: mTWcdDiBGEJ3Wqk2OUGOB0VYNvS/jdo3VDNOL2f1pKBL3ms/QYJwE2TW2ZQ2BzGRiGJP/1i4lb S1AyETdOKNUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,435,1583222400"; d="scan'208";a="255230815" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 25 May 2020 17:39:49 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 May 2020 17:39:47 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 May 2020 17:39:47 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.52) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 25 May 2020 17:39:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=byac2dPuyEw5fUe8JCYHzoRFemer6zAx4M+kNFwMDoi/+MeBCmQBHguEbwPnmIsJAmd+UqEA3ACo2BFYuD06+SnlTiNyY3HLhx9RaYJdvnQ2zXQBDovVKnUqPpdWyJK9m7T3pHEbLwflXCRlxKeibx+Cj9vtcQiXWcVOu3YsWfCb942xXibXYWFOdJ827U3KIVMyqyMi+ji3KLpdLCKK8r9cW36VpXydQJXz1a2WqHoEW0pF1kc6Hz1zuFWNbDFqtRShvWoDeD3oBopOg74EYhNaHzoSQouzWSwRgo+rQlDKhaIQMXOPykUObcHOQ5/GU7Z2jAgiwc/MaX1G4xyQKA== 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=VHz9x4Q3NRjsxW4IxeBp+fdYmzy8zmniliu3ZIDZU58=; b=Egsz1o4FHSeLhEdzhPxrc3VvHOHXyjm56sZHVsym2oH5e15GyfQPZ4LuOn5raEo1zFWsaMBwPB2ey4MTZGZWWL5sBP7iN7cd/a0Pr1cjLFV9fPatcbppMrIL3qCx5FL9m81r9dTODrgmSEfXId11J6r6C4wnf+sXBsCdgaTeFeFyTc2AbFRXwyY0+p8LO4gIhGYA3LlGsPehthGEEB0OEaUez7JpnCYnB2X5pYyC6ccNS+Ob5+VNQ4tt3GSC21FY1jXRSC0Vmsv7xVd1Z9s105dzv0ApEA0PAt9mkaV1GMKhC7AZYb24GOYHb7ZmSeyftMQIeNoR+AHMgNZA+N0z7Q== 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=VHz9x4Q3NRjsxW4IxeBp+fdYmzy8zmniliu3ZIDZU58=; b=kHtzXIYykGHHKGyytO4w0rspqyzBuPYS75EuD/z9SdCpEvnM1llTpJyE5NizldSPYZHOkGLZ4xm1v8S5fRAkr2+TCbhhUS3GZ0euFhYDk+3ueXy5n5gSFJ54kJyouSBidI9TRe9BqzMmRlSMdScU69tGf95Sje1meLlPOzcw92E= Received: from DM6PR11MB2955.namprd11.prod.outlook.com (2603:10b6:5:65::31) by DM6PR11MB3626.namprd11.prod.outlook.com (2603:10b6:5:146::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Tue, 26 May 2020 00:39:46 +0000 Received: from DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::ccd4:4b0d:535a:58be]) by DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::ccd4:4b0d:535a:58be%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 00:39:46 +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" Subject: Re: [edk2-devel] [RFC edk2 v1 1/1] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Thread-Topic: [edk2-devel] [RFC edk2 v1 1/1] MdeModulePkg/Variable: Move FindVariable after AutoUpdateLangVariable Thread-Index: AQHWMsFvbq6pcyHFpESN4fR/yKH0Yai5hQ8Q Date: Tue, 26 May 2020 00:39:45 +0000 Message-ID: References: <1590406458-59742-1-git-send-email-huangming23@huawei.com> <1590406458-59742-2-git-send-email-huangming23@huawei.com> In-Reply-To: <1590406458-59742-2-git-send-email-huangming23@huawei.com> 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.55.52.196] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4552251b-0036-4121-e46a-08d8010d4a06 x-ms-traffictypediagnostic: DM6PR11MB3626: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 041517DFAB x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fjKTpbtIcmxRfxORJSGeQ/w8FTvLCnffc82Ck7KkLWOayyzwR9JNLDpT6l4cLaMxdBpndN/zYUPQGjblDawvplCdMVpW9Ae5msjnzxIetkm8bN1jnZL2HXAsKThv51brOPE59b3NL1uSTg80ogejekkRzWxi1psX866G+eU1H7d7n35p+1ivVFS6APYnFoeZv8qzxxwmWuxNwlq+yj6ZSzVAqa30hB7hN6PHzncRVRYY98nJHdMNubTIZcF0/Q0tPiZkphjZqHFgviYWBJFMdX19gtpHRKhGabLcrLrWQh1o/GPM93VeTtZ2yyDY3ful+EaQ2Bq2vgzv3dnLpa5E/uZCIwp+Zs9/leybEhh/5lmoGWvXtxvqI2LvAKqoJfQu9LZBWgUJ33fs46zvKFZyFg== 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:(366004)(396003)(346002)(136003)(376002)(39860400002)(4326008)(6636002)(6506007)(966005)(7696005)(71200400001)(55016002)(33656002)(86362001)(52536014)(53546011)(478600001)(26005)(186003)(110136005)(66946007)(76116006)(66556008)(316002)(5660300002)(8936002)(8676002)(54906003)(2906002)(9686003)(66446008)(66476007)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: MHmroj+4Ypa5A3bQ6CqzTb3tPc/kAW+Aph1FqY3am2w+mpksfe4/dfWcb+10/9FpQMqbh/VjMsZGZ6fwizYY3o6vhypa825hDmK/7SYCJ2xBasflLYOVbCTxLN0RYVPEQ5iAnQEm/jSkerpBjN4rwjKIyGdkOQFoSM4fWcT4UaU3dIJMqbAOUTper2v2WtFHHBnzkJ3K65BFa7LtKLG9glPKjlg+VPRrC7VMkce4sVFQhIbzXfiNVQMQVvlDI6+8RAJxCNoHUlS5HHu2wsVesrS/4jVamU3TuvqDxaWMsVVLzT7mZUZiwmEvH5XxdjaJ2/1za0wUJQ/xDYzSltevnIqtH9xGHCejmqRVUQPfdHZhzUF98IUWkwmzwzuOYtYKrb3jmPsd0p1eKn29Ouk96Yqb95uoMOs7zT4yB9/LX3DvfJO+k7CO3omkkinPE/uio//X0vkVl1nzmBIriGENZ42i6kN83ONI8fdyIT1OfiA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4552251b-0036-4121-e46a-08d8010d4a06 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2020 00:39:45.8924 (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: cWS2/gp8jkXeT01tbmB/S0hDOszy8meFTaI3QWrFrYBHfOUn/7axT1C9i/8liFJANrdnipmGuLJGZ57J/mu6rg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3626 Return-Path: guomin.jiang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Huangming, I am taking the bugzilla and I am sorry that I haven't provide you with pr= oductive comment. I am still busy until August. I just want to know that: 1. Have you verified that the symptom will disappear after invoked FindVar= iable() function? 2. Is it your suggestion that the FindVariable() need to be invoked but yo= u have no idea that how to fix it? Best Regards Guomin > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ming > Huang > Sent: Monday, May 25, 2020 7:34 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 > Subject: [edk2-devel] [RFC edk2 v1 1/1] MdeModulePkg/Variable: Move > FindVariable after AutoUpdateLangVariable >=20 > When occur reclaim in AutoUpdateLangVariable(), the CurrPtr of Variable = is > invalid. The State will be update with wrong position after UpdateVariab= le 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(). >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2667 >=20 > Signed-off-by: Ming Huang > --- > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 26 > ++++++++++---------- > 1 file changed, 13 insertions(+), 13 deletions(-) >=20 > 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; > } >=20 > + 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 ( > } > } >=20 > - 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 inc= onsistency > 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