From patchwork Fri Jul 28 13:48:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13331967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A711C0015E for ; Fri, 28 Jul 2023 13:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236807AbjG1NsQ (ORCPT ); Fri, 28 Jul 2023 09:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjG1NsP (ORCPT ); Fri, 28 Jul 2023 09:48:15 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2084.outbound.protection.outlook.com [40.107.102.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2262B26BC; Fri, 28 Jul 2023 06:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FFlh5jIvRqXRHPZgRfrUxnrjR8XwQzvu7lph7wZlAHrB4z17shlecKkaDk8lVw8h91qGIWNCVZFJoipEsl5CNUb/8JOqpY+d7uSxJaGXm3dTqojnL9jS1vDWrNnGPod9HkWHUM/2sXmFYADrWZ4GikX7R+t8p2mXNqmpFBgUOSurnxoTKkBSj0JqiafMZ/ZkeRN9JYxKG2tMjcMsoBIxvjG2gC9Ido+/ROWj1GXC+2LcQLNT6OF2cIU23+VWveFoM/iaLiXkAvzSeOUPAUMVL2iUKwpzKqnia3qdp+LBjxRE8xUOq+7iTxFux9d5MDZBHfdfmfPDp2VRPyakfS6b+g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TM6L6VrNVCyn7jSNkQoW26eRxHBDodfHCk9Sz8PtiVs=; b=VQ0KGm8TWA/nBDZIZVPyNt1m6CyL4MNGpom3NvgT3aFFcJ7tNyHhfTUfWC5JFLrmGECvqeUUJ8STwAP9C7MBT8k0nR2m12bhJ2XZ4rp9Lk8akYP2QmLBBpf2kqvudQq9mNdqoJnI4KLy7QYLXyWArYa12Si4y5eky4CD7x2SE3h6HEo8TI1gqH4km6TiYTJ8XEqJ+fsMaORrsk6yoLslG1sq0lpyU5aQ0y/WF+ntY8Y5geRLkqLcHnbENVtLD3pTDJ0p7xK5oFbo5aMgRZ9amL/iTqJlGmhIM97kibx/BF30TU9lYZc2Fd3Ssv59+OeTDFjfE2YUDAq5eIH4Np9DAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TM6L6VrNVCyn7jSNkQoW26eRxHBDodfHCk9Sz8PtiVs=; b=S4SIFS+x8wMc5rUL+2TiJfm302e0R2jfiPxRL0xoyKCDVcSgtSB2KVyU97s3O+rh9iq8GD4kqosBnID5gSbcgQ53v6QRqMXPa5dOTUtOU4uGofe4oHsrQkASeePC3Yx4YhQJh5U8dZdzAYRrbkw+IgFquYK/84ky+Phku5yHE77n2N/AEqCASqpfzjaRSEr+SbLlECQl4zT08zbqj1+Erl8PNUwsn2GaUZEIFRUaL8U53KVjAVIKC/+y64QAXjdP4RQypHyEoXFJ/UrqgRe5ApruewMf4vr8ELWk5HRqcallj6AlGWGl2rHlkPRta2ax6nQTJKeZUGX+8/O63NMlBA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by DM6PR12MB4153.namprd12.prod.outlook.com (2603:10b6:5:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul 2023 13:48:12 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::5111:16e8:5afe:1da1]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::5111:16e8:5afe:1da1%6]) with mapi id 15.20.6631.034; Fri, 28 Jul 2023 13:48:12 +0000 Date: Fri, 28 Jul 2023 10:48:08 -0300 From: Jason Gunthorpe To: Linus Torvalds Cc: iommu@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Tian Subject: [GIT PULL] Please pull IOMMUFD subsystem changes Message-ID: Content-Disposition: inline X-ClientProxiedBy: BYAPR04CA0028.namprd04.prod.outlook.com (2603:10b6:a03:40::41) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|DM6PR12MB4153:EE_ X-MS-Office365-Filtering-Correlation-Id: e92029fe-5271-4d95-91fa-08db8f7148e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KBgC/01R6+PLeGOmbQW+GxbgR0zpqaF42/fwjnSIjIlP8sCTgyVWhGHNy5aw9Ml42s1bJymJKGxqoPAs+/b2xPl5wjIQ7OJiQOzskbzQ9gQyocYw9EU3VbqVVRhiEiJciHRYyMOqVhSaLubNFcO3QroNkFKJO6JKhGTdzmknLyeYa7JV5tFqkwtbdxSX25mBZD+X8MXzpep96K+GiXFHw8cLdnIIaUYPLt7DhYO91UQWp7rccdHb67eIwKVzxkTgGD7FLXu3YVfafMTXYwJ6u+Z+XhsQj+VhO5LOspM3rE4ItaUoQ+3UiMZgVprjm6BTOvI+ZeN5pgq3iHYAcOjvWnJ+hACemZ/TMar4T22O/mR+w7is7heBE3htV1ZKavbn9ntBND0ItIvUEwX9OJ5W/M0xDcoz1npWj7KPG0F0YBuGLKqrVoqArfpKK5yZcHoEn29W/IPK5WiQbMs0o2lW8jJtWlciavVVv5GilcID4teLjA7uPN8cv/E+wFq2+hn8gId/xTZcSbFHXhOmvM/DBvIZUeX9Dj6VF5ROg/UAUQ6xa8Yj4y87L5xNnsQezMAUUBGercbC+1J7/1xbWNPR09Rpd6vn8/rndsKQyy7LUL2R9wEPtAgPsg7rEePauzDitmPqp2Ei/d5grGnN8qCWkw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(451199021)(186003)(26005)(6916009)(2906002)(4326008)(33656002)(316002)(6506007)(83380400001)(36756003)(41300700001)(5660300002)(8676002)(8936002)(21480400003)(2616005)(44144004)(38100700002)(6486002)(6666004)(6512007)(86362001)(478600001)(66556008)(66476007)(66946007)(2700100001)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e2qgzkApgE+B5IcJUc80TPSN/9drEIKVBzMKRtLKMHylmBCFZ32gL6qZWN9RNSoXL7A3f2O95nr55zPpbLL+hNzrEN/rPk5SnXWXSeMnVIksDdkWNK5PNu8bWmmfbhaBbXKZIpOJrRv2y0xUcHUmHDHqk6KLWU7uDSZXsDZXpzyF99G+N5YzotpddlZKnUMVcqJxTif4UrzQITRQ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t2sYlL5vdPHQWdXkttw3eeMK6EiyT28Bwia3YD0ze9wCUq7VrCaM6LYyrLL7Pt3Va39UAvkNG9df2fZASoraYitqw2g44U5l8g8gZ60yi9q9tcxLWLKNDyjoMk8408GM3f8dVDr+ZlQ+BkiNm2x3MvrYgog46O+0BAL5yGrLjMDIM397R5qTScnKbEULU/L1cOIVKIAybXDhmtuhQmZDUtOGKW42d/mM/e9x+CQ5oSAkucU2QvA1mOryQrPwVkss09br8udZjKv2eSLGAi0WJWmcG/66jvkV+co X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e92029fe-5271-4d95-91fa-08db8f7148e4 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 13:48:12.2758 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DQzirxTjBB6DQPz+rbhgLroQSGL0KPrKTeihCC3UJAqIDP9BbfLMzm0aj2I54N3Y X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4153 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Linus, Small rc update for some recently found bugs Thanks, Jason The following changes since commit 6eaae198076080886b9e7d57f4ae06fa782f90ef: Linux 6.5-rc3 (2023-07-23 15:24:10 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git tags/for-linus-iommufd for you to fetch changes up to b7c822fa6b7701b17e139f1c562fc24135880ed4: iommufd: Set end correctly when doing batch carry (2023-07-27 11:27:20 -0300) ---------------------------------------------------------------- iommufd for 6.5 rc Two user triggerable problems: - Syzkaller found a way to trigger a WARN_ON and leak memory by racing destroy with other actions - There is still a bug in the "batch carry" stuff that gets invoked for complex cases with accesses and unmapping of huge pages. The test suite found this (triggers rarely) ---------------------------------------------------------------- Jason Gunthorpe (2): iommufd: IOMMUFD_DESTROY should not increase the refcount iommufd: Set end correctly when doing batch carry drivers/iommu/iommufd/device.c | 12 ++--- drivers/iommu/iommufd/iommufd_private.h | 15 ++++++- drivers/iommu/iommufd/main.c | 78 +++++++++++++++++++++++++-------- drivers/iommu/iommufd/pages.c | 2 +- 4 files changed, 76 insertions(+), 31 deletions(-)