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 9E0332119C8B0 for ; Thu, 3 Jan 2019 15:38:54 -0800 (PST) Received: from hkpgpgate101.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 04 Jan 2019 07:38:52 +0800 Received: from HKMAIL101.nvidia.com ([10.18.16.10]) by hkpgpgate101.nvidia.com (PGP Universal service); Thu, 03 Jan 2019 15:38:52 -0800 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Thu, 03 Jan 2019 15:38:52 -0800 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 3 Jan 2019 23:38:50 +0000 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (104.47.48.52) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 3 Jan 2019 23:38:50 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com (20.177.125.220) by BYAPR12MB3573.namprd12.prod.outlook.com (20.178.197.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Thu, 3 Jan 2019 23:38:48 +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.019; Thu, 3 Jan 2019 23:38:48 +0000 From: Ashish Singhal To: "edk2-devel@lists.01.org" CC: Michael D Kinney , Liming Gao , Siyuan Fu , Jiaxin Wu Thread-Topic: Uninstalling Invalid Protocol Interfaces Thread-Index: AdSjtn8ScFpTlPkrTXiCI2Fb6Dn4Gw== Date: Thu, 3 Jan 2019 23:38:48 +0000 Message-ID: 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-03T23:38:46.9359979Z; 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; BYAPR12MB3573; 6:cN7BMPBR6fcU1slXqf0yLnYXybFon90F7mk6cDfRhZ8+/7AXY4GxjvL4ZLyBp2Stx8hzO6Zbw9SSG5Q120DGcyP1njY52wFT8Qf650/cJbA341WMbnUDuVjoorGdVvgX7c8pGFGIwhcgqWLpISByF5+NIcVV32xKxdG7gQtTQ1OmgnX9lnfa6S9ISlLHa4re/2Rhu9OsfVfOyhZW6Ozpxr+HZ2zxzMXWfKqSVU4ZWywyiRrh/SQ2HFoeTrGhzqy8GIifc6BJK8FTkHb+ER8xsBJLaWK6JfrrUvcbMHu7L6Slt1zuoQl6EPPO81VA91p5Ka0nDo6lAUrBPSZxwrvibVE4ppNJUQ4OgmGr3CIKpOC56IdE9Yvm51FNXmGrMLOX4ZAdbR+DbLND+1XnFoHH7YpZtba1uHmXpPMacgRId06MUTpq3h2bm4Lz7Ti/0tQyiuMUNPVK2D3liphp/FvLRw==; 5:PkiiLmcfTW7Wv4V+h8LtacF55mHcbcsVHLX/Q3ee2cN/zKRbWGwDd9pEB9PuXbNuB1CCYYAI7SAOKbmDEDluaRJHQALGQr8xvhr7E+mYI2L8nlV9ejSK+mHJ6OyEZpAfCWok3Thq+3Wbd4F1jYUqYzVGcEyk0XGMf+Vdpiwzab3E/2i8j3CZCa1RNeP1zIQ3whs3azVVtJaVjyw5Phv2Bg==; 7:bXWnzeeYhkxVI/MxDPTMn/wPayxIITWYoV9+HwzwZdlg4FAehjl7kwpgdtuuTzIRz9t5nt2tMstBIrgL5nLjQ9rVsGG8srOksjgfN28EeI6ZrcW8DVqHRQ2bsi9Su8SaVaszOv0tjeGlyRiaZMVkDQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e9340d85-93c5-46d2-55f4-08d671d49c06 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:BYAPR12MB3573; x-ms-traffictypediagnostic: BYAPR12MB3573: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(3231475)(944501520)(52105112)(93006095)(93001095)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:BYAPR12MB3573; BCL:0; PCL:0; RULEID:; SRVR:BYAPR12MB3573; x-forefront-prvs: 0906E83A25 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(346002)(396003)(376002)(199004)(189003)(2906002)(486006)(6916009)(8676002)(19627235002)(99286004)(476003)(790700001)(54906003)(316002)(478600001)(5660300001)(6116002)(3846002)(256004)(14444005)(74316002)(9326002)(4326008)(7736002)(8936002)(81166006)(81156014)(53936002)(6506007)(14454004)(102836004)(55016002)(54896002)(6306002)(2351001)(97736004)(71190400001)(71200400001)(106356001)(186003)(66066001)(26005)(105586002)(6436002)(3480700005)(2501003)(68736007)(7696005)(86362001)(5640700003)(33656002)(25786009)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB3573; H:BYAPR12MB2743.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: DrOcvOt0YZ2Lx2peDiS1eyUTq+T/I/qzToBdCypjB8bfB/KZ3ZTA9ghHAQ01ApxZhWixUyR3cWCisRGbDcyO+UeoiFcBh/tmZCxuFZ7C5KaKPoPmvRXWE3WfZPmmaeFZrJTbuBtlcIXUJbHyo9B2a6EeMOrin6MR/uPGAKIG/kVdBJ77FvdHAvmgAEI/sKfG4bdtUCrDRt2IOchO1GmgJ2hpwJVeUUxmg8xfE7CROVhM96CLQZN59V3igY/gAegO149QKfD8xOmvgDV42s8IDALAzUApw8pummiWz9aAfC09LZlDgJoAhmMU+pVTw51Y spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e9340d85-93c5-46d2-55f4-08d671d49c06 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2019 23:38:48.2451 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3573 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1546558732; bh=D4aW4+GcWXkm8gBj+/ty94WLF+wNgVbV2WizSr/xTYk=; h=X-PGP-Universal:From:To:CC:Subject:Thread-Topic:Thread-Index:Date: Message-ID: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=rw0ajD2rfQ4c/ukB90Ox+OJzvIDaFLjTlfXNR2uVDejDNv6HQAZ80zpJ3dLG4iQYs pquDW0l3I+xgS2cyKz2yml6uV/88bFqQZWbyQ2rycPsbNoLZgL7Pz/UN4E+xh6j6iq iuyGYewDQUr7QWJG6ay/jOXVThV2wNu4rptHC/EI2OLfdPa2ff7ja0FLUzr9TPdz+V BA5YtgJnrzzFUYEO941SUuuSKbIxikRMIqWbZwyVGGAPskEWC45/xZGMIkNcfxnMko f/4mp9mow+hjJbPT6rAsLnQoCCOddHRTRjKSibQ+CuAV0vE5nV+D+f+cB3J6xAsvpv oouhLwD5aBkew== X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: 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: Thu, 03 Jan 2019 23:38:55 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, As part of moving from MdeModulePkg implementation of IScsiDxe to the imp= lementation in NetworkPkg, I started hitting exception in the driver load= ed after IScsiDxe if IScsiDxe's installation fails for some reason. Upon = debugging, I found out that calls to UninstallMultipleProtocolInterfaces = as part of Error 2 as well Error 1 fail while trying to uninstall compone= nt name protocol-interface pair and return error code EFI_INVALID_PARAMET= ER. As per UninstallMultipleProtocolInterfaces's documentation, if uninst= allation of any of the input protocol-interface pair fails, it will reins= tall any just uninstalled protocol and return EFI_INVALID_PARAMETER which= =20causes the cleanup of this driver corrupt leading to failure in next d= river getting loaded. The reason of failure in UninstallMultipleProtocolI= nterfaces is because the driver uses EfiLibInstallDriverBindingComponentN= ame2 to install interfaces which may not install component name interface= s depending on the value of PCDs PcdComponentNameDisable and PcdComponent= Name2Disable. I have the following proposals to get around this issue. =20 1. Instead of calling UninstallMultipleProtocolInterfaces once and l= ist all protocol-interface pairs, do it sequentially for every pair so th= at the once which was installed correctly, gets uninstalled instead of ge= tting reinstalled because of a failure uninstalling another pair. This wo= uld however make us not really use use UninstallMultipleProtocolInterface= s API to its full caliber. =20 2. In UEFILib, add a function EfiLibUninstallDriverBindingComponentN= ame2 for uninstalling protocol interfaces taking into consideration the s= tate of PCDs PcdComponentNameDisable and PcdComponentName2Disable. =20 3. In UEFILib, add uninstall functions for all corresponding install= =20APIs to get coverage for all scenarios. I would certainly prefer option 2 or 3 as they seem to be more correct an= d 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 m= ay contain confidential information. Any unauthorized review, use, disclosure or di= stribution is prohibited. If you are not the intended recipient, please contact the= =20sender by reply email and destroy all copies of the original message. -------------------------------------------------------------------------= ----------