From patchwork Mon Mar 29 13:48:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170191 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F0FBC433E0 for ; Mon, 29 Mar 2021 13:50:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E563161938 for ; Mon, 29 Mar 2021 13:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbhC2NuV (ORCPT ); Mon, 29 Mar 2021 09:50:21 -0400 Received: from mail-eopbgr770138.outbound.protection.outlook.com ([40.107.77.138]:9188 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231506AbhC2NuN (ORCPT ); Mon, 29 Mar 2021 09:50:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZibXxSLUuFW+FugvPi9NxDFC3VrwbvuKSchadG4YEwQY0FsGTdv6V9N9JhHXUMxfSLGYc7JqCXTAWqs2EfdieSDY2poYZtThbhaM6gmQPIhT7YW6hE8rRBDdw5mgw3KFHqGrZ3O9RF0uSopGD1zluIPitGCGmdQWSyS1tEaZ5Mzumry+dqDTVWj4KZ04YpHjzu86AytWgKiyJNmL1I61S8esUR2Bwr9ThzqMWaQt+G+km/7/J6+zTTYD7o62EzvToc0UzKcgGty9ZKRxmUZwiHWvnyhWr7gzmgJAyK28dUn456Z0NT7mdx14PnOAbDypvC/x+Bs1WXoHMo7DoMIYrw== 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=qx8wmXEuU9/a8MxgYOXWEQa3uXZ3ItLu3u6X4qRz16w=; b=CPNyH052bgLUQOfCzIZmSxFcBsHFhH9QLEnr3IR9lWiP0oI4RB3ZPI1u2Hg6CGCRO4xCOEEr/45zt2Jha2ckqHGPQx0kBhtUF3kEIeyJx4BqQWhJB4l3n+5utno9Zb8v4k3MGT7b0qmFZRPhDafKiVBWlbAx2COK1BPfWw7Nso1YH6LrIFqQpSLHViSX1gBjo4LzWteSGT/KJxLj+Mpa8jv4f6ItTpmvrTdss5r1YSgLEKXNtkGtcNan4cbT+rzuVwZeFtJ9Ee3dQg+cBTrPpUMjVwQS7DhgWmU9AvPB8GcnDG6scIDnGp4r5hY/1zSOljCuqyjyaSesDyK5pGAd3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qx8wmXEuU9/a8MxgYOXWEQa3uXZ3ItLu3u6X4qRz16w=; b=Efre1T2f3yL0oLzTU9+lFjgHCa73wJQUfG5zMTbmIjuzg2RJSLE/UciIiGP03UrP112wKSRsTpXZSranRaYZEOpmHHvMazSHKr7npSGq1kEBoAlUPBW70HrUHGH4aTHN91bpNoGFef7QtAasIf75S0wKPwYWhTeCNCq+uW3rl4uLfwBvL8CkspcdyE55ljqkJJ8KgOso8EWYkwVd7iH1LIPKHSWKyGRV4uDzzcMkobV7YSFZhDZfFCyJhGtNDmMke1Pq4JKY8pQRVwYaGkL76asJyCW0mYUqCXdvrfCYQOFk5+M+lG0JGUwb/AvF8r04f8UiNmEVDdXUYUi5zeBJtg== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6294.prod.exchangelabs.com (2603:10b6:510:18::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 13:50:07 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:50:07 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Kaike Wan , , Dennis Dalessandro Subject: [PATCH for-rc 1/4] IB/hfi1: Call xa_destroy before freeing dummy_netdev Date: Mon, 29 Mar 2021 09:48:17 -0400 Message-Id: <1617025700-31865-2-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Mon, 29 Mar 2021 13:50:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 144cdb14-2dcc-453c-d80b-08d8f2b9903a X-MS-TrafficTypeDiagnostic: PH0PR01MB6294: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iT49MdTY8mKvefMpN1iLrK5EhqgieBEE83YtFPg9823rd8zDPyLRTTthsuyoKfyWCRzm0bg7Zkbopuea+CCzwjOAFiyA7Y91CXyUDjFs+jq3E1W+ZKKMQ1VlXYKYXmQiQnuR0/vb8bg6dslqaNCXtD1ruVEi1WzHsnkJ3uUyS5u1CIyPLZGoGjOFlwGQvOdF/BHpUKj87C1Awz/1Wk1ZdVOKk6Trid5hb08QsZaGw+Uzfd7opbohCNt1Jbgn83Q69BHfKx/ymitlge6l0ZcYCiSnotQ2mhIDYnyAAFbxmkPjDVPePytDZZqjh2YrfMRj9BbywP0XJxYH9Qk/remyE0obMXeb2XD7ZOmWM6sBvrcn1Kx7RNFT2THKKw71ZGQagXO3vbx3t4FktAwoGFNtmBPCdHCFpUDfEgHwdg7aFPoCfRGIAvm33KceUAERcnf1axeNKs0aCXWXGQ+th/tPIT1dIMgj/AoDDzCtFDJHtSiF95CIBt+ZVg+Yrc30RtPHRA/jKD2o2PsRl/3fnZAgFzCuTL/eI8aSgKdjJGkf23cyrCmYnunh30dOIxZjFME8HK4ii+eUdjQUG3kS5l2qw1NuFrQnhNvhvAM1yjj1+CukeaqeAqBLz9wgssrzVRokb74sUyMsJRilYR66VapYMQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39830400003)(376002)(136003)(396003)(366004)(346002)(66556008)(66476007)(66946007)(186003)(6666004)(6486002)(8936002)(5660300002)(16526019)(9686003)(7696005)(52116002)(107886003)(8676002)(36756003)(478600001)(86362001)(2616005)(2906002)(956004)(316002)(26005)(4326008)(54906003)(38100700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 9mqmX2+/KruV7SphcAA9R8t3n7OTZRmM508XeBtwpOfcumgDPijSprfRrKW6vRMTQ0is/2/2JUKB3Bu2XfDpryhTFWrkh7A36dAR6UQ4PO+cWKfr0UXT8KA+7diVSrOpEwk/xF0B8aqp+bfmCZeJQ/ikJ7smvp84XdHkk5l4jAgVkUJR58q0lohkleRb0d9S0ppCABW1Q+pPUAvYkBnZfgExzmd8JVZB9NvGN/DLtrtko90+XqdXLGpIuCZhpsuJA6CkG5DzW3qVfcCjRl/VC31TTZs3WHnZRnXPp4BgD9PwSPjjel6AQu8jgr2Fz0Dj1OOaK08j5waypG0Ug2EL2SOerjZ2A7qjxtzasg+FMRL8RggfIDy+2b8VBDXENz00msQpjsIG8jHKCYxci+aIVMaXRoNWQS2mHF6IonDGvKXSyqWoJV5ZBG/BZNL3a1A9ZQ/QkMU5HiBQZaIdP+HST136u3KulxQt0K0A8zxT5hbZ1tAuzN7oXkQdsNVF0kiJO2ShSXnviJQdCb0a4+AcWEEu3xMNPxUoBJ5KQlAK7hyfEdh5VwT4Ksv9AlbxlCHdhjTiBp6g5Yua9DG8dCuaabf47ONcaqmiq+Y8fEa2J/CqyGhVeLQN7J84HzHxzKDkpNDqzkezxZoOpxfYxOCMAr9MYKr0xBAVCG8IlIZuLeFeHfBPZyBh6BsSgkueCQv1B64zhR5h1IpJg0mCvarcwzO/09K3YgQgw0TaRo5opSJACn9ZRScHqnOIb+/wD+nqkUJ0OT37P6S3K6/9slCO610mhXn3ZMLweFgofI4rly6z7/Qixf8mWoiDyUrUU9hHG+deBix3jsX+jqc3+yMT4zNLQCE4AKjCiXFydLwNYPYpjptGh0svLD68U8Jlkw08s3qIjHmKbcu7j3TaXxvC/zHkcQkrfR+cQSOBvaAZPYddDLyFhqpcsT7T15MWG7Gy+UcdUcgWuoqMF3EX/tXi0LSxe0MUekKqg0C8K0QqOQJIZ6bMIs97jFVibiy+Kt4Tr6LeyoUyznbUvDS4EIIgYbMylJMIjr9i4cLQ3aY+5pAX9bnsQhUgZKWY6fogKn+8FWUq8Ssul/PrKrxLiXyQhtpqwco6CvPQLBmt+Q/xQ+MpyauvaxtPLdsdgsNIrTfdtaSdVzB5yu2hPbfLXDQeYzZOt8NjmEqnbZ3VwO1KQb4CQvfyEvgGC+lzOiDFbj/ypAJ4XkWGBoBuI3eI4GSVVTVMR5KLRmTQ4VwEWfMaWxfcvRHpWfU2u9YqWfurg+ptd/Sb9fLcqLhrLKuDg+OhQ14Nszy68Dzb2K6Mr0kc+SAnJRkMqTnICNkRz3l4aQuT X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 144cdb14-2dcc-453c-d80b-08d8f2b9903a X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:50:07.7314 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +ja+llhy7bijU/vBPEf5quTtJBvgYRQ/5SzbMDU1MeHFdP8kfYWSz3czr3noADBz76DHZzOCM5xjwfFH3jb5DPsza+w/zGGmxRAVi4PsaDawSObTTQ56zQkb2jOEA05F X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6294 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kaike Wan Before the dummy_netdev is freeed, xa_destroy() should be called to free any internal objects to avoid potential memory leak. Fixes: 06bde82c72d5 ("IB/hfi1: Add rx functions for dummy netdev") Cc: Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/netdev_rx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/netdev_rx.c b/drivers/infiniband/hw/hfi1/netdev_rx.c index 2c8bc02..cec02e8 100644 --- a/drivers/infiniband/hw/hfi1/netdev_rx.c +++ b/drivers/infiniband/hw/hfi1/netdev_rx.c @@ -372,7 +372,11 @@ int hfi1_netdev_alloc(struct hfi1_devdata *dd) void hfi1_netdev_free(struct hfi1_devdata *dd) { if (dd->dummy_netdev) { + struct hfi1_netdev_priv *priv = + hfi1_netdev_priv(dd->dummy_netdev); + dd_dev_info(dd, "hfi1 netdev freed\n"); + xa_destroy(&priv->dev_tbl); kfree(dd->dummy_netdev); dd->dummy_netdev = NULL; } From patchwork Mon Mar 29 13:48:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170195 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34683C433E0 for ; Mon, 29 Mar 2021 13:51:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA3EC61938 for ; Mon, 29 Mar 2021 13:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbhC2Nuw (ORCPT ); Mon, 29 Mar 2021 09:50:52 -0400 Received: from mail-eopbgr770129.outbound.protection.outlook.com ([40.107.77.129]:40679 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231637AbhC2NuU (ORCPT ); Mon, 29 Mar 2021 09:50:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SEjfjg8/EGZOShbiRUT7zWdyaFobUxPocpY7Z0e3drMVzMoWMWGZjXLhQwyEedV5NPlqy2pLjqah1Wy+frip3Se+FEEFg+phIebgnV3SHdbA7MSCKJAdHwVZ5gNJXWtn+lVa+iBK6ow4C99kAIpYVDL83eZ/54BOHahGXeM1oYpBJUbx/d6M12J71g2aZjj0mBY/09AURrs+TATJHnBRG8n+gA8zZmNu4Z8vb+l8vHjQrqjHMa+f5hy94SVhKOkes9d8l/IdZyn1U49KQfPUdhMSGyRZA8vYWdzPMsiidtcXj4Ag/Kt1K0z/WWekWc3GarCoV3CJtvN6Hc5mfe8X1Q== 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=yWGqWum3tbe2u7i/pBCc7+LMkSwDcseDsKlEo2q1wf0=; b=Z/wnIEUOhpTFk4++LRZOyiqD+3x/5ozrlv36JUfpS4M20qSP/2mFtf0/ln54DHe7nSW2M6QENEN5pJCROlg3zpsUcF66jsxhBeFUMClEaRfN318D7A8ak/FNHVLy50zzlmzXiHqFPzpIKttBlzYCA5jZIwoqtfuZf5qFlfQ+pkKmporROr2W1VkEOzwDLj+TNDzFfTcDQLexArm/KuR7OydDT8hK6doiE4gzfNq7Rp9c3kxWBP5l+e523Lb37SpQvpSMsPu3ZTWefO5uxfTdOAn0SQ1MnL2B0AxSQUo7eUBmMj4nWgpOg1VGeFmFiZATtxyemh2U4bPZkgV4jZlXnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yWGqWum3tbe2u7i/pBCc7+LMkSwDcseDsKlEo2q1wf0=; b=A/tIbuJ1mqzSdsXXZrIGtqTuzFe9cieCZN8KCTop3oFk4nRsDRHb7w2bY4ZNzoMDUV0qzRAzKzgAdwvezNC9p+F+CagiyponRXeK2VUEiQhBqA4Mp9GeaKcIRxSbCKjeS+ThUqU0DXfO6J9Gp5DTXbBumkk6PIt2ZyYW+duWTaq/esgFXFGmd2fiT+aFmDYwrVjrlVei05HJ8PTfFr0fTkxH7aBBzUyvPVFZEqzbm/mGf+uyHF4CyFJI1XeSm4oXUDeCjFQpc8AxRj5EbJLRrZg3Yor0Bf3fqBBFET6iHS5NRoQ503PUFsuZuHhjhjGIYMA5Xq9eu6OQ6tJWDzNDcw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6294.prod.exchangelabs.com (2603:10b6:510:18::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 13:50:19 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:50:19 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Kaike Wan , , Dennis Dalessandro Subject: [PATCH for-rc 2/4] IB/hfi1: Call xa_destroy before unloading the module Date: Mon, 29 Mar 2021 09:48:18 -0400 Message-Id: <1617025700-31865-3-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Mon, 29 Mar 2021 13:50:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59cd8307-37e9-4b49-54c4-08d8f2b99742 X-MS-TrafficTypeDiagnostic: PH0PR01MB6294: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oEs7cpcQ5ViKheQqMUHbl3EnUS82ogOKldnqTbTYglN5Lp+b7aFmhqy6pHnKdNjDJ1UeKHdz3WlqgbuhNnSctCgMTlDAL98U/N4eGPl1oha9ZQgMsBZdOXHx3O6xcJ1rDu7j98QxbYKotCjErQYdHai/ElKlhnIW5GXg+Ql+aJByZjywPrxTxO85vNVmIkfX+8TAHOhzUvDFBzyMZRF8LjpiAxDa89lobgzTWgeCrfJ8jY7dSlgBF2cIkCaDRLoBSrd0K2+MtLLee0rR9NeOY0qHlT9ZidoZPb0sWTeK7Zf1NG8xk33CWuJFTijJYRcC3twjie6Nw5dTAEptO2z4j9gmQKbmS9wsjCYp6zxANrFYXfIeikHod/Kyeq5nTK3EzN0p0TNf7gqTqaC2sSz3BgqnezwUKnKjh8mBcXbMkFvIhO/a5dolsQ/+mr53t3SkrAjeOMOZ908PTs25IfQ7p2RfiJVGMVFgUZgEw5sBeMUDqyMXmfJ2YC0/kiD1KEQnsWD0cOM5uEUPBqZorbz4UweTOV6QMXSAeyxfBDM9FU99duObXQZ8+a7gYKjCZbDoFGAXk+O/SQhsY681oksGxA3yPeCdZHgd16/2ZeJG19SijLKBQFJs6e9ZJ/2IZXMBJwhx5Z69quAEvFxdOyIwBCZfbqI6nSVzhAVGupv31H8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39830400003)(376002)(136003)(396003)(366004)(346002)(83380400001)(66556008)(66476007)(66946007)(186003)(6486002)(8936002)(5660300002)(16526019)(9686003)(7696005)(52116002)(107886003)(4744005)(8676002)(36756003)(478600001)(86362001)(2616005)(2906002)(956004)(316002)(26005)(4326008)(54906003)(38100700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: LmKkJLbWaAg3kh1RFFrqpVBZVvhpik7TT3AEgcuhrFX6zanOh+mb8p0+NzL7OjW6U9MrujtkkdR8BLfv+H66E08F0/q5E3+YWbVXXQuo+Y3fesTVWY+UoH1VJSb0CkNpQf38NL9ncdkfH3q6fdsuAOGW0yYZwCjuYLvZtrcEpHoPz8mGsUk5DmcgdcTWsi1At0GZo9KYPPRDsYU8tuQncqSvwijHhK+PMmmc1CECmVznGcxS9vqnGuZjzGRzjlYytvwkx7p7NEdtj3XlTfA2vplV/iX40PO3nLsOQz5RqYp4Jyxfe5644cYbwHwriMNmdHZ+8j1s/yQWsJyAEReEDlWHK27dAIjeX8mh7V8P3GMOsURE89DtE42fgQXbGCVTeSkg7+7ZOWR1cHNnCI/MIUELf+8yXMuKcwz0nwwXOiLS5VudRMxI6Rx0YOnuB3Eo5hOcKTE2hhdz5mawTil9v9DX2Mg7lPz6bDCxWsrm3hJaNcRLfz9wxgBCnVGd3Me/Z/Nzy0XtToWQmWeFpAi0ZQ2/blWvwdnYiZfzivhmMDup2vsQS/Zz41x4E3vHO2r1GCz8/uZmbosBMpEFO9Eod+jzYt07BwPN2Q8myBdtVKQNVPBUQe4yy6EZQGXPbaNr16AHhh8dxj+KqVHdjPu2RbSEe2qKb50mir4XbEuNQj94T+EdQH8dyndDGO+GyVk6YrgouebVYQdn5OUSfKyfSxXEE/dPN7oX/obNDNwXlpRI4Db7lcHxcW1lIdQA9/ISuPdrU2BSJpFb39VSDzlXSE8+h7wU0p2uIWBczCG8SUL1g8vUpAnZRZ76fqQgRs1r2+Lplws2tQ24HTyUiS/nNHrHXcru5uiYwQPJ7ndsTWCC0DSbS1CPte48quMwrlQHmdkfP4VFPN10vx8mdmzxhCnM2Ot4yfxvgSW7FzCpsR6iUNtf8g9I+oEJrjgEegji1bdyqw3FfukaQ6xAHKYRMJ/EYC5UY12Ey91h/dS+b0Ozdpc5JP22ujQYQanciKkaVfNKYR8WGlrBjr+HzX/AEnjox3KjgrgWz6Pub18msA+tu605poKGIhY6MBVHHGhiSw/BckD0ooLsXbZoW5KL28jTULcpXR6h/oz8rIw0Q6zax+zjdV5E/ABDXLO21ukmxRqGZ4jUa9IkA+UMuIWWd21drjSHLZ1ewmayAJHMBbo/uSy3Y9Y6uu83TduEoZvCgE7hJ4/RdFLRkt+TBnTMgLb6aNNwdFxWK+2TaOk4goBvBeiXoy3zHdEN287+hUAJ0s50Lb/tfnh8zOM8tCacDt1RrsBrR9GEOD2+YomMsvy6RtqeCmQAcNCTAuiCHhEn X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59cd8307-37e9-4b49-54c4-08d8f2b99742 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:50:19.5285 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u+ZogaDLqjSaVvSi7EDhU6IP4CDf5KTfhYv6Yeh+r3LSKujMu+pQJ81lwrrknVLhCMm9D/iz1AQXvPALV5tYygws6cavNMKdQ9djyvASnkw5M1pBop3QvnJ2qcs0WDdV X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6294 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kaike Wan Call xa_destroy for hfi1_dev_table before unloading the module to avoid a potential memory leak. Fixes: 03b92789e5cf ("hfi1: Convert hfi1_unit_table to XArray") Cc: Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 93237bf..e4f8db4 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -1507,7 +1507,7 @@ static void __exit hfi1_mod_cleanup(void) node_affinity_destroy_all(); hfi1_dbg_exit(); - WARN_ON(!xa_empty(&hfi1_dev_table)); + xa_destroy(&hfi1_dev_table); dispose_firmware(); /* asymmetric with obtain_firmware() */ dev_cleanup(); } From patchwork Mon Mar 29 13:48:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170199 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98069C433E3 for ; Mon, 29 Mar 2021 13:51:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 676DD61938 for ; Mon, 29 Mar 2021 13:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbhC2Nux (ORCPT ); Mon, 29 Mar 2021 09:50:53 -0400 Received: from mail-mw2nam12on2112.outbound.protection.outlook.com ([40.107.244.112]:47776 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231591AbhC2NuZ (ORCPT ); Mon, 29 Mar 2021 09:50:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gZDsVpvhAT6aFE/cV862ZepsqQtTOjh9DG/lcGSet0iVTqIPX7WJTTDnl9TsjUdJOgrKZeetJdd/D8hIBzzihPgu+d+tTfa4Oo18/EVtuEukp9w/EHVMyf3wa1uO3wSV+DrXTcezh75hcKE7BFsFfKk7wJEuwUx6j/phfTUVInmiiN1f6pznKiw9XE7Mkmf7NNl+U+j9SxUMn6JbEWeruCQ3y03pHzuulZYua5gGmi8FhCehtyzTbQ41jphUivSxeVGRA0PDxObUaTNOILn+tQHBQeJ73l9lbfDfqNm9n+RyJ/DhyJRbBmTB65L4KtX5JACsxcTYXSiuRfirZBVxIA== 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=aVMtBqDoNaTbFI64m93aSW64xy30M56vXzompTSR3rg=; b=XeaeM8vc15ok48wUca7IMdk+x/HoNe76uSpx4PLobVp34ho//VSUNdmb+24GQAFm3PK2eAT+SuQ9gJttjLonuPewRkEDNuU4DZmb6G6E8VpLO5zKvnKT/CyHT5dp7Wghn+AZBbPWp0tP5NtF/9FiM9rqs6LWsy8iniF3M7EYlU3ej130DmHDFORw24NgmOrelksFAP88wEQpMaiHUFHrwGziydGl4m6UHUla5B3ocCy+tUl3KHGik9ZdGLCVjxgHyvsOEQxbKK6JRtff97tssth/Tvst7ekSVc22IfQd8vbfvp//PUaUaX1T5LQyakiZjhQ8uR8FJqRNiFahOaUbnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aVMtBqDoNaTbFI64m93aSW64xy30M56vXzompTSR3rg=; b=iBVZiQCH/WHjkjf80qpsxaCfo65giCfl9lsshvE9KtH6xVcttcNG2EnM6zmOcAMzjWXz0iI8tNDzIpSAmfixsaq68RuGHDJYEfypNdH6g26RhQsaz9Y+RQhHXxS2CITKzTDfFiOLUI2K54waFlwYEjXEwiRgeX+s0srdvIhTh50OkhJUIXstR/XTowVcyykpD/tnIwCYwV/EzxG8QwM0a7/d9Kfo4H3FtJRaa3zG7FpI0/9z602qrmha33Lu3I6uWpXxgY/HsxGSIpcA7EigYwXZ1n2Kg7Fg1WtqTF66IBFZxBXwa66Pl008kyw7wbNLA7QuhKvSI/lip16Dyxvfiw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6294.prod.exchangelabs.com (2603:10b6:510:18::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 13:50:24 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:50:24 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , stable@vger.kernel.org, Dennis Dalessandro Subject: [PATCH for-rc 3/4] IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS Date: Mon, 29 Mar 2021 09:48:19 -0400 Message-Id: <1617025700-31865-4-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Mon, 29 Mar 2021 13:50:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 722cc19f-fc1a-4f2d-01e4-08d8f2b999f1 X-MS-TrafficTypeDiagnostic: PH0PR01MB6294: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PYyRPad22fnymH9Ux33mneUQ7cSbT/2amOAYBfG33uggKiU6p49M3/1xHSQwBNJgV/O4nvpWJjSQkFCpq/WIsahfkZlA2vt7gJEsW2j+/xc9TPhli+NYn4EyRt4ghoRf+WDEOEXqLuMXhkHvb5/+FP9EH8JVIADmzPgTD3mx/Wmfx96PfH7CFMlxwD5uLiMETNiyX4c+qd3J2+cIZd1Uo0Da+NSQD7AiuoIibNMntAY33sBboFiSokkCtJ1ZfY2PnulHSTjRBoVo+dJpR1zAE+WSM/j0VMSB4xl+MSB6wdUHNaZBrqTpWpzt9rFnTYGZDFAoxWLaZSeKYAwt7Dgb3DtxX4fjOjWgKb8EfgSExiOeCYUpHkwVL2arMY0c4WxpcHNQHne+7aJo5MZSFGChsYSvsmzrXFiDvAk14NdCOnCTAJ+caiO94LskWmVzQwPqpg78SeADb7GOeMJslfQx0l1WpvtrcoSPtej4ohHkWbhTW2rz/o4URkYHqqsrsjQobAvvXWR0mJDb75n4jFM4+Gr5PenmXEqFkdmI37eWNCslV8uJ8H5g3w4aiLkUFM1IWJj6LzTHzziY9ZfG8ovFeNil439TCCSvwulLdyc26wnkQh88vIdz/DpzD0PxvIYZpaDYulkDCHca7VQ8Ek9nevd1KZHcdKlbzSjUINGlyUc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39830400003)(376002)(136003)(396003)(366004)(346002)(83380400001)(66556008)(66476007)(66946007)(186003)(6666004)(6486002)(8936002)(5660300002)(16526019)(9686003)(7696005)(52116002)(107886003)(8676002)(36756003)(478600001)(86362001)(2616005)(2906002)(956004)(316002)(26005)(4326008)(54906003)(38100700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: If57u1nEZthL1KdS0vgrAa1WPtDXW2fggZdxp08Sbm3q59oJtEXRNzYkRzcDcNvXLHVqbgchqT1tq4iR7oyXWnAij1INB3ykZJ3mopAt3SeISUrCZzQpPzy4kTQNnASOB9WIxKQ4Fg+h1DMy+pEluyn7iEEaNf6nbgetROuu6M0dNZyjkNFeVjw5pDmUhUxWfCPSMvUsq0qcAT7vPrHVeZurOMAUpKbCkbGNC+q6Wv3lXPwkUqFedOpGPskJXCbXAEWeE3/maEgSWNQ97AMWFV6Hn+kJp44bfD2HYzc8lRhxVL2N5Yi9j4iMYE+KjW/0rBRkutFlOfM4cam+CBZsmnbq0xRUHUdPtNoOdjoNIfd7wgf7tMxmG9FWukuXuLJtrus2g55JJIouHy5hQmt3R3BvkeKU2nTSB7ai6jQ85TNH+QYoimyA1Sv6xIUaGjjns/eZRk6RGKnP/8SBuT+0N27nq2UiUl/CPFFtWycTGajBjfkPORkjHiS9KVR/dWMkrzaKklesXNPtURcL9OnF+A18PNRahRgxsZBYpOnl0VSAjG3WBzhYthqYQyDItzF735vgZMeRY5QnUOp8za95dxZaq9OHiOZBoB/Xt0RwC69tp3EvxEXWYI4d2QUeTJ6ZQRLYm329VIl+rF5hnCGC7Xqqp1VMARRwelIL7Mx9bGCE3MHX1jOdQjJvJxj5KXqep/ZJ40f3R6BqexVnzY/lDrFkVdZWXFICZoX/nvFG/WdeJfV4MlmA9tfpKFxOK8v/1deWxougRNZAhPOX8D2njnPGJUjc9IR2ykbPfXUKK2IUTcBc+atxJjDWr1vY8Mvg72lbwSxqC8uWQ+3iOANZudRPduLZrTIBTUZomDo/8NV5eJWO0QmGcl+3pQWOXgTLXdRxt3/2LpXJ0CMSV+YLS2pYYQYo/ykpZcP89J8n4VKBcYr3N/yM4r17arJg1RVBO+0svF8CskroglWXEt1B1QSDJ4pHNnVeQFl1JZHt6Y8EDBUJ3G6TYzJBs/t7q95X/lTB9PLRUJ6bFOmaN5y5Gt4Z/G5CsU8ZxrMp1vtyAvBXEJSqZUkP1QxLPefUZwPiKnM5tBs7IsXjsggpDuGK32tTZTE4JnCLxiFZVcPACCVkEFgvC4oNxtDEaA/CatJ2cClxsQLvsYouP4MwNI5z2wOrPp9SejSKcrL4EbWIefAVuObwdmzRt1/gXz3hGEjUwhS4+Y6T3ijs/lp4rJFIb9RwScCNWRSB58WSQoQj3KhZnfQI5x0oF5Fyl6ufLCnGr7b6sfjPXEkXhvdDHoyiOQvQahAc1xS0BORG6+2VU2ET7jXJZsKL22UL3Z4E1OH1 X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 722cc19f-fc1a-4f2d-01e4-08d8f2b999f1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:50:23.9779 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QtMMdxvQ2AVyMJUAknPWZhTRND5hJJizuXMYR3SWExfFiR57tUltRfFacltYYQbXJ/GQSYh8nb8Ypho3+RygOTqsscT6ic73oUmWNqOg9PssMkZ7kAfXrcWEtXr1U81L X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6294 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn A panic can result when AIP is enabled: [ 8.644728] BUG: unable to handle kernel NULL pointer dereference at 000000000000000 [ 8.657708] PGD 0 P4D 0 [ 8.664488] Oops: 0000 1 SMP PTI [ 8.672190] CPU: 70 PID: 981 Comm: systemd-udevd Tainted: G OE --------- - - 4.18.0-240.el8.x86_64 #1 [ 8.687916] Hardware name: Intel Corporation S2600KP/S2600KP, BIOS SE5C610.86B.01.01.0005.101720141054 10/17/2014 [ 8.703340] RIP: 0010:__bitmap_and+0x1b/0x70 [ 8.741702] RSP: 0018:ffff99aa0845f9f0 EFLAGS: 00010246 [ 8.751757] RAX: 0000000000000000 RBX: ffff8d5a6fc18000 RCX: 0000000000000048 [ 8.764203] RDX: 0000000000000000 RSI: ffffffffc06336f0 RDI: ffff8d5a8fa67750 [ 8.776990] RBP: 0000000000000079 R08: 0000000fffffffff R09: 0000000000000000 [ 8.789768] R10: 0000000000000000 R11: 0000000000000001 R12: ffffffffc06336f0 [ 8.802007] R13: 00000000000000a0 R14: ffff8d5a6fc18000 R15: 0000000000000003 [ 8.814317] FS: 00007fec137a5980(0000) GS:ffff8d5a9fa80000(0000) knlGS:0000000000000000 [ 8.827629] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8.838309] CR2: 0000000000000000 CR3: 0000000a04b48002 CR4: 00000000001606e0 [ 8.850502] Call Trace: [ 8.857950] hfi1_num_netdev_contexts+0x7c/0x110 [hfi1] [ 8.868295] hfi1_init_dd+0xd7f/0x1a90 [hfi1] [ 8.877681] ? pci_bus_read_config_dword+0x49/0x70 [ 8.887567] ? pci_mmcfg_read+0x3e/0xe0 [ 8.896797] do_init_one.isra.18+0x336/0x640 [hfi1] [ 8.906958] local_pci_probe+0x41/0x90 [ 8.915784] pci_device_probe+0x105/0x1c0 [ 8.925002] really_probe+0x212/0x440 [ 8.933687] driver_probe_device+0x49/0xc0 [ 8.942918] device_driver_attach+0x50/0x60 [ 8.952553] __driver_attach+0x61/0x130 [ 8.961553] ? device_driver_attach+0x60/0x60 [ 8.971122] bus_for_each_dev+0x77/0xc0 [ 8.979912] ? klist_add_tail+0x3b/0x70 [ 8.988886] bus_add_driver+0x14d/0x1e0 [ 8.998175] ? dev_init+0x10b/0x10b [hfi1] [ 9.007531] driver_register+0x6b/0xb0 [ 9.016757] ? dev_init+0x10b/0x10b [hfi1] [ 9.026220] hfi1_mod_init+0x1e6/0x20a [hfi1] [ 9.035601] do_one_initcall+0x46/0x1c3 [ 9.043958] ? free_unref_page_commit+0x91/0x100 [ 9.053460] ? _cond_resched+0x15/0x30 [ 9.062426] ? kmem_cache_alloc_trace+0x140/0x1c0 [ 9.071982] do_init_module+0x5a/0x220 [ 9.080574] load_module+0x14b4/0x17e0 [ 9.088911] ? __do_sys_finit_module+0xa8/0x110 [ 9.098231] __do_sys_finit_module+0xa8/0x110 [ 9.107307] do_syscall_64+0x5b/0x1a0 The issue happens when pcibus_to_node() returns NO_NUMA_NODE. Fix this issue by moving the initialization of dd->node to hfi1_devdata allocation and remove the other pcibus_to_node() calls in the probe path and use dd->node instead. Affinity logic is adjusted to use a new field dd->affinity_entry as a guard instead of dd->node. Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") Cc: stable@vger.kernel.org Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/affinity.c | 21 +++++---------------- drivers/infiniband/hw/hfi1/hfi.h | 1 + drivers/infiniband/hw/hfi1/init.c | 10 +++++++++- drivers/infiniband/hw/hfi1/netdev_rx.c | 3 +-- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index 2a91b8d..04b1e8f 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -632,22 +632,11 @@ static void _dev_comp_vect_cpu_mask_clean_up(struct hfi1_devdata *dd, */ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) { - int node = pcibus_to_node(dd->pcidev->bus); struct hfi1_affinity_node *entry; const struct cpumask *local_mask; int curr_cpu, possible, i, ret; bool new_entry = false; - /* - * If the BIOS does not have the NUMA node information set, select - * NUMA 0 so we get consistent performance. - */ - if (node < 0) { - dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n"); - node = 0; - } - dd->node = node; - local_mask = cpumask_of_node(dd->node); if (cpumask_first(local_mask) >= nr_cpu_ids) local_mask = topology_core_cpumask(0); @@ -660,7 +649,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) * create an entry in the global affinity structure and initialize it. */ if (!entry) { - entry = node_affinity_allocate(node); + entry = node_affinity_allocate(dd->node); if (!entry) { dd_dev_err(dd, "Unable to allocate global affinity node\n"); @@ -751,6 +740,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) if (new_entry) node_affinity_add_tail(entry); + dd->affinity_entry = entry; mutex_unlock(&node_affinity.lock); return 0; @@ -766,10 +756,9 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) { struct hfi1_affinity_node *entry; - if (dd->node < 0) - return; - mutex_lock(&node_affinity.lock); + if (!dd->affinity_entry) + goto unlock; entry = node_affinity_lookup(dd->node); if (!entry) goto unlock; @@ -780,8 +769,8 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) */ _dev_comp_vect_cpu_mask_clean_up(dd, entry); unlock: + dd->affinity_entry = NULL; mutex_unlock(&node_affinity.lock); - dd->node = NUMA_NO_NODE; } /* diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index 024ef6e..d341b8a 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h @@ -1403,6 +1403,7 @@ struct hfi1_devdata { spinlock_t irq_src_lock; int vnic_num_vports; struct net_device *dummy_netdev; + struct hfi1_affinity_node *affinity_entry; /* Keeps track of IPoIB RSM rule users */ atomic_t ipoib_rsm_usr_num; diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index e4f8db4..6d03aa0 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -1277,7 +1277,6 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, dd->pport = (struct hfi1_pportdata *)(dd + 1); dd->pcidev = pdev; pci_set_drvdata(pdev, dd); - dd->node = NUMA_NO_NODE; ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b, GFP_KERNEL); @@ -1287,6 +1286,15 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, goto bail; } rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(), dd->unit); + /* + * If the BIOS does not have the NUMA node information set, select + * NUMA 0 so we get consistent performance. + */ + dd->node = pcibus_to_node(pdev->bus); + if (dd->node == NUMA_NO_NODE) { + dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n"); + dd->node = 0; + } /* * Initialize all locks for the device. This needs to be as early as diff --git a/drivers/infiniband/hw/hfi1/netdev_rx.c b/drivers/infiniband/hw/hfi1/netdev_rx.c index cec02e8..c1fa53d 100644 --- a/drivers/infiniband/hw/hfi1/netdev_rx.c +++ b/drivers/infiniband/hw/hfi1/netdev_rx.c @@ -173,8 +173,7 @@ u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, return 0; } - cpumask_and(node_cpu_mask, cpu_mask, - cpumask_of_node(pcibus_to_node(dd->pcidev->bus))); + cpumask_and(node_cpu_mask, cpu_mask, cpumask_of_node(dd->node)); available_cpus = cpumask_weight(node_cpu_mask); From patchwork Mon Mar 29 13:48:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170197 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84CEFC433E4 for ; Mon, 29 Mar 2021 13:51:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 496426193A for ; Mon, 29 Mar 2021 13:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231297AbhC2Nuy (ORCPT ); Mon, 29 Mar 2021 09:50:54 -0400 Received: from mail-mw2nam12on2123.outbound.protection.outlook.com ([40.107.244.123]:12609 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231368AbhC2Nu0 (ORCPT ); Mon, 29 Mar 2021 09:50:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UFyqEUtp5yuayQ9ITnqdr/OSIATOTMfYuniMhgkiOtaKFhc3PGDo9fe3J34S8gaFr4Asx2cIoCKdOH2zBNynMVXV5gsNAAbAuZbfYpkQjBxu/k5auRiPqncAYrGxM2reeiJBdAcTMSDPHYmO+yARj8yNQyEDGmJhO3IQj/AyvqDwkWPnw/M1vclHepg24AGcFtYsozSM6b4BVd1UuJNfNt+2I8v0RdiW3wCTekKXM2CPlg6pZElQYnu7k8fTmhcnE/ksgoHlUQJ3UaGfzqI5IOG+QtwtCsWiVi+ppsxwO1MXCE0WdSsIMfxyRsEQntm9gT6mtW5jJBqksebiG47CeQ== 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=m4PWcWPOH49F9ij76FALXeP2sWUKHBix0+CnDKiMTDY=; b=D8c8QsIpeh9Wecy41OzUXoU0BZYwRgAqNNCJvT/kTba0YZkXzG+ESBapbZGt77Epf3qAdawCz05936Z6tKYLLHMqggkk+RFQ4pnwglAPgzIyZG/SszOaUJdsZwa4XthRrbThzRFb7bo0jOwenpll73AMYOHlmiaeuMkpyqfJ8KCvmP7Re/Tl9WzgUrpEUx3KaNZQ7LuDPfDIeodtL0nagX9vOtBKF94Fn+SQTBLxbPyZKoMePoVoe9Q1BXXd3RhQHd0PnEwwmTQjCBHwiJCZipXsJ+rAwG5IAoxsz8uMgfdpX2FiB1MnaH/1RGscXsV4JfnitVc5trfVztwOmaLjwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m4PWcWPOH49F9ij76FALXeP2sWUKHBix0+CnDKiMTDY=; b=ke6Fpj9q6UZwbTGVxKqpew6AQUF4f2m+skEyTmWGMNsUkvfT+kWVjd1QsFT0GeX3aKgc/+d1DZRaaffdYSgSAvLtZZqNe0kucGN+g2dNOFAE2dO9Rd3MS1l1Cu9mS+Ib/qqtE6Hy74OlkSms/zclQucfVSyyqX00b5ARVz2CLh0M8BUIJ2OxirjtAGpsStS9pDiRV7EYwuY4Q6KNJXOTVbgUsAOSDJL+Auq/eOAPy10fmyS9K4W+Et+i5Cu82zy+ATelggrKQS9g0Q/391l5GCgOO6rs2aWrcguIrzIxTuOlRayZPR077ff/syOxHtouOeh9EzTXLnmm/FCwIWTI9A== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6294.prod.exchangelabs.com (2603:10b6:510:18::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 13:50:25 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:50:25 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , , Dennis Dalessandro Subject: [PATCH for-rc 4/4] IB/hfi1: Fix regressions in security fix Date: Mon, 29 Mar 2021 09:48:20 -0400 Message-Id: <1617025700-31865-5-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617025700-31865-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0052.namprd03.prod.outlook.com (2603:10b6:a03:33e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Mon, 29 Mar 2021 13:50:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02f3fabb-7754-4047-3eeb-08d8f2b99a9a X-MS-TrafficTypeDiagnostic: PH0PR01MB6294: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I2pH4MFMqLIWxpbJ4tVzlJwR9UN+ZX/RAaIcPuSBtIKWj1lwUIKhym7x///Ya8Wb9Pnu/HgVfezNSSZ18a9wYvVMiavNIYb8bN1eS9r0d9feV21QHuC52qi3cy4X2hx7rLlHwipEI/akJzmoHmcNQMERSaav3+1zc+tirT0+/bsmSAXDTI3USm56TddO4st71K1joDayqFCZRomrCuMO745TfQPtRUyNjE90BZ/NM1RNE+bze9cC03Wbt9dChAs88K9AW8Ly4LPnB6AI5TAxqBXkqrmpOmDLNOYfVqUUl/SN/shE7jMH9SYQjO4SfHmN9FBNWaTH0LMFHeuDoRq/5/m3eY+DEgJo2JVw4SINpIHlSVjiGjazphIDX8xRA7fQpUFk1pg776Rd1PGARk2GTkAgi9aw1Vs6AvfhzMNgu8vJwIcQKWEJAuLzkl/snJHiyHbxKMU4FiY+7oXEFZSqYCOvC+5ybCQ0n+LsKRZe+PjhnUDlHKSv+T2mS00IR+tj+w8eY9sMMJdi8mozFS7t0KRnVpgUoBn1yeauoJsnHVhsZ96VRG17TO9ZDqTAtLKmDlZstw1FkplVnXSdyK6PnvPKZshnPgyq+KC5sHeFdorUOpIDu63nX1pGcUCYfGdt3Mp2MWgOczm6yr2s+ipMgw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(39830400003)(376002)(136003)(396003)(366004)(346002)(83380400001)(66556008)(66476007)(66946007)(15650500001)(186003)(6666004)(6486002)(8936002)(5660300002)(16526019)(9686003)(7696005)(52116002)(107886003)(8676002)(36756003)(478600001)(86362001)(2616005)(2906002)(956004)(316002)(26005)(4326008)(54906003)(38100700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: wtIbwOgLl2pDIp1tC9ZjCPWo0wk9CqR2XpBxnU6r2A4NNfp/CNhTeDFPWAYfuQbMdBgVd18eFo2g3HqF3IVFzj61Gp2nEY1PUijmFsvtUu+uIOV3aDl2FHe9KKb8LqtyU0q5gQ8Fa7xMKC2N8hbatxEM51WAIV1txJZBaRVL6BDzSpP0tX64OM6GYXD/4qJLKwVibeP3IyZr8F3GTdOgH/5TSXPlzSXQziYVdMOIiOhiO/oZAGAPmr1kU4r1rYxrQlYQPnbmFSQJZDknNIkwmY4yuufxK3pejEirKWuTZOdkKiu9HdhmvOgpXEigqHJboVYXQFCwiPHjrjAEnrQlG9/8dbmleVU3kFW9hSqAfhhf8QuZo1jzpj9qaSn6Wrh+18DYko44AHlzwkJcFKi1/rMbTPk3HCtq4hcyqd24XKkrtekgmZRfEsBw+MjQG7Dtji5iEDedseXR1ZTlQml7HjX4zNB5khvEhv60hsZW7w5Q87yFdNBIzZDDdobLdf8506vOGpBdzINQE5W1ZL0jL57qSg8Pu5AYcOIoFv687Y3qpuAnGPQoCdKO+bmQbjVFWuiE73A1CaNmtdHpd1smLAAnvbu1bMfjusCV0rb26RdwQwjsKNE1zfQs7VOqu59iW2zyQSFcIhkBGpNpnV3MEAo4IOcgDHS5qSV9v/jxNV6SV+CDTUV+Op5IohY+faVwvGqd/11YpgMuZGRPz/rMYvwD/BlAk8yfoV/YjbzITPwQJWpR5cmTNqH2L8QmOrSiMh7elsJvqcDwDqidlhT0xZaW3DpDzz8S1V7BUzg3t70K9NUBKrDAu/eVo0BN/63wiO5HWR3J9SGEXeLdNK84o/ruybgIZdvjtTQAxW/dSvFAhA610ewJ70vUIyDWiETXmuYAU/mdggLt/svYHyNhhXaJDpSdkZsxOgx71zQbKBIfZ31Ajf3BbrCduRTaQwQKSogYiNZmdFghv5lu9IEPl/s3PKQED2le/wruu1K0v+kq7tWr96rGvMVxrof4i1EuL4ScKdl3MvVue7ImUws5nRdMA8U1VizRiSYGGSbXk6DJF1DgK0aFyXKcq8SeYtugDXJhu33zNUD2oARdavvKZib2TBf3QYtblnvk4r97KUticys71vWA3y6DPPDIfTOt+0iiylyeposfvUTZw/JHVB6shmMw5MJXIAtNCbM6yiGz7uPK5M6dE+DMUocDZbfatOvWqoga71sZvNo5kGn5pV2kv5jyXwn/Pqbu1U6NeoB30LV5pakN0HS27ELXcAX60lAR4nZFfRzVQMDAv9Uk48IQOYdYb1t8vaJ0268dfvwaGw0Lg7eKR7xs9PP7x6LD X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02f3fabb-7754-4047-3eeb-08d8f2b99a9a X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:50:25.1378 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e6zurrCT9AZCEykQ0+wg7PwMBisvY772/znBpyJDAUzYGjr19W3pusYf1jYoDpcg9cwMbx18c3BwLCgiuNAW91LHDKjIlWK5DI6aRKTQDuqP4sxco8lj8PKfh/kESSqA X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6294 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The security code guards for non-current mm in all cases for updating the rb tree. That is ok for insert, but NOT ok for remove, since the insert has already guarded the node from being inserted and the remove can be called with a different mm because of a segfault other similar "close" issues where current-mm is NULL. Best case, is we leak pages. worst case we delete items for an lru_list more than once: [20945.911107] list_del corruption, ffffa0cd536bcac8->next is LIST_POISON1 (dead000000000100) Fix by removing the guard from any functions that remove nodes from the tree assuming the node was entered into the tree as valid since the insert is guarded. Fixes: 3d2a9d642512 ("IB/hfi1: Ensure correct mm is used at all times") Cc: Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/mmu_rb.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c index f3fb28e..375a881 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.c +++ b/drivers/infiniband/hw/hfi1/mmu_rb.c @@ -210,9 +210,6 @@ bool hfi1_mmu_rb_remove_unless_exact(struct mmu_rb_handler *handler, unsigned long flags; bool ret = false; - if (current->mm != handler->mn.mm) - return ret; - spin_lock_irqsave(&handler->lock, flags); node = __mmu_rb_search(handler, addr, len); if (node) { @@ -235,9 +232,6 @@ void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg) unsigned long flags; bool stop = false; - if (current->mm != handler->mn.mm) - return; - INIT_LIST_HEAD(&del_list); spin_lock_irqsave(&handler->lock, flags); @@ -271,9 +265,6 @@ void hfi1_mmu_rb_remove(struct mmu_rb_handler *handler, { unsigned long flags; - if (current->mm != handler->mn.mm) - return; - /* Validity of handler and node pointers has been checked by caller. */ trace_hfi1_mmu_rb_remove(node->addr, node->len); spin_lock_irqsave(&handler->lock, flags);