From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B54DC433F5 for ; Wed, 18 May 2022 18:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241374AbiERSRw (ORCPT ); Wed, 18 May 2022 14:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241336AbiERSRi (ORCPT ); Wed, 18 May 2022 14:17:38 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9645E185402; Wed, 18 May 2022 11:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652897857; x=1684433857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VA8nFl9fC9gNGwuMhCr88Na7OguiZVel87k14M/WRzo=; b=oHoaDoqR76XSX5UC6/D7a9Tezl75RFKKlf242DUf/RXX4oR3IFVcvaSu gCM38X71MzoyglqbYssHQhjL6UhHGqSIxK+NDDGXeBpes+CrpnB38ifQ0 h6RGiE4u1ccNOzbJyd7HD97kpZpy4OQoLuQduZCRqL6yJ+n+hA/5syTTl clAWEECGVlkGXipSKiy559NTaccCtPluB5MPuv3JtjfFbOBaeoO4ZlzBx wZ/PMtPb8nXijhvOlrXOGOnhfELFwr4luvqiHdtLfvCZ3bpBmfo/IqoFu Wo3TOk3V8eki8ywkBL3beSdLuGn0DFtP+br3EtebhR4UCG2Q79riBrGGd Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10351"; a="270648738" X-IronPort-AV: E=Sophos;i="5.91,235,1647327600"; d="scan'208";a="270648738" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 11:17:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,235,1647327600"; d="scan'208";a="639405494" Received: from otc-wp-03.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.79]) by fmsmga004.fm.intel.com with ESMTP; 18 May 2022 11:17:31 -0700 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , dmaengine@vger.kernel.org, Joerg Roedel , David Woodhouse , Jean-Philippe Brucker , "Lu Baolu" , Jason Gunthorpe , "Christoph Hellwig" , vkoul@kernel.org, robin.murphy@arm.com, will@kernel.org Cc: Yi Liu , Dave Jiang , "Tian, Kevin" , Raj Ashok , Eric Auger , Jacob Pan Subject: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API Date: Wed, 18 May 2022 11:21:15 -0700 Message-Id: <20220518182120.1136715-2-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518182120.1136715-1-jacob.jun.pan@linux.intel.com> References: <20220518182120.1136715-1-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DMA requests tagged with PASID can target individual IOMMU domains. Introduce a domain-wide PASID for DMA API, it will be used on the same mapping as legacy DMA without PASID. Let it be IOVA or PA in case of identity domain. Signed-off-by: Jacob Pan --- include/linux/iommu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9405034e3013..36ad007084cc 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -106,6 +106,8 @@ struct iommu_domain { enum iommu_page_response_code (*iopf_handler)(struct iommu_fault *fault, void *data); void *fault_data; + ioasid_t dma_pasid; /* Used for DMA requests with PASID */ + atomic_t dma_pasid_users; }; static inline bool iommu_is_dma_domain(struct iommu_domain *domain) -- 2.25.1