From patchwork Wed Jul 17 18:46:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13735715 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2079.outbound.protection.outlook.com [40.107.95.79]) (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 2F433125AC; Wed, 17 Jul 2024 18:46:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721241970; cv=fail; b=ajZtcPg8ieN3vJF2k9CrRTQdM5sBlVgYwzKnceY/W8jjB5QsP7GDErzOCejhjY4UYI4tzSYDSEB1591oPpLQQkXYeIDsmMcXHnslL0YJm6bqtVuL5/6Y9UQ25xu0CUDOHCgOQj2CfcZrtkhIoqbuNvtW8qft5UIas/dYUi4+178= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721241970; c=relaxed/simple; bh=tYX0bNjluCBuyzMfPGVPtJS3MAiwwhutaLeZTJXtANU=; h=Date:From:To:Cc:Subject:Message-ID:Content-Type: Content-Disposition:MIME-Version; b=kgFLLb2RTckzkXKOguXk89VhQNnJ7DQJqI7TsHjd30ZX8+1ZxcL1Do9eCQsE6fTCGJk/ckBtQy6O/C5znpCemNPzVRQR71xpUSX5rb2n+4YxeIjbwJLzd+yyDl7AJNf18Ldc4EHZwZQbaqfcS3Ee7RfHCY/RTzs8c93ddRZg+gY= 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=Ke95/4Iy; arc=fail smtp.client-ip=40.107.95.79 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="Ke95/4Iy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GI7U0DrXXHj3ajsQ2Repa82fdqcwexTR0LcqwZ9UKQfpmlaQLFtNcivObs4YqgCoQl+p8jcmoV+UMibdRqZi3aLQIEJAw134Kvmh9+RnxLFvKgLaJ4F04X9ImooWOXViWyIoEVlDqtyZZarKUP0PTIx9f2exF2CHpS1iV9T+Td6M/Qr4sGb7nidCEK69U7BdOUO0/NOK5BYe9VIBfC02BH8OuZCCMimP3Mp4K4A0zR6MIyGUjKYSk76ZTRkkmdhw1T7z5hS1dzEYWjOziRJSECUtTEtsWKHPu3HFtKb+AGl1EF5LqG4aRE7JZ1f0sg3MtZNdQ4CFhV5MShaGj2xVfA== 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=W35qIb44nCaDlPU0Obb/BZekX9OV5mElwlFyRgIIszE=; b=kHOZoyGQjZHeY5Bl/pu2aHzxpTYBwIFEM90wMDXOzJX+9WENNcbXDloc1I8QM+O6fM3zawGqHl342rMHGBmu/4jqzW2wpNoRtpVkiKiDsS2xk67J9/OD8FFn7rX9dW6QmrMzqdv/YuBB92Aql1dG3xvT6AO8DTZeGF3AfpC1H6aTgvNn9h0/dKULRcsbAHCOiE9u6b6ZRfnzhTJxa90ooHm+8LYXy9TC1zvBobYqAEKASzDIrBRMz6UB2/wI6RmNfIgA+a+toOXUpJKCwwTKOO5mGd4MNlrdwH0jnh3aX2cn1FC2V7F4YRr2VIh6pQE9OJdLDL76pFcIW3QFGEU/CQ== 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=W35qIb44nCaDlPU0Obb/BZekX9OV5mElwlFyRgIIszE=; b=Ke95/4IyF27T7EcjwzwexCmsQ0zmTkRiIaDreIrvoq5EMd9nE4iROIUUB/WCa+6vM2w24lxgOdsGrkylZuwogK/nNi/+oHqFnNwjg2KTP/ehO03R/ZJZtFE7pB3Du96ywDFQWs8Qo0Q3g4MumLkojsTuNRIGSsNhO58siC9CUTyxyktQ91Pw5mR62fwPIIrxKRFELrywnxXZtA4ny4uPRAXDNFbfBLJY3wiKquBpvFYFXBKG6jFrxX/8jiXgBfeZhJAIdrXutY29PhoY9Q8lmdZxsR9S3SUNOicTWFfqaCjJPsDryibVvevtbaVVuBht2MjxUzhdYXg6gsRFpbevIA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by LV2PR12MB5824.namprd12.prod.outlook.com (2603:10b6:408:176::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17; Wed, 17 Jul 2024 18:46:04 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e%4]) with mapi id 15.20.7784.016; Wed, 17 Jul 2024 18:46:04 +0000 Date: Wed, 17 Jul 2024 15:46:03 -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: <20240717184603.GA4188230@nvidia.com> Content-Disposition: inline X-ClientProxiedBy: BL1PR13CA0447.namprd13.prod.outlook.com (2603:10b6:208:2c3::32) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) 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: DM6PR12MB3849:EE_|LV2PR12MB5824:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fdb444d-e9d2-4880-7b78-08dca690b66a 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: kvURGxIpmaX7ID5y+iwa+3Tr6vD2Js0d8qMyUaS55DyvOzp2xOQuPlKCMXj4GwhDDTptq2Ri3bdoyl70DCDPw+r+2rVZNPkWddM0iQ/MpWnqAmLn5ju2uxcD2kTmoLAMjVNjzuy6U7dDbvcQtp/oXuitjWDQtaclNcwRlwbZ+62lfbcqbGQeInSAFINTn6aAthAvkFFCUMH5d+gtVW30gFeOhL48qFY0AY52n/0stq2gNS2KHJlJUzvlXBF/+VG8o+FHhdqMSCgrpwBo46MOtvt5LNZG9jnNLefIygMt6yDcQhQoH6fVI+kb+ncHUwg64Gt2gRYxqtlOxA0b88cm5yJXLHMKKH2jg7VcrDZexBUeQ63Hdl2HKKYgjO0MvsLNvrtXdbCAxtXwqrB/CAf0mcuGGBdXKkkxQwYjJ5gcgPDFPXKT0K/0yAHSQm8U6SSTFx8fgVHTo+pXBQaI/bbh/lX691tL3Lpq3VRk2d9eC8EDa8267124SFwQOsYfqZeZLAboZaBjSZYMaL06UuNFwcq45/fkbfF2TPuRQI2FZas4pHw6CteUuBigy++pHcWqx416pomaoVjnUuxGdQaZuptdIvjcLMrA32oRS7Y192dWP9P67XfKJ+Zb5HShFQVjvvjQ6h2qSVrd3WMR1OmDi2w+DJ98jI40bQD4TPXeev/Jpf2MDhC4PVeZ1V0ay+dFjFyte/vFv2iv/U9i4jaPmlCgfQ4R2M9uLeyZ4ipgKsWEriduoy5EFwtDpjQWY7i0Ph5G1ZFTG53LtPmXc+gU85dVX8nvVdlbEXqdFq27MVgEYh0riegItYf9PP5wGCCJdcLFHxsIKVX50H/wzElel/ZPaqM7XiclyMiI6pVRZt3q40rm5IC+Xdp4P94/EekUrnDo1KIhhsFxWqKxPgrW3gak0KSSHMMEyHCzr/8B46oBWSkzrgxwDHEMakEtatlJCg3zJRpsozI7BiRc2irZTHNi5OFq39AM6Dm8OYtltZ8OZOavB/RQfWLQpRM3MFo06cZUn1J/iTM1jlvcHpUcRJ4Qrj2/7+8ePcADkB/KN0iV1sFEGwGAa1JWYSYNGU+4VTyGslMQfaRqpoAC1vIMRUeakjuzN797P8T1UKWu3Uwmh0iNINw6tb9qmPMAX/9LbNKrCRbaP6TvO9PXCKO1E24MNRJHGuJtddBnmk0YcxDIkdesY3nMymNNkRli7DgSsLQrOB8UP9FlEUA9Gbmy0LAtO5+kfrrNCqYWhGJgs81MqbjvsmdNA76vdhIj9wQmQrWCYdNqEv4VJ8j6jAAjZawn0GUqgAxoPOyHTlU+d/b1e/h0tMi2VfNaKTECKdBBiCOYGINtx+wMpfBtmktaZi/DgnIE7A9U1He8ZbKx8q4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.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: Hanzxi5yA6qGoZ666DzSra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5dsUbpOvxBG+DWc4d2sJzqBzfFLiIJfartgcHpcLwTo+4RPsGRbkbZDMW0ai8KapjqodcFQIkD9D4en3DVsdGUc8AEFxh6SVSBKJGehogrQACifXALcZkY8yp7E1Dj7sIXQ1K2Wa6dE/ox60sNOv/Zhj4HpTcwB3k5XnCK9pDCwb7kslQgfYwOoKBY50s90rf8TT7jkhB8HkjU3cN5tTQg1apU3BBKJo6Qvl0mLmuz3jHzgEVcuFXT58eO7qHSp4fxjBufdP/VLmypCRfVVf9OdyfBlFX9vU5GIeVkHkqUbQB7Xs1cHQGCDtWdMGF9hlqyLHq0+cqykcuPPI3LZLXfEy10mQyQ4+8mMXN4WFAXJjuJfsYZHMgLNSOoudpUi99n/ZijxrBGvTqhwT5i4iWIBHkqDB6L4dp4q9fRrV9Z+B4Duxyld9J9XMEdTj9s1zDNJD5jVQgDN1LrHt0bOsdr3leyRVPZ3ZQsdUuFZPuGFR5e3HNMAEwvQIp X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fdb444d-e9d2-4880-7b78-08dca690b66a X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 18:46:04.6625 (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: 7/mCVEaC7bg145TdJbh3sIz6Q6e7zMGH26UPVooTGJxqkglWu4M6QSR5Uz0LlKJo X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5824 Hi Linus, This PR includes IO fault reporting for iommufd, along with some improvements to the dirty bitmap reporting library. Details in the tag. For those following, these series are still progressing: - User page table invalidation (non-Intel) has a roadmap: https://lore.kernel.org/linux-iommu/20231209014726.GA2945299@nvidia.com/ There will be at least two more invalidation IOCTLs - IOMMU_DEVICE_INVALIDATE and IOMMU_VIOMMU_INVALIDATE in future. - ARM SMMUv3 nested translation: https://github.com/jgunthorpe/linux/commits/smmuv3_nesting - Draft AMD IOMMU nested translation: https://lore.kernel.org/linux-iommu/20240112000646.98001-1-suravee.suthikulpanit@amd.com - Draft vBTM support for SMMUv3: https://lore.kernel.org/linux-iommu/20240208151837.35068-1-shameerali.kolothum.thodi@huawei.com/ - Draft RISCV nesting support: https://lore.kernel.org/all/20240507142600.23844-1-zong.li@sifive.com/ - Grace command queue passthrough iommufd support: https://lore.kernel.org/all/cover.1712978212.git.nicolinc@nvidia.com/ RFC patches for PASID support in iommufd & vfio: https://lore.kernel.org/r/20240628090557.50898-1-yi.l.liu@intel.com https://lore.kernel.org/r/20240412082121.33382-1-yi.l.liu@intel.com/ RFC patches exploring support for the first Intel Scalable IO Virtualization (SIOV r1) device are posted: https://lore.kernel.org/all/20231009085123.463179-1-yi.l.liu@intel.com/ A lot of the iommufd support has now been merged to qemu, with more progressing. Thanks, Jason The following changes since commit f2661062f16b2de5d7b6a5c42a9a5c96326b8454: Linux 6.10-rc5 (2024-06-23 17:08:54 -0400) 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 136a8066676e593cd29627219467fc222c8f3b04: iommufd: Put constants for all the uAPI enums (2024-07-15 09:44:54 -0300) ---------------------------------------------------------------- iommufd for 6.11 merge window Major changes: - The iova_bitmap logic for efficiently reporting dirty pages back to userspace has a few more tricky corner case bugs that have been resolved and backed with new tests. The revised version has simpler logic. - Shared branch with iommu for handle support when doing domain attach. Handles allow the domain owner to include additional private data on a per-device basis. - IO Page Fault Reporting to userspace via iommufd. Page faults can be generated on fault capable HWPTs when a translation is not present. Routing them to userspace would allow a VMM to be able to virtualize them into an emulated vIOMMU. This is the next step to fully enabling vSVA support. ---------------------------------------------------------------- Jason Gunthorpe (3): Merge branch 'iommufd_pri' into iommufd for-next iommufd: Require drivers to supply the cache_invalidate_user ops iommufd: Put constants for all the uAPI enums Joao Martins (11): iommufd/selftest: Fix dirty bitmap tests with u8 bitmaps iommufd/selftest: Fix iommufd_test_dirty() to handle