From patchwork Mon Sep 23 17:45:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13809861 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2045.outbound.protection.outlook.com [40.107.243.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CC3916426; Mon, 23 Sep 2024 17:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727113541; cv=fail; b=rgkBRogDt+k5YSQXx81TiMPGYuzAfwFwDdrRPrBg+IDiLGyGX4SV8fL4ptQGbm6iWkaxCryXKt2NsjkYwzffdceMQZQS6lWLmwfNaLgjzhtllCIkCe4643LE1akMcDcIHYeoGNGqJ56NKaJgQ7It0jHeJgRMPe/hxY7frfTIN7A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727113541; c=relaxed/simple; bh=gasvsgI4MIUpLnyDJMfjKB/3yBwvDoka5JaY1AGVX1M=; h=Date:From:To:Cc:Subject:Message-ID:Content-Type: Content-Disposition:MIME-Version; b=fvGl5iv5Dmxr/ncFfryw4UfCbpxSf/47w79TDmM79JEprUmMaGIIxv37nqgdrzEGWQlCYINxKae+xuY8Z8s0/PgIr3M/pPGxepHif/4QQtQsrNio0Ig09Oy7OOHBUWrXnsNPIIRHjA3X6aNgdS+3HPW5QnnPfCeTcqGxkX2oQTk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=QqTR3JsV; arc=fail smtp.client-ip=40.107.243.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="QqTR3JsV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Smbi7M+Kagwqitp7f53IYhB3ygqt72z6pwhFGJNMttup81OOXiuQImCGwgg3MgyQMYAkvwrM55fId0GiH0fmExfqOquW7y89qxfKrHKFALTBA4FSTgWiZkEJ/TVUOjeF9olpokXMmB4dskA/qi9S6Ptztm0nyrQS3aQTQXp4aMvXsXo7mmBorp4lGyANWifyI4zaNeh1YRXN3TLjZU6ut5/lR+OXCpwYqCy3924aoGbRXJNNW0KwqtmCaIQvZkiSTUcJkl0PaGtyO7vWOQWYqfFSOsGOAQB/PZuNIdYekrUuPrGBXnvCUBOiGXUeN312DnGL90siJWKOHClaluH/BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=BU1n3Kb2p0WmqJzm9gEL6FDmDI5aJ5hVhtV8h3lmfTU=; b=L1PBN9L2RSG7+1Zsv2e7ucgzJEVIhGbx9xvQE9mnL4hRuwEoMTZmBDs1py5irnM78x+t/dQF/5OaNkkeFqOveljc5TqnWAKrHLljJPXWFXzVOo1Jl+Gh3MwA2E+mSufFsuBkSfrNdBSP+resmd6PshNBI9B6t/09kFVsGoXAfjuzi5+STIrNPE9pdCJS36wrH3IxViVipqZh8P989ujSkmEglMxcYCm0+HrPi0MLlsCfgE9dutyHYxy7t0RHfQo63Wu3PoPvl2wHNmiuxeCFnFad4TJDLBS159owV+MQiGfOaThSRH5FXH29S9uPlkJZjy5P0hmYWlCf6qZ7vz/wJg== 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=BU1n3Kb2p0WmqJzm9gEL6FDmDI5aJ5hVhtV8h3lmfTU=; b=QqTR3JsVwuNVUvudWoaSM55RoSQKffVon4XdIaYnoe+2Iac/iykxq6rN0lFICzdOd9rDEVmPVdsozyy4kT5WVYOif9+j2+o0/Qa0AuaOf2RDuDOLwFiBLHUkTLBzPamLGTzILiMUWSQLvDxIilLK/RVNAmsmw/a5pwjKqzr5FP3DTDYHZaJh7xmjoAB10uG5zAKJpbsJJZBB6IUXCh1w8MP0tvtJWTVn+YwKSaAbyq8rtjoxlyuv0FsnG3cxWnKsadQxRdbVMvQ/Ix01ZglhQ56QIxUb+hq9Ms/WTPmFwSvClejvWipnQGLbdsKsZPq/5Z+oQ7XV99UwVOFzZGNDFQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) by DS0PR12MB8814.namprd12.prod.outlook.com (2603:10b6:8:14e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 17:45:37 +0000 Received: from CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732]) by CH3PR12MB8659.namprd12.prod.outlook.com ([fe80::6eb6:7d37:7b4b:1732%4]) with mapi id 15.20.7982.022; Mon, 23 Sep 2024 17:45:37 +0000 Date: Mon, 23 Sep 2024 14:45:35 -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: <20240923174535.GA77474@nvidia.com> Content-Disposition: inline X-ClientProxiedBy: LV3P220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::15) To CH3PR12MB8659.namprd12.prod.outlook.com (2603:10b6:610:17c::13) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8659:EE_|DS0PR12MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: c4b5c53b-bd96-4c14-3906-08dcdbf78815 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: FamQrCwX/7nb4hAaA4QFlxMa2pCsFl3tiyp1Te/tyclgx4oPaGjWaCgg/tLzC5Dqo297CLDl7bWerJR5sDpSiZLFmxCZkAL/SD0X43PiQqejIfevIFETCcu0bWsiT2isrzGnjiV4g5rVjxZEsW8QkYJrxjt6wR/kgCwvhlv17f4+10UQin3Dd4r8FVVdjLGh/1muMKVnMy3aU8+iqp3D0qPhWsk8Sv6virwFaoUyJ2Ur/WKy3Oc0PY8r3pnAn4R3a8AZYWd8XivCre1fxxvNHObcapLorWeIGiuuwQE5QZ/8ZGrCqro3CiB9pGzrteAu9mW5oGQWBX4KcFZ8t4LOIJEKU7wOz9NssXE3hujchw8b4MqVr3liS0Kg2UrB5zb6OOkaLueqMK8gtnC66wARi+b+UMAztqJu+6BKfgbzOaE3fu9Xjb+nUTOsAGPtOS1Oibe/v4lj/oVRmmFSRFHNBVqld3beq0hSlTeqySIWxQV4HZncb8WQiUMqKMIiurmf5zNzpTskiEKZ8s856dvX52ndSsdhoMPPK7wtNAohyfMCCMkTvu3Y0aZIZX/KJA0qyeeDQ+pLL/YiqIcbZFtqONw/RpSMe6rHI0SUAwPvaVP5fcNV9LMbzvbbk8aeiwAi/yIrauRbQs/1XG3P8+IjK7j2X19gDkNCJYD0KMN5AfXn0W5qa5uJQQBFs8+oCwb5TGiWihTuSA6aaIEFeP4jcp90bxEgHcsol2ZrVvGReVQSxUTDOZNL5cHwJ+F/6gKeWqccVhThSYQ/p5YGCSky++lk/9jq8NPbpoI7giRnoU7WbMhR6Rvykx2mk/J0TVHP10ndecTm+PkaqEqP6IEmsH3qw3TX/Z94YZTlnqtIY44EzU1y4Tbm/L86L7eI5yZa4LTeV5p290biag44BrvNjRABOaKq6nFkqTGQ/k3+B/Jtaqp4MgDVfoR43STFaUPd3hOEFixCbVMvmWeO3F6LlXdwbNJtzpxIoF384++gEUGf9axQY1nfnDVEKb0BSEhVJinIfdxqqnMRMYcCxcbnQ0G3XyBdhR2RWiO3A7Jgvw0U+/2abMOAC/dLmDBFbF323INLbCe4aIG5NnJGLnuOLafWV7LdTwjV+OQ5pyD42Q+UyxqvpjWAubQ1OA7YZ5ngbYFqruyGLK9eFjYOLG6izmnMk/mrhtQ5C5oPcD+mp89YeasZCFifkHbR++qICn5hz5lNmf7LK6sb6fqeWy4P65WAqQJk2FDkJmRNau6CZtEnueOHsLSc8DUTRvVmHrLOO1TTLblxFGuQTbxy6UJgiq1jOgTkhWCIxDshYGbbLFfKKGpuRZwpQPrZrQj+kcIOp1MoZ0Gvj+gVK3qZD56WBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8659.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0Tah9uK9rK64HtY9h1fiqT0hjERyfxhI0UQc/MIe386O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FrxQXPUPTLVa036Br1I1Lehd72A86DwNuNCkhUKXKRpdXV3GYjklhEw71l5pBxocfJH4A52Epkx9hvtK+6D3gYAO+h+rd3pfaCaO2oIw+h3mPClrJsz6scYSjEEQbPcPX8zSr+dtJJPLIBTyEg97YgBXRiDjxAOK08LyQelAryUC3iNTMBzwYIoc0MT9SfJCiLbYtxnfabsAEDKP1pfDzrEi0L1Y9VAniGzl/0IYJDqhzBcn0mirVlfJvt7VthMAqzzucc6iWFiCibF0Rq3UJ353RcPogo7xeG2Dr8LIiMDzx0fHSjayf3GzjdEmJo7XSLHy2a7CGX/4w+tMgzb7ZvKX0UKbCT+KuoH3ihy/owK52h6neVvCXZwMmVT+6yHWjgAszUFxdhKxPhZe2R5q8cA+o8W3CIl+xNlP+upwmE2okaKWLdMkCOnstKKQMyOdi+gmPOf0E= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4b5c53b-bd96-4c14-3906-08dcdbf78815 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8659.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 17:45:37.0122 (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: Rx2ItQD7HGJZQE6D5Y9brf2vSGC15n79W1Rh75oF8eZ5vx42e7f8IzV+jchwg1Ak X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8814 Hi Linus, Nothing big this time, I was hoping viommu would make it, but not yet. There is a small merge conflict "take mine" to resolve, the mm tree added a debugfs.h include to a file that mine already has. The tag for-linus-iommufd-merged with my merge resolution to your tree is also available to pull. Thanks, Jason The following changes since commit 5be63fc19fcaa4c236b307420483578a56986a37: Linux 6.11-rc5 (2024-08-25 19:07:11 +1200) 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 79805c1bbbf9846fe91c16933d64614cbbff1dee: iommu: Set iommu_attach_handle->domain in core (2024-09-11 20:14:07 -0300) ---------------------------------------------------------------- iommufd 6.12 merge window pull Collection of small cleanup and one fix: - Sort headers and struct forward declarations - Fix random selftest failures in some cases due to dirty tracking tests - Have the reserved IOVA regions mechanism work when a HWPT is used as a nesting parent. This updates the nesting parent's IOAS with the reserved regions of the device and will also install the ITS doorbell page on ARM. - Add missed validation of parent domain ops against the current iommu - Fix a syzkaller bug related to integer overflow during ALIGN() - Tidy two iommu_domain attach paths ---------------------------------------------------------------- Jason Gunthorpe (4): iommufd/selftest: Fix buffer read overrrun in the dirty test Merge branch 'nesting_reserved_regions' into iommufd.git for-next iommufd: Check the domain owner of the parent before creating a nesting domain iommufd: Protect against overflow of ALIGN() during iova allocation Nicolin Chen (3): iommufd: Reorder include files iommufd/device: Enforce reserved IOVA also when attached to hwpt_nested iommufd: Reorder struct forward declarations Yi Liu (2): iommufd: Avoid duplicated __iommu_group_set_core_domain() call iommu: Set iommu_attach_handle->domain in core drivers/iommu/iommu.c | 1 + drivers/iommu/iommufd/device.c | 56 ++++++++++++++++----------------- drivers/iommu/iommufd/fault.c | 5 ++- drivers/iommu/iommufd/hw_pagetable.c | 3 +- drivers/iommu/iommufd/io_pagetable.c | 16 +++++++--- drivers/iommu/iommufd/io_pagetable.h | 2 +- drivers/iommu/iommufd/ioas.c | 2 +- drivers/iommu/iommufd/iommufd_private.h | 32 ++++++++++++++++--- drivers/iommu/iommufd/iommufd_test.h | 2 +- drivers/iommu/iommufd/iova_bitmap.c | 2 +- drivers/iommu/iommufd/main.c | 8 ++--- drivers/iommu/iommufd/pages.c | 10 +++--- drivers/iommu/iommufd/selftest.c | 19 ++++++----- include/linux/iommufd.h | 12 +++---- include/uapi/linux/iommufd.h | 2 +- 15 files changed, 101 insertions(+), 71 deletions(-) (diffstat from tag for-linus-iommufd-merged)