From nobody Fri Dec 19 12:29:06 2025 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 2D03AC83F15 for ; Sun, 27 Aug 2023 08:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230337AbjH0IpP (ORCPT ); Sun, 27 Aug 2023 04:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230262AbjH0Io2 (ORCPT ); Sun, 27 Aug 2023 04:44:28 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6013BBF for ; Sun, 27 Aug 2023 01:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693125866; x=1724661866; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=70XGMLhmcN9XLJ88A4WPccc77MlMNOgnetntb6B7rBs=; b=dw2PaDw2/7mOq6BR/IHkvYfjcAHrokZmGHFS//EHA888nTbshtwUkv6y uDkDac2dpEWmGorUkJEBFBLYleKjHehdQHVUIdn7+3FmbpUgqQ/CleHrS GvrKV2rmeZBVdOqnhrMA9wWP884LIgsyehRkZJmxOFNrR4+SMynbQWNnf WMpTFstPDnHNtwpJxQJ9iYl7a44My2BrgRSV9nQ0CeVDMdZLiHHw4bIsL gHp9dZhjkPvBbWpJl0jeejG/eFiI6JeroPPOeWbD1Vc4YOwEhaqrSqiTt jAQYP5q5KwRzjSf0QSa62n13NCyKhaI/KWHSjMDWuZKx+CEJ0Bnx7E7t8 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10814"; a="359919921" X-IronPort-AV: E=Sophos;i="6.02,204,1688454000"; d="scan'208";a="359919921" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2023 01:44:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10814"; a="984561811" X-IronPort-AV: E=Sophos;i="6.02,204,1688454000"; d="scan'208";a="984561811" Received: from yzhu-ivm3.ccr.corp.intel.com (HELO tinazhan-desk1.intel.com) ([10.254.213.44]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2023 01:44:23 -0700 From: Tina Zhang To: Jason Gunthorpe , Kevin Tian , Lu Baolu , Michael Shavit Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Tina Zhang Subject: [PATCH v2 3/5] mm: Add structure to keep sva information Date: Sun, 27 Aug 2023 16:43:59 +0800 Message-Id: <20230827084401.819852-4-tina.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230827084401.819852-1-tina.zhang@intel.com> References: <20230827084401.819852-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. 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 ab8784dfdbd98..937f3abc26f2e 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 5e74ce4a28cd6..3fd65b7537f0e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -595,6 +595,7 @@ struct mm_cid { #endif =20 struct kioctx_table; +struct iommu_mm_data; struct mm_struct { struct { /* @@ -808,6 +809,7 @@ struct mm_struct { =20 #ifdef CONFIG_IOMMU_SVA u32 pasid; + struct iommu_mm_data *iommu_mm; #endif #ifdef CONFIG_KSM /* --=20 2.34.1