From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.324.1573452681074220775 for ; Sun, 10 Nov 2019 22:11:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=auc04/oD; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2019 22:11:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,291,1569308400"; d="scan'208";a="207032011" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 10 Nov 2019 22:11:20 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 10 Nov 2019 22:11:19 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 10 Nov 2019 22:11:19 -0800 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (104.47.40.55) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 10 Nov 2019 22:11:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g7HnZcc8rXv9lUP3UdhSB+QF8noZWBjbVZ0N8mtG21qrAlHLl/aJFc8trjNRlBvEoGPYkj1KPVAJUHr1GwZENJJ9WN33AFALyGym2tK6a6gl+7IVCFZqAC0MGloZiKHrLXaUIl7Rp6GTppfU+ThOgJ6nx/5adABmAhPzetk/chsudx6MPQxMDHfYV09bNdO5/bBEjz9vd9OU0AFVI8h4FfIg3YolzzghNvzOaWB9hETdvKYql45BaOu68gClHGpLWke+bY+tZ3vxmNWZc7oA+MbUwZcUjFL7lqFg0w2lUI0cyvyu6xNNn4PeU0S/X5zhQ60kVVrwHIBNIhHXhCz+8w== 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=oVmNXyWoTeRmtrkRc8/uuMLLuBZn1iOkfVSSB9K6fVI=; b=L7d4wJlQYmNIUfzhdxf4TxTOaViMB/eizMxWYUPwKc0Qv5fIVrlaJ/PYHnoUjl1DpoOQDlFK5qwBiAajqgDqAwWsIUpPcy6V0uyvRpUaumA3qxKbpw9Q8pSEliAuBbh+CtFxKpTElK5Sr7tNw7eVLLWt56cdlro5l55o6MuX1txcX0ScgAcsRHf+/It2RTpA9BspxYo0wArs/hgW/NwXrG9MHvHReytGAxDr1HCR+bSDqdsRThNeIvc/oA1bE7NOIp9rBOOwDK6MWz9x6jaXPTknMQnXYc6FcIMbkNvqrpXP8B7/cRkMILqyfUVmOEn7YDhKrPqPruR3+sVdICHvmQ== 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=oVmNXyWoTeRmtrkRc8/uuMLLuBZn1iOkfVSSB9K6fVI=; b=auc04/oDdGibkTGDm08UkDULfGRGpka46LhglsYmqsDLeDdG5LCiq/53kf4icluDzyiqe8xuV0IospBV3dVwr5EDNnVYXrVXSVOvKOllJFrkH4lPmBo3ZqwE7kKIiVwSt1mOuVbt09TehaQX2jIsiwCoITpzvG/OUpm4tF58sqs= Received: from BY5PR11MB4484.namprd11.prod.outlook.com (52.132.254.155) by BY5PR11MB4038.namprd11.prod.outlook.com (10.255.162.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.25; Mon, 11 Nov 2019 06:11:17 +0000 Received: from BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::c1ef:6e0b:90c8:55e2]) by BY5PR11MB4484.namprd11.prod.outlook.com ([fe80::c1ef:6e0b:90c8:55e2%7]) with mapi id 15.20.2430.027; Mon, 11 Nov 2019 06:11:17 +0000 From: "Kubacki, Michael A" To: "Gao, Liming" , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Wang, Jian J" , "Wu, Hao A" Subject: Re: [edk2-devel] [PATCH V1 1/1] MdeModulePkg/Variable: Fix volatile variable RT cache update logic Thread-Topic: [edk2-devel] [PATCH V1 1/1] MdeModulePkg/Variable: Fix volatile variable RT cache update logic Thread-Index: AQHVmE8xR9YeOpMBmUyU1dFIoHwO4qeFe/awgAAApDA= Date: Mon, 11 Nov 2019 06:11:17 +0000 Message-ID: References: <20191111051620.37748-1-michael.a.kubacki@intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E53C580@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E53C580@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGY0NjIyN2YtNjA3Yi00ZTkyLWIwMjMtNWQ2ZDVmMjI0N2VhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY2xxY29nUUNGSUhqOXdLSHhXZytLRml3WndSQmkxSHQzQVFoUDFUdFRcL2N5YkZ2bUxjVVhrdDZOS2hTRm54alAifQ== dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e77061ae-1ce5-4efe-42bf-08d7666df707 x-ms-traffictypediagnostic: BY5PR11MB4038: x-ms-exchange-purlcount: 3 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0218A015FA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39850400004)(136003)(346002)(366004)(376002)(189003)(199004)(13464003)(15650500001)(81166006)(66066001)(8676002)(81156014)(476003)(8936002)(110136005)(71190400001)(71200400001)(486006)(99286004)(14444005)(256004)(446003)(11346002)(2906002)(7736002)(305945005)(54906003)(26005)(102836004)(316002)(76176011)(186003)(74316002)(7696005)(86362001)(53546011)(6506007)(33656002)(6436002)(52536014)(966005)(14454004)(478600001)(5660300002)(2501003)(6116002)(3846002)(9686003)(6306002)(66446008)(64756008)(66556008)(66946007)(66476007)(55016002)(76116006)(107886003)(4326008)(25786009)(229853002)(6246003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY5PR11MB4038;H:BY5PR11MB4484.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HydQNdZ1PG/06JH79FkDCQVMqIkk1iGj7jLgtJZpcqK+Tw3f7gy9/JKBI2RKkttI47KRhIkrzk3SD+9mmv1NM5m9Aagp5uvjBUGtqTzf55eUsbjWrlMUxv2gkvdkcXyXmFaLnTvlx85rEGBUpxwcwEzejReH5Zra8NqNKh0c6pdj21J1PqZqlZVx15T4Rsbmepf70j2spXWv+jTECcFjeq8I1dKPEZYqBc+SUpmdJG3/3fNadfDezVhRE5ber93FBqhbnSojSETjvoWld5IoFAYqnqrH8gMOSoJIjK6bSNokzFPkRFmdm4JTyMgT0fs4unC+lX0GM7/1SPyhXgKjbWkugJb2GcRKVbgzxZpOloYMlsOxaLZ8+1xF5BSJ9IsQUCACU4q0CeyyvTZ2IN0W9Iy3Xet3Svj3bgfbRkTcTD/lRZW0AOLuW/EBpmBBL81xmi/K7o4hzVvIgiEE4GpIyUB7JQ6nsbewK2RHnQV01Ew= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e77061ae-1ce5-4efe-42bf-08d7666df707 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2019 06:11:17.5232 (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: nJs9eYgiwVWpH7z2DnZ26e1AeqTsW+qi00ZKDmxNwRq5daltegIOtfxz3jI9pD2z4EbvKJ7lH8fzcJ46nUpZbNSPig4Za7o9iFuPQsISIA0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4038 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable After a new volatile variable is written successfully, Runtime Services Get= Variable () may return EFI_NOT_FOUND for that variable. Thanks, Michael > -----Original Message----- > From: Gao, Liming > Sent: Sunday, November 10, 2019 10:08 PM > To: devel@edk2.groups.io; Kubacki, Michael A > > Cc: Kinney, Michael D ; Wang, Jian J > ; Wu, Hao A ; Gao, Liming > > Subject: RE: [edk2-devel] [PATCH V1 1/1] MdeModulePkg/Variable: Fix > volatile variable RT cache update logic >=20 > Michael: > What real issue is caused by this issue? >=20 > Thanks > Liming > >-----Original Message----- > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > >Kubacki, Michael A > >Sent: Monday, November 11, 2019 1:16 PM > >To: devel@edk2.groups.io > >Cc: Gao, Liming ; Kinney, Michael D > >; Wang, Jian J ; Wu, > >Hao A > >Subject: [edk2-devel] [PATCH V1 1/1] MdeModulePkg/Variable: Fix > >volatile variable RT cache update logic > > > >REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2333 > > > >During a SetVariable () invocation, UpdateVariable () is called. > >UpdateVariable () contains logic to determine whether a volatile or > >non-volatile UEFI variable was set so the corresponding runtime cache > >can be updated to reflect the change. The current logic simply > >evaluates Variable->Volatile to determine which runtime cache should be > >updated. > > > >The problem is Variable->Volatile does not always reflect whether a > >volatile variable is being set. Variable->Volatile is set to TRUE only > >in the case a pre-existing variable is found in the volatile variable > >store. Therefore, the value is FALSE when a new volatile variable is > >written. > > > >This change updates the logic to take this into account. If a new > >variable is written successfully, the Attributes will accurately > >reflect whether the variable is non-volatile. If a pre-existing > >variable is modified, the Volatile field will reflect the type of > >variable (Attributes are not reliable; e.g. 0x0 indicates deletion). > > > >Cc: Liming Gao > >Cc: Michael D Kinney > >Cc: Jian J Wang > >Cc: Hao A Wu > >Signed-off-by: Michael Kubacki > >--- > > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > >diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >index 29d6aca993..75d33ff724 100644 > >--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > >@@ -2296,9 +2296,8 @@ UpdateVariable ( > > > > Done: > > if (!EFI_ERROR (Status)) { > >- if (Variable->Volatile) { > >- VolatileCacheInstance =3D &(mVariableModuleGlobal- > >>VariableGlobal.VariableRuntimeCacheContext.VariableRuntimeVolatileCac > h > >e); > >- } else { > >+ VolatileCacheInstance =3D &(mVariableModuleGlobal- > >>VariableGlobal.VariableRuntimeCacheContext.VariableRuntimeVolatileCac > h > >e); > >+ if ((Variable->CurrPtr !=3D NULL && !Variable->Volatile) || > >+ (Attributes & > >EFI_VARIABLE_NON_VOLATILE) !=3D 0) { > > VolatileCacheInstance =3D &(mVariableModuleGlobal- > >>VariableGlobal.VariableRuntimeCacheContext.VariableRuntimeNvCache); > > } > > > >-- > >2.16.2.windows.1 > > > > > > >=20