From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.3862.1607674337450068297 for ; Fri, 11 Dec 2020 00:12:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=REfcK5sX; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: hao.a.wu@intel.com) IronPort-SDR: ipPrj92BTLeWYCFsZRnE6ZK42SAUsdZopySIDbH3KZX2X0aVDfECHLKf2S2JQXO/sDB9qwMBk8 do6/ZsmBN60Q== X-IronPort-AV: E=McAfee;i="6000,8403,9831"; a="174541649" X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="174541649" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2020 00:12:16 -0800 IronPort-SDR: g0KBRTzLJqHwTkA2qLBMgwcTqhQdizt1Qby9V2100UEq9/ISpSJIcIV+bcwzBntjHNvtncvnxf ySJuy4ScryyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="379425318" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by FMSMGA003.fm.intel.com with ESMTP; 11 Dec 2020 00:12:16 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Dec 2020 00:12:14 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Dec 2020 00:12:14 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 11 Dec 2020 00:12:14 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.51) 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.1713.5; Fri, 11 Dec 2020 00:12:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N91DaQA6M8kj2JMBcagMjmPBxPahFOrdS1mKRRfFRT5BpmEvL5X+umlSY6P7P+RcW6li6VyzdbgegHxat8JpsYDDzyKORWB0gAVdS8hTYHfAuiwp2AwLiAyRgkqk89DNWxZdk3ArIxQquYpyF+/rs6YLLsjoHxsTIe0Z298yot+1dY2xMrNFu+GwVeVZSzbA2fXl8TdvzKoToITdIUNw+U/P0QP393UVri9UF0JZQnUbmjubd2KMzA6Mdmm5pzMOuwGghCqKVw4bNZfRvxpi/ZblitfUefgIPJnx09pHWGK+ZtHUG4JpmdpnsNG0fSrTP9G9n4bK07IR0If3FWLgpg== 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=EXb4jKONL9lGWec5U4LkkTortNpRQpoEo43DIt7KkA8=; b=cZEw+IDAqGRrK08to5J0XTnOV+seoFBYI41WNw1eyS9IWqjgGZdSKgfBr6g2exnY1Rm7pPKS7wY+ltsNxmjKAwUZroNJid56VmeA8KDYG6Zc7MSeOl8rcCvxfMPIdXVxItrKu4Qqo/mgadiAmUipzFP527u2nB+5YBkVKN9IjbQGNmWsVcqMMQ2JFsyokyUXpvCdfs4bq4+2MBOh0CM5qx3PhTvOblogcY8fxJ6MLDd0yKUK+Dc7V7CxHYERtisnPoVgtQ9sVnqVaIooLXFk0WmXCsJmcdXzthm5T7WB9A/76TvQF4jpqhKtJCOesSxSQAueU922LOJwyQMfai8DVg== 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=EXb4jKONL9lGWec5U4LkkTortNpRQpoEo43DIt7KkA8=; b=REfcK5sXU5CgQ5h6ZUN/1ZfhRYPnIWWqJ4V8UddoJlTf4RHCYpL5hYCJwWBcFuKIdWPNfSvVgmU7jyhgUDQrmiKyB2zm2C1F8AUpjInCNaXczSklZm3z0sWtLl4okabjmrx9wyAs5V2eaFYgtxS/ek5d4mnU+Uw9+3BsDsxrD7s= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN7PR11MB2721.namprd11.prod.outlook.com (2603:10b6:406:ba::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.14; Fri, 11 Dec 2020 08:12:13 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::4cda:993f:ffc1:f169]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::4cda:993f:ffc1:f169%6]) with mapi id 15.20.3654.014; Fri, 11 Dec 2020 08:12:13 +0000 From: "Wu, Hao A" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Liming Gao , Bret Barkelew Subject: Re: [Patch v4 0/2] MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behavior Thread-Topic: [Patch v4 0/2] MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behavior Thread-Index: AQHWz5PWJwsLUw7nLk+u4zVjyyiRrqnxi2rA Date: Fri, 11 Dec 2020 08:12:13 +0000 Message-ID: References: <20201211080118.1885-1-michael.d.kinney@intel.com> In-Reply-To: <20201211080118.1885-1-michael.d.kinney@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 69191371-9e21-4a90-f340-08d89dac773b x-ms-traffictypediagnostic: BN7PR11MB2721: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: buBx2KTTVTZET1RZFQPZLH5ZOK4BZPzz8Y6PecgNL0zpTiX/IkCfv6jOL1MUU0xyl9PUqW2q3KngC5og7oKzhFr46+v0YVPz7W4pMqPUC499d1P04RNlMNwUlAsVqMD2MMzYrIlNRF1oJY5iRbJgBx9dCXxdzljesiDmCTKKhK8BPEUqGZyaJbzYUcU4ktBDqazGQ2jHiwEjONagrJTUGxjOGcZTG6kXwe9WgrHZJeBmRkb996H3BVC7LDzlSE33e9sVcMcySnO93YfVS1Gr2749gBmvajeZmuupHSShOdlNgrAkvkp+S2obVBk/Q4WwVG4st1iy6zybub01i0FGSzp45IyFDEq2TuxKiXUUraqn8OVp08nNBzjEibZOPvF0khkR+19YuvL16Gi0mE89zQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(136003)(346002)(33656002)(4326008)(64756008)(83380400001)(53546011)(66446008)(9686003)(52536014)(5660300002)(66556008)(7696005)(71200400001)(55016002)(6506007)(2906002)(8936002)(54906003)(66946007)(110136005)(8676002)(966005)(26005)(508600001)(76116006)(86362001)(66476007)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?aE6xDenUT7fsTXZbYeoloBiOIvALZ+zN2AckG9n4o7Wnv//0YGgixoEaeEDv?= =?us-ascii?Q?e3EzahnksEYUx0jiicfgZZPl3UQl8z2cFHhkm+y/fBBTH+qOhtOrpFv6jo3i?= =?us-ascii?Q?zao7vHyjwxbDYduJiQvmYmvYWYnDDP6sm/qthPVi9DsDzFOW0Q9gvrCbS4TW?= =?us-ascii?Q?lQoj7VUR9xD4IPzfTr6930Vrt4cLJSPqFtkIT6+kh1OlRD5vGh7qioe5wCUP?= =?us-ascii?Q?qrhcxc1hurFDZSsJhvw+i4pStrS+2YthbguXZz/yazjmhLTMMOfJb2MaHDGB?= =?us-ascii?Q?iI6pngTio1vhgcRJa0D8ZDzL4yb/ZQTjJw5FjWtfWwvwwAWob26+4xpSQ87A?= =?us-ascii?Q?BwyffTJBNLrZ7SPgfqkSe0MRtKaCyFR7uD78UsVr5sIAx+Y0vOsRuwGT85Q6?= =?us-ascii?Q?0aJVs1AYmrq+ZWRPD7HBncyrotSd4aZ34FZTxo0SmAVVrJIP3WfjuN64DD6U?= =?us-ascii?Q?9sbqXIrwhdkaA33dmU2Pufg1Q6ryDkqvXwy1HHWqJGAJFB35BLwBJO3TMIdb?= =?us-ascii?Q?mJ2vzGh1n6VXpVSePuR5mYRAfsiAKTJjbv70/ytLl4HACCBxcNvzyjU66Pa7?= =?us-ascii?Q?986S78bc6sw6GaLMSOMQfo+/Ht2+mxoJ+XRObEG/SFO7+d2koQo+ZUaN2j8F?= =?us-ascii?Q?lkDo26vLyPurSt3XndLbBvAmnJuTVdiRTKHI1rSEm7g82G/HEAlei5eLAuC0?= =?us-ascii?Q?pSnhIWxCDTcuhD4+LKd50jEaew/QNQJODoWJkJTp8nGD0UuRKmMvqGaAU/oD?= =?us-ascii?Q?Q7owSdTC53JyGB0Kbb0RNT8173t5IdGkcvDlVuTayodOAGhxewf+aR/7kTHJ?= =?us-ascii?Q?2VHXJY/7agrV3c641kSKZ0j1+7jbKB1h+ZsLg02c0+9wVAWNVHWgik0OX9IF?= =?us-ascii?Q?g+2FOkm/2EXSuPKzdkoasqsLhOYMU1fm8WWt4ysKmOIf9j6flGg5ob+V3Pfe?= =?us-ascii?Q?9JUrcmc7Q6K18IizZ+m35ujf43Y4jKcFWubBJFl8seo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69191371-9e21-4a90-f340-08d89dac773b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2020 08:12:13.1649 (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: JAeOkkqmBKsxse/+t1xV8vmn9F9Egm4WCizb0hzq9eGkwQTaoFPhQWb+nfSl0tIZO71i7ybB0bTyUW981ciNfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2721 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable For the series: Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: Michael D Kinney > Sent: Friday, December 11, 2020 4:01 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Liming Gao > ; Bret Barkelew > > Subject: [Patch v4 0/2] MdeModulePkg/Variable/RuntimeDxe: Restore > Variable Lock Protocol behavior >=20 > New in V4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > * Fix spelling in unit tests > * Call ValidateSetVariable() with DataSize=3D0, Attributes=3D0 >=20 > New in V3 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > * Split into 2 patches. One for code change. Second for unit tests. > * Remove duplicate code and use ValidateSetVariable() to detect if a > variable is already locked. >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3111 >=20 > The VariableLock shim currently fails if called twice because the underly= ing > Variable Policy engine returns an error if a policy is set on an existing= variable. >=20 > This breaks existing code which expect it to silently pass if a variable = is locked > multiple times (because it should "be locked"). >=20 > Refactor the shim to confirm that the variable is indeed locked and then > change the error to EFI_SUCCESS and generate a DEBUG_ERROR message so > the duplicate lock can be reported in a debug log and removed. >=20 > Add host based unit tests for the multiple lock case using Variable Lock > Protocol, Variable Policy Protocol, and mixes of Variable Lock Protocol a= nd > Variable Policy Protocol. >=20 > Cc: Michael D Kinney > Cc: Hao A Wu > Cc: Liming Gao > Signed-off-by: Bret Barkelew >=20 > Bret Barkelew (1): > MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol > behavior >=20 > Michael D Kinney (1): > MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit > Tests >=20 > MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 11 + > .../VariableLockRequestToLockUnitTest.c | 565 ++++++++++++++++++ > .../VariableLockRequestToLockUnitTest.inf | 36 ++ > .../RuntimeDxe/VariableLockRequestToLock.c | 95 +-- > 4 files changed, 671 insertions(+), 36 deletions(-) create mode 100644 > MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Vari > ableLockRequestToLockUnitTest.c > create mode 100644 > MdeModulePkg/Universal/Variable/RuntimeDxe/RuntimeDxeUnitTest/Vari > ableLockRequestToLockUnitTest.inf >=20 > -- > 2.29.2.windows.2