Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp499828lqb; Wed, 29 May 2024 02:00:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYMcCooD1IavpiF5x2oG7eeOzrzFJABw65Rq8quotdJjcf01FCxSuq6Nyj719e19TaciaY6qu1V/B792qOXJyd9zb17P+eDMD5FJVeyw== X-Google-Smtp-Source: AGHT+IEBSiRzgXElJO18MSWrVh4LdDqsj4jLOEXjUNZMmcS0HDzrYzaI6JL1wM6HmCUOjqUJuypi X-Received: by 2002:a05:6214:240f:b0:6ad:78aa:9150 with SMTP id 6a1803df08f44-6ad78aa946bmr100147616d6.8.1716973247753; Wed, 29 May 2024 02:00:47 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac06f53299si124827916d6.32.2024.05.29.02.00.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 02:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EtnSnUyL; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-193812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193812-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 6C3101C234B5 for ; Wed, 29 May 2024 09:00:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3352616936B; Wed, 29 May 2024 09:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EtnSnUyL" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 5EF9E15E5AD for ; Wed, 29 May 2024 09:00:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.7 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716973241; cv=fail; b=hkSejgndS0H1yPNZzz9/rLpBlvl5NgxuHjmsCIKUovfWS7NgnUn4maZy/PMNBl2OKFZ6tlh4asHMiqtPQYIMsrDzg9mVq8IlXnguRlPBl56u0aVzDKwfHRX26ywWHw+ib4EEsgfgZMNRXf4xK6C3W8hz6sRJ5ocDTwQqnMHRgdU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716973241; c=relaxed/simple; bh=X2YJpWZCcjZXeRY5a3kXTww9fnKt+CSOSvKWn1yjMco=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=pLZ2D0ddLidQVu7gTqWmVzUeWeRcmhH/yKTs8tkxEk6WLXGacVZeweYAxqyXQnZqZn253uSrQQRTUoZHsIJHMCDPoRSJxSLBd8cf2SjXFeH32KMSmeDV50AYqrSNK06dPZ4N9dBuonOu+Bz49Q48hZskNbm2WvYa4Par6HporVU= 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=EtnSnUyL; arc=fail smtp.client-ip=192.198.163.7 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=1716973240; x=1748509240; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=X2YJpWZCcjZXeRY5a3kXTww9fnKt+CSOSvKWn1yjMco=; b=EtnSnUyLA47fpmPqjk/f2zND4NCwgaCIJi8P5wcztCIpZWfLyHdWqNFc ZmYZ2Vw6b6Z1F8BvGUhK29fxg0f0tfQ1UF0VddXr4yHgrIR+4YbBCfGIp 9QSSBoNt2wemc7XCfKn4FF5d4W+rT8e8CXODpI+ek+wZ2zqEiP1mkUoxV dUG41XhIRqqtxQI9UF3fUnB+ZjCau1P0JPvYS3yPjPssxvUMY9OxKaOaY 34zpeG6vC41LIYtgUxd75E33LSVk4YYpBO94kqCd2rLc+fVeBLe+zW8a5 SNULYssh0xsNWR1y/JmmvwjWSzMJoRPGy2PDXU7ucNxEEDbl/vI7LNs5O g==; X-CSE-ConnectionGUID: DJLXlMpaSfyfB/AwFbCuCw== X-CSE-MsgGUID: PUHIDtp3SimvRhV9zjUd7w== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="38750924" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="38750924" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 02:00:39 -0700 X-CSE-ConnectionGUID: L8x1kHWpRDq3RajMGD6kHQ== X-CSE-MsgGUID: FFvOnSAUSfKWAPrL8PXIaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="35982404" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 29 May 2024 02:00:39 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 29 May 2024 02:00:38 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 29 May 2024 02:00:38 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 29 May 2024 02:00:38 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 29 May 2024 02:00:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnItq7QhiPS+zchI0JOE4z9hr5G9GYdGkrG5otz6JpmaAOlCOyPKGQeiPiEmgsO7vk0SAJgPeC0M+JYVeq2jCt61E58lVgZ5VylB1lCSlpwqMEXca+Yu23bCDjFDsWLjZKC4UNwuAfV1vov0GQAZ0OaRvlnAAra6oT6oZtf//hVOX0IYYTzaOA4VxyMqldG5K4ri23FLz6VDqIgpx29whn/lleYH/Bo1HApnjB5uupAEKu9PlQ5Maj/s4WQNpGP2ZeYiM0b6KT5XI/FWaGbWhXSfgjwJ1YdzSlyFNk9pLVPJ0boVHtVP8nWJexNhpQRe8vaQH9vvikguT7S3hdUjhA== 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=Cw6aE67SLampuU+XgWLo2DCERoiHSCJKSRA8cEWDtuY=; b=cL5yYp6tzaB3hI26/rM2VZ6qPoCcrBBM3fKojmiJfVLtSGtlVeju2lmzACwWQwd+WjMWugVYZtv6SWBf5V0/uGV/jQtBeF1wU+0dS6OO0Q8Qn8X8f4PnfMSxnRDeuy2v9ZtvntcYaaFwneOiZ4JlDLarTFZ5ZOIRuJruxy0z0SqBzxzfTm4MW5wOz7IgnCIQfiWZz6XDcVCC+VeApv0c3kx0pnGCsbMw9wjIWn6XuqYHohIQqStxa5ySwydHmWI0STk3kCPMp4Ltnl4nY4+Yj2DsFWDm71pRmfHTELAvCERBB8josqd1g/q5plPzpfX68BoUZzgsWOSRsnBxV0HWpw== 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 DS0PR11MB7832.namprd11.prod.outlook.com (2603:10b6:8:f5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Wed, 29 May 2024 09:00:36 +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.7611.030; Wed, 29 May 2024 09:00:36 +0000 Message-ID: Date: Wed, 29 May 2024 17:04:28 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/20] iommu: Add iommu_paging_domain_alloc() interface To: Lu Baolu , 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> <20240529053250.91284-6-baolu.lu@linux.intel.com> Content-Language: en-US From: Yi Liu In-Reply-To: <20240529053250.91284-6-baolu.lu@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI1PR02CA0059.apcprd02.prod.outlook.com (2603:1096:4:1f5::19) 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_|DS0PR11MB7832:EE_ X-MS-Office365-Filtering-Correlation-Id: f41e92a0-ddd1-4074-8819-08dc7fbdcdfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|7416005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TjdtL0tUTUFZUEduakhvaFpldmNiWTdhcTErMG43aEg0UEhhTG1ZU2V0V25p?= =?utf-8?B?QlUwbG1YYk0xMGhUSGhoNHovRWplUlZhVXdGaTZ2TFRyQ1VFZkJmMGsyMTky?= =?utf-8?B?TUlHT2xRaDl1WlMreW5Bc25VOXFCN0tjWkpIRVM5NTFtaytlSEZTZTlYeUgv?= =?utf-8?B?cm9OekF1WHg3RmpQNXgzaXBpd28rZ0p0OGVsUFNjYnRqdkpjVGVuM0k3YmJj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d6Q3BoV0Jtay9NVFdR?= =?utf-8?B?TTZOcm1nSzdPaG10NDBNaUJGZHVlSUUwZGdiQzU1dGFuRWVkdDQ4a3dVdmEz?= =?utf-8?B?WGNuOFZrRGFmbS9YSUVtRVBuUGVmd2dwM0lTYVlYRXV0TnJEdnl0dmUzSW9G?= =?utf-8?B?d3ZKU2dnU3lBQzcxaDB0YmxVZUI4blZjMEI0dFc3dEpDbWVLYzBBNDFIZzh4?= =?utf-8?B?UGlLNWcvZVBBTnpWV0VuN2F6SGFlVGY2MkRmZGZwcTEyZWlGeFk5aWlDRkxo?= =?utf-8?B?RzBrT21tKzRrYVBRTzM3NmFzYnVPdjIycFo0ZVFsczlGcE1OV2thbFFpeW9q?= =?utf-8?B?dEhsNytFRU4rd3Z3UWh3cytNK0xLVlJxTFFjZEJZakhWZ0FERWJHdDBDVURt?= =?utf-8?B?YU9EQ2RsOHZCdDNNd0NQUzhtbWlYR3EydTdMZmxWa2crNzZQNzFwRzdjNnpl?= =?utf-8?B?bUxUck9tZXY0WXhhVmdvNzJoMmtHUmMxRHNVb0sybVFzc2JEQVlWMXd1S0xP?= =?utf-8?B?RXFKeEdSdUMxOG9ObTFvNFRPL05sSjgyQmV5cmRMeTZWVXpnaHJ1SjlBdVV0?= =?utf-8?B?bi9ieVRBZ1RyUVY5dVgvZkcwU2VIWWdJZkoxeFIxSythVGtaYXpMK0JnPT0=?= 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)(376005)(366007)(7416005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UVg3M0p0akd1Tnl3SzRJQUhqRm9BMVNuai9sRjR6NUZtVW9oZ1V3Qk1kU3NP?= =?utf-8?B?NVlJd25idkFnQ0pzY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W1LMW9GaEdGTVZDRC9o?= =?utf-8?B?YWRLeEVmeTk2OHg4VWJOVVNNbHpQdXdOL1l1OUY3K3ZiOWtKMXpsdzlBenRa?= =?utf-8?B?aE1JMXg1cU94aFNrcWZGTENrcm1zZzd0bTd2aUNOY2dOWGVLOWoxWE5YTTZt?= =?utf-8?B?Qng2ZkdRa3RMZlYyY0xJUGI1OU1zVlQ5N3FoM2pTRnRwdU5YTEpNUFhJbUhX?= =?utf-8?B?aE5iNmJtZ2FYTmpsYWh1VHd5KzFMbTZhNzdvWnRzU3A0TU5iREdUL0JYTUtI?= =?utf-8?Q?3Le6h49ko5vVt7uDBFvV23kEb?= X-MS-Exchange-CrossTenant-Network-Message-Id: f41e92a0-ddd1-4074-8819-08dc7fbdcdfe X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 09:00:36.2251 (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: EHk+RUewDMYAiTILFKBdl4oOc2MvepzGdL2QKD8FvpH/zq1huFOkeMtiR4AvTXpfDjzG/AB6RSq6ZKUlzGlzHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7832 X-OriginatorOrg: intel.com On 2024/5/29 13:32, Lu Baolu wrote: > Commit <17de3f5fdd35> ("iommu: Retire bus ops") removes iommu ops from > bus. The iommu subsystem no longer relies on bus for operations. So the > bus parameter in iommu_domain_alloc() is no longer relevant. > > Add a new interface named iommu_paging_domain_alloc(), which explicitly > indicates the allocation of a paging domain for DMA managed by a kernel > driver. The new interface takes a device pointer as its parameter, that > better aligns with the current iommu subsystem. you may want to move this patch before patch 03/04. > Signed-off-by: Lu Baolu > --- > include/linux/iommu.h | 6 ++++++ > drivers/iommu/iommu.c | 20 ++++++++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 6648b2415474..16401de7802d 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -781,6 +781,7 @@ extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap); > extern bool iommu_group_has_isolated_msi(struct iommu_group *group); > extern struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus); > struct iommu_domain *iommu_user_domain_alloc(struct device *dev, u32 flags); > +struct iommu_domain *iommu_paging_domain_alloc(struct device *dev); > extern void iommu_domain_free(struct iommu_domain *domain); > extern int iommu_attach_device(struct iommu_domain *domain, > struct device *dev); > @@ -1092,6 +1093,11 @@ static inline struct iommu_domain *iommu_user_domain_alloc(struct device *dev, u > return ERR_PTR(-ENODEV); > } > > +static inline struct iommu_domain *iommu_paging_domain_alloc(struct device *dev) > +{ > + return ERR_PTR(-ENODEV); > +} > + > static inline void iommu_domain_free(struct iommu_domain *domain) > { > } > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index f1416892ef8e..7df4a021b040 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -2016,6 +2016,10 @@ static int __iommu_domain_alloc_dev(struct device *dev, void *data) > return 0; > } > > +/* > + * The iommu ops in bus has been retired. Do not use this interface in > + * new drivers. > + */ > struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus) > { > const struct iommu_ops *ops = NULL; > @@ -2074,6 +2078,22 @@ struct iommu_domain *iommu_user_domain_alloc(struct device *dev, u32 flags) > } > EXPORT_SYMBOL_GPL(iommu_user_domain_alloc); > > +/** > + * iommu_paging_domain_alloc() - Allocate a paging domain > + * @dev: device for which the domain is allocated > + * > + * Allocate a paging domain which will be managed by a kernel driver. Return > + * allocated domain if successful, or a ERR pointer for failure. > + */ > +struct iommu_domain *iommu_paging_domain_alloc(struct device *dev) > +{ > + if (!dev_has_iommu(dev)) > + return ERR_PTR(-ENODEV); > + > + return __iommu_domain_alloc(dev_iommu_ops(dev), dev, IOMMU_DOMAIN_UNMANAGED); > +} > +EXPORT_SYMBOL_GPL(iommu_paging_domain_alloc); > + > void iommu_domain_free(struct iommu_domain *domain) > { > if (domain->type == IOMMU_DOMAIN_SVA) -- Regards, Yi Liu