Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp251166lqh; Thu, 30 May 2024 23:21:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUV25yMvjbkhVCCmqrH/Uj4p+TRihrhl7MiivNK/Tb0giLPeGTbjQRs3E/y5ZSLvPvY8cync4n3C2u0ogDmaiSOSHfyI39kK675chFQyA== X-Google-Smtp-Source: AGHT+IGMr+Ch59ASIT4jHfDtshTBKuAm8/1KlkDHMZKS1SNau2REdpFzk08Xfe0e4+j6nGitrEgA X-Received: by 2002:a05:6214:4806:b0:6ab:9a5b:557d with SMTP id 6a1803df08f44-6aecd5785a4mr12018846d6.21.1717136465303; Thu, 30 May 2024 23:21:05 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b402248si13939806d6.196.2024.05.30.23.21.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L+1jFIzR; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-196342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F233B1C21222 for ; Fri, 31 May 2024 06:21:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A54077F466; Fri, 31 May 2024 06:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="L+1jFIzR" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 CD8014D135 for ; Fri, 31 May 2024 06:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.16 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717136458; cv=fail; b=ZNCi53Q0u+vHY4P7s3xXtb5fJATWrvXOA0cpfO6UtucyLGx1j750eCYjQFZDexSmocVctJCfp1M6+MAFbHXowlaPKQPkLXB78IIkXFW/KRzIQR0agNzN+Nu/5SMrrCDwNBPeVP/5s1sQNQQUfbLYEMrgYNJ/wxK/nSbMkGd53YE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717136458; c=relaxed/simple; bh=2ejHtZMhuW109w6mLnjs26oI8Lpw8WN2QMRdo6opaOc=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=bnOTwhwcGFCMntBhLXOg//HyPCiwb+WGHGQ+pIDTNKWk3w+R2kAqExNIiQQJVLuQe/i6kqwqhbfIUTS/rTFi5RQ2zo8Re6ngINdazlPSRoYHDmoellYidm9Dft4+2AcPAVQ670r3YLUA6NhUCIsS5T0ILhJPKHy5xpdWFIEjDSA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=L+1jFIzR; arc=fail smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717136457; x=1748672457; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=2ejHtZMhuW109w6mLnjs26oI8Lpw8WN2QMRdo6opaOc=; b=L+1jFIzRMVYjjGUJmDX1D5N+8vlSrzZL6tFesUWpPogxU2yAEyYtiVNO pBhhFnv5umptzoFDwWI/xQ8CL1QUlB871fSjq/xaSmkMG1aePfMqO5TkH ItduFpwht3C7A7rV1+/zgfCfA3XsarjCA8QcvJ+RYlUntBykGAF2Ax2ai lqZKtrdgQUb11+Wdo5xBx1+ZIgEEr2vBwXu+oEj0zSOPEkMhffwoEblFO PUJ3I8yR8ZhZbhNSbM62LCWypYMd1Qx0gXTqj7ZjYPruuZWSM6of81JLs 1iiCghu0f5yvaks38dCj0VdVzfz71uL+IuyFx0YCnp9fiTejvuovGY7U4 A==; X-CSE-ConnectionGUID: UErXlQoZSqqIOkXkGfy2Cg== X-CSE-MsgGUID: artstYBfQ8unVyJbaVDiVw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="11835081" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="11835081" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 23:20:52 -0700 X-CSE-ConnectionGUID: kfAOBe+cQgWWwqT+qps4oQ== X-CSE-MsgGUID: v85/ncJkQgaqwrnti0aGLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="36639288" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 23:20:52 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 30 May 2024 23:20:51 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 30 May 2024 23:20:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 23:20:51 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 30 May 2024 23:20:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MF/l/95BhzuJB1nQVdHWwcuSU3+eD97Tiq9CAnc0EmJhBw/uXOSGvVm9dV0/SU6HAKwITuogkscmYwGvcfRL7GeA62lSD1zhp7ivJvCFGnXfZ/2rTDmXsWdD2BnwMDaKFB19eVrP3e5cUy+WlISOz7sb3fncnCwmsq8umQc2a1JW8Xu0qUQWzo0dZJKj1GKU+/UQfVXhfQw9ETGJgWcxfBBV09R4CzNBMem00Zx7e3y5MMsWinGPGTiITglTcm0r5bfJmDwALwL3tF5rp37OUQTNpglSiAjdZ1aBbWIz5sJMctPovA8HnW06B4xAJdgLH2iWUCnBNoZkVU+fQ8eapQ== 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=r8+PdSHCC+FXZ3Ff6BFagDHeVwpEHRe7XmVaXm+rNOE=; b=XQjJNfrjwY474SqlvmvgTlQOvUlvjfC3u72l2YRtQMr0r7NjkUlJ8LNWujKsq94HxYGDEvljeMvF4EVRvX/HcSCq5aAdQ0KDSbcT5GcstOTHfcM+NL8AmUmHjRNrdAazhY/kKw/ty3nLKLAz1okYvritr4FySTogGHXd1klpfiHSUVmZvkxleKGEc0w4duPX5tKUm5crkaL7j85Ls2Ja8ZvbYEiXBk5AgXBV3rmxB0QtIgSUEYImVYxYZ8bZz2iYLw9SaYkLofl+TIxLzeJxzq48XLXV5qqNNuGzsedKgV+8BngYsWfEm19YBFfjhF7/GRt8+jClN6Mo44sPhn5Crg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) by DM4PR11MB6312.namprd11.prod.outlook.com (2603:10b6:8:a5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 31 May 2024 06:20:49 +0000 Received: from DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::d244:15cd:1060:941a]) by DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::d244:15cd:1060:941a%7]) with mapi id 15.20.7633.018; Fri, 31 May 2024 06:20:48 +0000 Message-ID: Date: Fri, 31 May 2024 14:24:41 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/20] iommu: Refactoring domain allocation interface To: Baolu Lu , Joerg Roedel , "Will Deacon" , Robin Murphy , "Jason Gunthorpe" , Kevin Tian CC: David Airlie , Daniel Vetter , "Kalle Valo" , Bjorn Andersson , "Mathieu Poirier" , Alex Williamson , , Jason Wang , Thierry Reding , "Jonathan Hunter" , Mikko Perttunen , , , References: <20240529053250.91284-1-baolu.lu@linux.intel.com> <7af4fee2-1b37-4eb8-9d03-8b1a402ec00b@intel.com> <34d23852-ea68-414e-92ce-61dcfe6a0368@linux.intel.com> Content-Language: en-US From: Yi Liu In-Reply-To: <34d23852-ea68-414e-92ce-61dcfe6a0368@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0006.apcprd02.prod.outlook.com (2603:1096:3:17::18) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|DM4PR11MB6312:EE_ X-MS-Office365-Filtering-Correlation-Id: 60930d50-9c20-4bda-b80f-08dc8139d020 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OUNUS1RmVWw2bzRLSVhPUldLcHNHWFo3V2IvVEFhR2pMQ1lSSE1SK3B1cXpM?= =?utf-8?B?YVpONDNiemtMd2pUaFhDdTU5YklNeExjWnRCQTA1NldOTCtMQytFN0djTVF6?= =?utf-8?B?SXcvZHp0K1duUzN4WEMzdStJOHVIcHlzQVJqMG9tcC91Z01BNE92VHRlNzI0?= =?utf-8?B?alcraHcxVGlNbFNjejkzN0JDVDlZdVA3QnVXaVFVZ2pLbGQrTzR6UEZiMktX?= =?utf-8?B?cVBHQ1lXR3d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L?= =?utf-8?B?by83TkxoM1dBUTdlVWhHZ2pwYWVzNUxqc2w1Q09HTHFsQ0RaaW8yVm9ybmFq?= =?utf-8?B?aUhLVmw0dW42WkVkNHFFcEpTWndxVkNQL3VvZVBxV0xxcFpTVnhiYWt0czNY?= =?utf-8?B?SGJTaUtldlRKQ284V29maXFucjdPVTE0anZQbjBBQVZHT2dnenNhSHU1RTMv?= =?utf-8?B?VDNZem51OXpGTkg3SGxnclJrSGFzcVJiNFF0d3loL1BYL0FuZDFQWTFJZkNt?= =?utf-8?B?VzlOZUNUaUwvbzBEcFp4S1ppZDNqNTJReXptVWgzeXJER09TaFlmc08wQTI5?= =?utf-8?B?ZzNzQlY3cHVEOC8wajhXcUJFNFhBdnNicFBiaGNUdE9DeFFnVkFuK2N2VGNN?= =?utf-8?B?dmpqYm9uS2R2VE0wRkRhYVliNGZzY3JyU2I4eVBLWUpuYUk3NmQyOFplZEZH?= =?utf-8?B?WFh4WlVidExVUktBOTZWaFYwYVNrMStVM0VmTTJMTWUva2l0TDZBWnVma20w?= =?utf-8?B?ekhEYThTNXdFeFlZQ29uVlFyZkdQVFd5ZlBQNzR1MjU5U2lWVE5mVzVHNmNB?= =?utf-8?B?eUdQOGtJajluMEdWMTNlMCtKWE9TYksxd084b3dYaXRZS1BOcVE5VUVRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7529.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ck1VVWtXd0wySHR5ZGs0Vk5UQ0wzdDYvN0pDclNheGcrWjVPcVE0MDFTK2F4?= =?utf-8?B?U2NUZDQrUldvK2VxaUJ1M1pjbVdlYmNqbWluZzRMUGZmb3BMQ3YyUWF3MnZ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1RjZmVwUFVrd1dLd1RLMklSOXVIRUIxaFRtd0l2TCts?= =?utf-8?B?aDl3cWVuYjNRM1BQZGdkejZqRmh5UnhlZ0tUeUtwWm9iZ2IwUHU1THpiNys1?= =?utf-8?B?MTIvZ1hXSWYvNk5vLzAwNzVPSmZaeVc2SnBwaVNZU3BRQmlLSkF0S3Bld3pk?= =?utf-8?B?U2RpcjNWcFBQdStlWkRSS1RJemRUeGxHeGN4UUpnZUJCUnJvMU44b1Q4SHgy?= =?utf-8?Q?Zpmc6/e78OmvxGNrlp3IsuyOz?= X-MS-Exchange-CrossTenant-Network-Message-Id: 60930d50-9c20-4bda-b80f-08dc8139d020 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 06:20:48.7749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JIB/BGNcwg5Ebq6chmyTaomhAhxV71xX8ibb5XWWvjRczDHZhtG3JeH5zwTEBl0G3e75uzKyN1YOBNu8nWnwGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6312 X-OriginatorOrg: intel.com On 2024/5/31 14:00, Baolu Lu wrote: > On 5/31/24 11:16 AM, Yi Liu wrote: >> On 2024/5/29 20:02, Baolu Lu wrote: >>> On 2024/5/29 17:03, Yi Liu wrote: >>>> On 2024/5/29 13:32, Lu Baolu wrote: >>>>> The IOMMU subsystem has undergone some changes, including the removal >>>>> of iommu_ops from the bus structure. Consequently, the existing domain >>>>> allocation interface, which relies on a bus type argument, is no longer >>>>> relevant: >>>>> >>>>>      struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) >>>>> >>>>> This series is designed to refactor the use of this interface. It >>>>> proposes two new interfaces to replace iommu_domain_alloc(): >>>>> >>>>> - iommu_user_domain_alloc(): This interface is intended for allocating >>>>>    iommu domains managed by userspace for device passthrough scenarios, >>>>>    such as those used by iommufd, vfio, and vdpa. It clearly indicates >>>>>    that the domain is for user-managed device DMA. >>>> >>>> user paging domain? It looks to me user domain includes the nested domains >>>> as well. >>> >>> Yes, nested domain is a user domain. The iommu driver should implement >>> iommu_ops->domain_alloc_user for nested domain allocation. >> >> will it be more clear to name iommu_user_domain_alloc() be >> iommu_user_paging_domain_alloc() as it is mainly for paging domain >> allocation? > > That might be better; let's wait and see if there's another option. > >> >>>> >>>>>    If an IOMMU driver does not implement iommu_ops->domain_alloc_user, >>>>>    this interface will rollback to the generic paging domain allocation. >>>>> >>>>> - iommu_paging_domain_alloc(): This interface is for allocating iommu >>>>>    domains managed by kernel drivers for kernel DMA purposes. It takes a >>>>>    device pointer as a parameter, which better reflects the current >>>>>    design of the IOMMU subsystem. >>>>> >>>>> The majority of device drivers currently using iommu_domain_alloc() do >>>>> so to allocate a domain for a specific device and then attach that >>>>> domain to the device. These cases can be straightforwardly migrated to >>>>> the new interfaces. >>>>> >>>>> However, there are some drivers with more complex use cases that do >>>>> not fit neatly into this new scheme. For example: >>>>> >>>>> $ git grep "= iommu_domain_alloc" >>>>> arch/arm/mm/dma-mapping.c:      mapping->domain = >>>>> iommu_domain_alloc(bus); >>>>> drivers/gpu/drm/rockchip/rockchip_drm_drv.c:    private->domain = >>>>> iommu_domain_alloc(private->iommu_dev->bus); >>>>> drivers/gpu/drm/tegra/drm.c:            tegra->domain = >>>>> iommu_domain_alloc(&platform_bus_type); >>>>> drivers/infiniband/hw/usnic/usnic_uiom.c:       pd->domain = domain = >>>>> iommu_domain_alloc(dev->bus); >>>>> >>>>> This series leave those cases unchanged and keep iommu_domain_alloc() >>>>> for their usage. But new drivers should not use it anymore. >>>> >>>> does it mean there is still domains allocated via iommu_domain_alloc() >>>> on VT-d platform? >>> >>> I think the drivers mentioned above do not run on x86 platforms, or do >>> they? >> >> cool. BTW. I know out-of-tree drivers are not counted in upstream review. >> Just out of curious, is there a formal way to let such drivers know it is >> no longer allowed to use iommu_domain_alloc() on VT-d? > > As Robin suggested, we should try to remove iommu_domain_alloc() from > the tree in this series. If it's completely dropped, that's fine. OOT drivers should fail in the time of compiling. -- Regards, Yi Liu