From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=216.228.121.65; helo=hqemgate16.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 90C99211AEA61 for ; Fri, 4 Jan 2019 14:17:19 -0800 (PST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 04 Jan 2019 14:16:57 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 04 Jan 2019 14:17:18 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 04 Jan 2019 14:17:18 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 4 Jan 2019 22:17:18 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 4 Jan 2019 22:17:17 +0000 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.53) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Fri, 4 Jan 2019 22:17:17 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com (20.177.125.220) by BYAPR12MB2886.namprd12.prod.outlook.com (20.179.91.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.9; Fri, 4 Jan 2019 22:17:16 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::d51a:3dbb:3b90:178b]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::d51a:3dbb:3b90:178b%3]) with mapi id 15.20.1471.021; Fri, 4 Jan 2019 22:17:15 +0000 From: Ashish Singhal To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Fu, Siyuan" , "Wu, Jiaxin" Thread-Topic: Uninstalling Invalid Protocol Interfaces Thread-Index: AdSjtn8ScFpTlPkrTXiCI2Fb6Dn4GwACtD8QAABPn1AAI4iZYAAApWVAAAn1TAA= Date: Fri, 4 Jan 2019 22:17:15 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ashishsingha@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2019-01-04T17:32:42.2518453Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic; Sensitivity=Unrestricted x-originating-ip: [216.228.112.21] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR12MB2886; 6:nEx1A5xOxeO69hC3HgpZB/Iq0dGdlD7Vk5MHBZ8S5Zxm5+y+ZpNVMJckun9GfQYQWkQvxL8/b0xXNrjgQC0hYqFt7aYdsWt339wOR3ToitEB1+a7PbXY7alPC79mEGbZmx3ALx9+7V0KtEcB08zaoV/lEQIR1Whfp2/nLo+VZeFtICqCj+nWNl5L3BD79HjCVwIYPmTXSojTuPeaOxZDoVjMUGySKND8RKSg20B7n4rFyxjUddKdC76sd7UZYVIpgqSa0vbj8v/wkInkrQ7zzDXmfurZpETg8nADWG0hiOU4FTfixcPPm8eDi9t8yA2qEM7cHSXsKabq3PXYQXrnf30TgfXyQX7tKczXKn1Zy+zmBTVSbQeh8wsQSRl04dpo3cXkf89VMkEG71uZ4hYmdG5YNfkGkLw4+oqm/fZWIiiVpFJ94qzwXsjlXk34CLl1RkHEGzGzjZ7Sw8RyW4U31Q==; 5:TmwRxjk9EcW2h97UU/gus1gFpmZ9HnUpyHucyLdfTt/OIJItk9pPrBGjUagS5B95Yl8QQwX72kpQVrw0rh/Uiw7YJbQpkmkAbcNuj3fn+1pGvry6JpCVAaf0LOHSCAgK41iCGNFsJl41PUqvX0nmxLR2dKAMjl1obV8WDEaR2C1kJy//BD3PDUOBFpfcFWu1ywgoVYmZ0Bcwcqn7k4YWaA==; 7:Kp3Z4DtNCj7c9Thnw6vPFT1kNItkgAbcpveHTkvz8LYBqPz09seIOi2d0BlPgeA8C1hAacARTRzcC9Vhzp//MN5s2QNGWeTRnPNUWMZh+uUPuRsDrz86uTkS72ig/uXiZckqClYYagJ94qeNBXhBoQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e49c8dc2-40c8-449a-7e81-08d672926250 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR12MB2886; x-ms-traffictypediagnostic: BYAPR12MB2886: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:BYAPR12MB2886; BCL:0; PCL:0; RULEID:; SRVR:BYAPR12MB2886; x-forefront-prvs: 0907F58A24 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(376002)(39860400002)(346002)(189003)(199004)(51914003)(97736004)(2501003)(71190400001)(71200400001)(6246003)(8936002)(2906002)(53936002)(478600001)(3480700005)(14454004)(8676002)(81166006)(81156014)(4326008)(11346002)(966005)(446003)(486006)(5660300001)(476003)(7696005)(76176011)(6346003)(106356001)(6506007)(53546011)(26005)(102836004)(105586002)(186003)(55016002)(99286004)(6436002)(68736007)(14444005)(229853002)(256004)(19627235002)(316002)(110136005)(54906003)(7736002)(66066001)(25786009)(74316002)(33656002)(93886005)(9686003)(93156006)(54896002)(6306002)(2940100002)(236005)(606006)(3846002)(790700001)(6116002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2886; H:BYAPR12MB2743.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: fcxczC/L4DGCpMV9N77USk0us+Kcx7UQcSQ2DfjkCxdRRWzy0Umu2v4NQpDNdmeVo/FF5RSd5/lE/MCfiKpPPM1kiRuIbI30OWivXZaLN3xi7WwmyiwwIwH3t5bzuibbYMToQ4obN9b+XibT9rLhiT1AruQ+z36Y37vlEc/MKLmiuXguYp58IrGDWlQcY4G5l+pQ6eB8aEGqc/4goU+Q4T821RcJ2ZSZL+edEtiPAZ21FGSbtQsPZfCoa81xnb4U0aceKcYU8MQWYRXdUvfCiS5WS45lcVBF4QVzt09hV+Wq5f0CLfhJJ+zAXw/8HaIf spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e49c8dc2-40c8-449a-7e81-08d672926250 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2019 22:17:15.8331 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2886 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1546640217; bh=Pr6IKeTQ8x4Snieiwcn+Ed2F3DpTdAgiDdBMLf99fsQ=; h=X-PGP-Universal: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:msip_labels:x-originating-ip: x-ms-publictraffictype:x-microsoft-exchange-diagnostics: x-ms-exchange-antispam-srfa-diagnostics: x-ms-office365-filtering-correlation-id:x-microsoft-antispam: x-ms-traffictypediagnostic:x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test:x-forefront-prvs: x-forefront-antispam-report:received-spf:authentication-results: x-ms-exchange-senderadcheck:x-microsoft-antispam-message-info: spamdiagnosticoutput:spamdiagnosticmetadata:MIME-Version: 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-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type; b=R00SNzqTBeMLvkmsdCWBpD2+DbrDbc0HQqeGCsWpf/Vyfjec4B1RuwUPgm53Dhyej pT3RUsUlecgQ/3JuRtrmbbNFnLon4PzW+kDjr0fpC5dsty9kx/g5mhv6uV10K+5MXf 12i6NPrebyJUyQ8B8kmWz3N62CwLHzY5fwmJk+l4zHC5x/tKSE27x33vyG7LdMfVAP l6esfQKnbQ6TToFfOZcYaRQWANCRCw+swlXqhb/MG5Zbq7O1vENBZFPtHgVFKl93O0 bVWLAL+SdVe9xEK2xJb1Y/oFNzBQ3yPXZtRZCQSdQnhY9bb5lpyK8dZFOliAYPMP/M 78HZAL0qTp31Q== X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: Uninstalling Invalid Protocol Interfaces X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 22:17:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Mike, I have addressed the issue along with some optimizations and have submitted= patches for review. Thanks Ashish From: Ashish Singhal Sent: Friday, January 4, 2019 10:33 AM To: 'Kinney, Michael D' ; edk2-devel@lists.01.o= rg Cc: Gao, Liming ; Fu, Siyuan ; W= u, Jiaxin Subject: RE: Uninstalling Invalid Protocol Interfaces Mike, I have filed https://bugzilla.tianocore.org/show_bug.cgi?id=3D1428 and http= s://bugzilla.tianocore.org/show_bug.cgi?id=3D1429 to address this. I have a= ssigned these to me as I already have fix for these. Also, how do we ensure all components which may have this issue (may not ha= ve exposed it yet) also absorb the change? Thanks Ashish From: Kinney, Michael D > Sent: Friday, January 4, 2019 10:15 AM To: Ashish Singhal = >; edk2-devel@lists.01.org; Kinney, Michael= D > Cc: Gao, Liming >; Fu, Si= yuan >; Wu, Jiaxin > Subject: RE: Uninstalling Invalid Protocol Interfaces Ashish, Thanks for the pointer. I agree there is an issue here. Please enter a Bugzilla against the IScsiDxe module for this issue so we ca= n fix this failure. You are also welcome to enter a Bugzilla for a feature request to add UefiL= ib APIs that can be used to safely uninstall all the driver model related p= rotocol that can be used in error paths in the entry point and in unload ha= ndlers. Thanks, Mike From: Ashish Singhal [mailto:ashishsingha@nvidia.com] Sent: Thursday, January 3, 2019 4:16 PM To: Kinney, Michael D >; edk2-devel@lists.01.org Cc: Gao, Liming >; Fu, Si= yuan >; Wu, Jiaxin > Subject: RE: Uninstalling Invalid Protocol Interfaces Hi Mike, Call to UninstallMultipleProtocolInterfaces at https://github.com/tianocore= /edk2/blob/master/NetworkPkg/IScsiDxe/IScsiDriver.c#L1864 fails because the= component name interface may not be installed depending on the state of PC= D. Thanks Ashish From: Kinney, Michael D > Sent: Thursday, January 3, 2019 5:09 PM To: Ashish Singhal = >; edk2-devel@lists.01.org; Kinney, Michael= D > Cc: Gao, Liming >; Fu, Si= yuan >; Wu, Jiaxin > Subject: RE: Uninstalling Invalid Protocol Interfaces Hi Ashish, Can you provide a pointer to the UninstallMultipleProtocolInterfaces() call= that is causing this failure? I agree that the UefiLib could provide additional services to simplify the = implementation of the unload handlers. Matching the UefiLib APIs that inst= all the Uefi Driver Model protocol would be useful, so the driver entry poi= nt and the driver unload functions can use matching APIs. Mike From: Ashish Singhal [mailto:ashishsingha@nvidia.com] Sent: Thursday, January 3, 2019 3:39 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D >; Gao, Liming >= ; Fu, Siyuan >; Wu, Jiaxin = > Subject: Uninstalling Invalid Protocol Interfaces Hello, As part of moving from MdeModulePkg implementation of IScsiDxe to the imple= mentation in NetworkPkg, I started hitting exception in the driver loaded a= fter IScsiDxe if IScsiDxe's installation fails for some reason. Upon debugg= ing, I found out that calls to UninstallMultipleProtocolInterfaces as part = of Error 2 as well Error 1 fail while trying to uninstall component name pr= otocol-interface pair and return error code EFI_INVALID_PARAMETER. As per U= ninstallMultipleProtocolInterfaces's documentation, if uninstallation of an= y of the input protocol-interface pair fails, it will reinstall any just un= installed protocol and return EFI_INVALID_PARAMETER which causes the cleanu= p of this driver corrupt leading to failure in next driver getting loaded. = The reason of failure in UninstallMultipleProtocolInterfaces is because the= driver uses EfiLibInstallDriverBindingComponentName2 to install interfaces= which may not install component name interfaces depending on the value of = PCDs PcdComponentNameDisable and PcdComponentName2Disable. I have the follo= wing proposals to get around this issue. 1. Instead of calling UninstallMultipleProtocolInterfaces once and list = all protocol-interface pairs, do it sequentially for every pair so that the= once which was installed correctly, gets uninstalled instead of getting re= installed because of a failure uninstalling another pair. This would howeve= r make us not really use use UninstallMultipleProtocolInterfaces API to its= full caliber. 2. In UEFILib, add a function EfiLibUninstallDriverBindingComponentName2= for uninstalling protocol interfaces taking into consideration the state o= f PCDs PcdComponentNameDisable and PcdComponentName2Disable. 3. In UEFILib, add uninstall functions for all corresponding install API= s to get coverage for all scenarios. I would certainly prefer option 2 or 3 as they seem to be more correct and = would provide a for all drivers which may hit the issue. I am happy to make= the code changes as needed and suggested by the maintainers. Thanks Ashish ________________________________ This email message is for the sole use of the intended recipient(s) and may= contain confidential information. Any unauthorized review, use, disclosur= e or distribution is prohibited. If you are not the intended recipient, pl= ease contact the sender by reply email and destroy all copies of the origin= al message. ________________________________