Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2359683rwl; Sat, 1 Apr 2023 06:33:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZnXWwgYXYCb/7ZVvrkq6F+aCM7v6corlyVpeS6ZK/vMLmlB0vHA16axNiIJ+R7ND6IbHJo X-Received: by 2002:aa7:d14e:0:b0:500:58cb:3b05 with SMTP id r14-20020aa7d14e000000b0050058cb3b05mr27262189edo.27.1680356033567; Sat, 01 Apr 2023 06:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680356033; cv=none; d=google.com; s=arc-20160816; b=ahQGplOkWOeZLfj31fvL378COcHQh54r42As1fA8b/2Q3Oui2gPdlKozFSImKNG0ZS rURQLgBmcC8sN0rtJVcYz9kXYF6Awd7oqHAR+xU7peO/UwkcQE1t+CjnkVRiji2nYKpu jeJjnkxElLAlIMvzcPgRkclanjOklNMTyJ5dNrVCG/6GZcyCd1d+jfBrCZ9xl4DLB2iN 9zh2foU5BybkbAB2jlc8N96p87O3EO7+x2XAJPr0zgCl2EeWFLx+bt7nb8gb7Mju7lG0 qHAUFoyxDFnhPqOzuKHTL/fQDJDGEXTUFo4gvhDjwfW3jWvcxa8iIzc2p2XPA0vms777 Xjxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=HVpXZHaA/HtOsU3Obym/4lAl96Bj608/+qAbMtqkSpc=; b=Kxc1ATFHdtfcW70sEgwTKdjcXBMKbpvwr+/6nz7dm3o2xEb5lkFPtcwSDaw8qmMEyM rVYpXsJqbc5JbUWJZRcEabQo0xNJALpU8UAuMbGkMLHdv4NOQmB0Tf6gPP0RdxFZNrWy 4wOt/AmVDsj6ZX7f/ogtMj6TH5e+xNYNe8hAR/QLnMMP5eNnjnfF1QBwu8+gSdlvpp5U KT/8lgiUoanBhPaIaQw6ZEVSFeRpBTLjDz9vatwNZEih9ztqmQYRhd6JANy8ID22ZNk8 34VQ21J2c5H1XOBNrHYX0UhXGThl60y/np7Rm3NHoM2ahWWUZzcTO8m573X+Fj5EciSA J41Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0Fo7DlR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t16-20020aa7d4d0000000b004aadaa706ecsi1109407edr.169.2023.04.01.06.32.57; Sat, 01 Apr 2023 06:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0Fo7DlR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbjDAN2M (ORCPT + 99 others); Sat, 1 Apr 2023 09:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDAN2L (ORCPT ); Sat, 1 Apr 2023 09:28:11 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FEC1191CB; Sat, 1 Apr 2023 06:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680355689; x=1711891689; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=sSjm2R/ZERWrLvuTMJ4+1cTW3tasqNODXsINXDA4T4w=; b=g0Fo7DlRTniNHg3FTEurLfmm/UIxskHVCqetswAG/PSNZv2wKPqYOC1E ShXuujwuijqU2oFjYCK2wVUknmhfdK0J51aXerMN2FyZpmWZB6HVKowPL E4vUQ+Z0SC/FzNZXtZGeL00SszVybK4AFo1m9CnB241fhrGw+5WZujcT6 MXwRiC+JDTs0soZhCopvG4tsuXEPjybNZoas0SEF8PhB4THHai1Lqjp4Y F8n8CakVjW+cV3Z0ghx24y1gUYGGATrtvyAezK+V2VS8eaV2sfInGDM2T yzEoJhT/hSJP9ZG4W8fnjrmFSiVlnzAfBlKquzWCqPok7OJQUOcviPtOL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10667"; a="321307543" X-IronPort-AV: E=Sophos;i="5.98,310,1673942400"; d="scan'208";a="321307543" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2023 06:28:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10667"; a="774661731" X-IronPort-AV: E=Sophos;i="5.98,310,1673942400"; d="scan'208";a="774661731" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.211.241]) ([10.254.211.241]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2023 06:28:04 -0700 Message-ID: <81fddd3e-bf6c-966a-b44b-b8a7c9c00591@linux.intel.com> Date: Sat, 1 Apr 2023 21:28:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Cc: baolu.lu@linux.intel.com, Will Deacon , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Tony Luck , "Zanussi, Tom" Subject: Re: [PATCH v3 3/7] iommu/sva: Support allocation of global PASIDs outside SVA Content-Language: en-US To: Jacob Pan , LKML , iommu@lists.linux.dev, Robin Murphy , Jason Gunthorpe , Joerg Roedel , dmaengine@vger.kernel.org, vkoul@kernel.org References: <20230331231137.1947675-1-jacob.jun.pan@linux.intel.com> <20230331231137.1947675-4-jacob.jun.pan@linux.intel.com> From: Baolu Lu In-Reply-To: <20230331231137.1947675-4-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/4/1 7:11, Jacob Pan wrote: > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 54f535ff9868..f70478a11a5f 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -1187,6 +1187,9 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, > struct mm_struct *mm); > void iommu_sva_unbind_device(struct iommu_sva *handle); > u32 iommu_sva_get_pasid(struct iommu_sva *handle); > +ioasid_t iommu_alloc_global_pasid(ioasid_t min, ioasid_t max); > +void iommu_free_global_pasid(ioasid_t pasid); > + > #else > static inline struct iommu_sva * > iommu_sva_bind_device(struct device *dev, struct mm_struct *mm) > @@ -1202,6 +1205,13 @@ static inline u32 iommu_sva_get_pasid(struct iommu_sva *handle) > { > return IOMMU_PASID_INVALID; > } > + > +static inline ioasid_t iommu_alloc_global_pasid(ioasid_t min, ioasid_t max) > +{ > + return IOMMU_PASID_INVALID; > +} > + > +static inline void iommu_free_global_pasid(ioasid_t pasid) {} > static inline void mm_pasid_init(struct mm_struct *mm) {} > static inline void mm_pasid_drop(struct mm_struct *mm) {} > #endif /* CONFIG_IOMMU_SVA */ I don't think the function prototypes of iommu_[alloc|free]_global_pasid() should be impacted by CONFIG_IOMMU_SVA. Or I may overlooked something? Best regards, baolu