From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=203.18.50.4; helo=nat-hk.nvidia.com; envelope-from=ashishsingha@nvidia.com; receiver=edk2-devel@lists.01.org Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) (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 C68962194D3B8 for ; Fri, 4 Jan 2019 09:32:51 -0800 (PST) Received: from hkpgpgate102.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sat, 05 Jan 2019 01:32:52 +0800 Received: from HKMAIL102.nvidia.com ([10.18.16.11]) by hkpgpgate102.nvidia.com (PGP Universal service); Fri, 04 Jan 2019 09:32:49 -0800 X-PGP-Universal: processed; by hkpgpgate102.nvidia.com on Fri, 04 Jan 2019 09:32:49 -0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 4 Jan 2019 17:32:47 +0000 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (104.47.32.55) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Fri, 4 Jan 2019 17:32:47 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com (20.177.125.220) by BYAPR12MB3399.namprd12.prod.outlook.com (20.178.196.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Fri, 4 Jan 2019 17:32:43 +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 17:32:43 +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: AdSjtn8ScFpTlPkrTXiCI2Fb6Dn4GwACtD8QAABPn1AAI4iZYAAApWVA Date: Fri, 4 Jan 2019 17:32:43 +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 authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-originating-ip: [216.228.112.22] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR12MB3399; 6:5t/6FAlXZU9pzMxG/z0Gz+1NQH9xnontAVoELovVAiZjmgrYb4NLUULd/UzMV0Nwbs8RllHRy+TiiXwPBBvG/chs5/NwG+vRn07r8HTI/+8C98xEeU+8f7IBAqsYwXYztVju3IUpefWCT9nNnbMIeUsgmE+ag58W2QxeK2lMlPNY7H0l/jzDcW0Hk33/3FXJ6U9J6/AgP2PWl1D9buoPQDDeYPWyxtK4tzir8Uu0MaaOhiTpU0O4b90yuuC4fb9ja2rgZLwwLzPp7FojkrSCy/JyRAk1DgRg7tGmGq/u0qC8yk2kqwoV/RRbfaTBq25v2msBSJlYtRfdOAjg2C6+rhxUAU1MUu9KPoVp1+b9ZET/ixYqPQocrB7hNHQtv/FwizsGpjznIF0HlYNv0PE49I1kkxcHKK0ZbpHrtx9AqMtAfBnnHijJUUe1iQt7cuog9YmhNXxD+X1VYW6x7ADYww==; 5:lY71sDxyx79VKdNoZxK/NhEPjHNgEdlArEYA3Qyy+NmhzKWTGWNt49Y/tiFGY/oAoQkmoY1ukV40UkYgxXc3+QUAhNi8RdTi0ssTAwoOSy0l5ME3CStXpj61xtWMKmG/Wkh7oC7GNO/r0G/7dG2bZHfyuZaGXrFoot964M8qlreo+gKWJcWtcCzcMRPT0rm9erOyb2sweSML8ldmyURsEQ==; 7:nfyqk7AjB0H23WOhjdW01hAEqV9ghJ0E1SJe9S6NDQ2AUxnLGdQCRA6SLokKuznlCzgY1fEgvcslzaHgMBjpNg3cXZkmIeTD0lM4SczxkNQ7b4giExQgkzAVPqycOC0ww6jEtRTjxmt7H0ZIHuaZzQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: db68dc35-0ddb-44ce-996e-08d6726aa28a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR12MB3399; x-ms-traffictypediagnostic: BYAPR12MB3399: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(3002001)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:BYAPR12MB3399; BCL:0; PCL:0; RULEID:; SRVR:BYAPR12MB3399; x-forefront-prvs: 0907F58A24 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(346002)(366004)(376002)(396003)(51914003)(189003)(199004)(790700001)(3846002)(6116002)(478600001)(2501003)(106356001)(105586002)(486006)(966005)(14454004)(229853002)(7736002)(476003)(6246003)(66066001)(53936002)(74316002)(3480700005)(236005)(9686003)(6306002)(25786009)(54896002)(4326008)(86362001)(55016002)(54906003)(606006)(316002)(71200400001)(71190400001)(110136005)(33656002)(2906002)(8936002)(7696005)(53546011)(76176011)(186003)(5660300001)(26005)(68736007)(102836004)(19627235002)(6506007)(14444005)(256004)(81156014)(81166006)(6436002)(11346002)(446003)(93886005)(97736004)(8676002)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB3399; 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) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iuaNSHNG7JbOMsJvaQ4As5sPvoRgVbFZvkpGNgLaikk4NYpq9fQNsZQaOj/diNFt4dhyem6yZ9Iu4u6JvLwumyiVU+oAmubXfGxgA+rGzQeoVB3alDrgviqx/uMR3aqxsB6r4KgbVmDtaHxwX25cp86dRjW6+EfKJQCyCkUCd10TzfrJ8hJv5sYAuecsG0HTsEYPasZKrvKERsojTxtXqOfbQcAcahPxjALgTGWBJBM0cQ9MbyfHCJEnKioj95Y1LwCgPzUib28uzaOqDHyifkDM0lwE4HP33HiGLIKH9MCLwxFJer8jY9q8BYlaoJzT spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: db68dc35-0ddb-44ce-996e-08d6726aa28a X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2019 17:32:43.7345 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3399 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1546623172; bh=SJ95DmgWUsPQ1Hcx+h9cjNC6lZ3nspIfTW7sT6DpRoI=; 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:authentication-results: 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: 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=CR4GJ4dj+FcJSSbH3A4cTpTWYndsZ03PT2sGzpmXUMTaU7qVihdmH6Nub1LDZ1DLO eaJ3IK30eqCwiUlxT2MiQJ5T4+iNpJgoxI/tgja4eUpzgnSXtE77yI5g3ftgt4Gefg zSVbIEXyvXnrSz+K8dWNGIu7DlK0bbZqiP2L9TPmFFzRTfLLnHsfR904A6D91akpkd XkSAcEE1G8fsjXT7vO4fszwjPESGX88v/xPu6XxuOgGzH7SUYcd12tFCbg2sUSgFNL oWdc9Lll20QN48B5xf2UkET3Et/U2SJz5eeSPLWfm6CQSTAub2uvCHFUHEA5DJJ9Vt PpKumxus2Nbeg== 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 17:32:52 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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; Kinn= ey, Michael D Cc: Gao, Liming ; Fu, Siyuan ; W= u, 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. ________________________________