From nobody Fri Jan 2 13:40:53 2026 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 31DC2CDB465 for ; Thu, 12 Oct 2023 03:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347048AbjJLDBr (ORCPT ); Wed, 11 Oct 2023 23:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235281AbjJLDBd (ORCPT ); Wed, 11 Oct 2023 23:01:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7DAB7 for ; Wed, 11 Oct 2023 20:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697079692; x=1728615692; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GkJWDBRQ1jsnIIVUcbi2Qvjz1LAX/o3/l8N0hK1jUv8=; b=nMAmFjgIFrHKU8xv4F+Rh97M3pSo1SN7ADVl2vtAkwU/SpMeEqZZcfzd 0V1lSWv3/Ck7voTjETra2J7uZoUMKhSIcjKu5qOzUU/Xy9ym9HKNP3jVL N8Wky6fRvzOZPvi3nVXV4lnRLuN9VUrz1J+UWeStXx/Be2srsnoiNPF47 1gJqgo8ll/PxgUuud5ufhCSuzAB0HZ8rbj6Hv8JswQvJiYYJLqv25YJTZ GMKMFrFwL7O2JOHlqgzWpIrKFlAEDQ1M65xtaV6EaPBgoGS+W1s2qgYbz wilbURvdtqo/RkNld50+vTst52skfW3w8sBrVslzkMK0EXu2S7q8J4hm/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="6371502" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="6371502" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 20:01:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="730736523" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="730736523" Received: from sqa-gate.sh.intel.com (HELO spr-2s5.tsp.org) ([10.239.48.212]) by orsmga006.jf.intel.com with ESMTP; 11 Oct 2023 20:01:28 -0700 From: Tina Zhang To: Jason Gunthorpe , Kevin Tian , Lu Baolu Cc: Michael Shavit , Vasant Hegde , "Nicolin Chen ^C-cc=iommu @ lists . linux . dev" , linux-kernel@vger.kernel.org, Tina Zhang , Jason Gunthorpe Subject: [PATCH v7 3/5] mm: Add structure to keep sva information Date: Thu, 12 Oct 2023 11:01:10 +0800 Message-Id: <20231012030112.82270-4-tina.zhang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231012030112.82270-1-tina.zhang@intel.com> References: <20231012030112.82270-1-tina.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Introduce iommu_mm_data structure to keep sva information (pasid and the related sva domains). Add iommu_mm pointer, pointing to an instance of iommu_mm_data structure, to mm. Reviewed-by: Vasant Hegde Reviewed-by: Lu Baolu Reviewed-by: Jason Gunthorpe Signed-off-by: Tina Zhang --- include/linux/iommu.h | 5 +++++ include/linux/mm_types.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a4eab6697fe1..dc1f98e12f4b 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -670,6 +670,11 @@ struct iommu_sva { struct iommu_domain *domain; }; =20 +struct iommu_mm_data { + u32 pasid; + struct list_head sva_domains; +}; + int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwno= de, const struct iommu_ops *ops); void iommu_fwspec_free(struct device *dev); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 36c5b43999e6..9f4efed85f74 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -670,6 +670,7 @@ struct mm_cid { #endif =20 struct kioctx_table; +struct iommu_mm_data; struct mm_struct { struct { /* @@ -883,6 +884,7 @@ struct mm_struct { =20 #ifdef CONFIG_IOMMU_SVA u32 pasid; + struct iommu_mm_data *iommu_mm; #endif #ifdef CONFIG_KSM /* --=20 2.39.3