Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4664837rwb; Tue, 8 Aug 2023 11:44:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFkaMLz1j/QvDWfNA3DOnssCYqvAKDqVwzVLojrpfGFwF/x1gzIWfVDsIdT58BRcOfK8q5 X-Received: by 2002:a54:488c:0:b0:3a7:2524:6d46 with SMTP id r12-20020a54488c000000b003a725246d46mr477522oic.59.1691520288080; Tue, 08 Aug 2023 11:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691520288; cv=none; d=google.com; s=arc-20160816; b=TtxxpKkue8iIZ54ZW4TVXfRx9O7nw9HRTzJqbRh0M/9qacSG0/tSruGEwrzG/hFMTV fzhMNOpolwr88kcuQ3fO8jyDkbsqdM4EH0pbqfGSMEaWXekpkUsQpMYk2KRYo/op+YBP +N5bfwCIvcNxnmnrCIBLmunl54QjQKVWKjblog8jocrJZlpVn5z99ym9gqvKAxgcTBA9 sRNgLa3Ilk8QJZqDv6uc8QMan4JaVObBk2Gcm4XL5LUGGZmHrYgg1kPkVg36K1my6hhR ZZ1FMZww7dbYRgcEYTgeVUbuDUDsPWTC6XbeHhhTlPMgt4E9EKaJ8h7lI2+BAbZL4/q5 Faxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=DZW1mbxT0iFwJnNs0K13zoKD84DxDa15fA2yBWLZhGY=; fh=/lTHmTEAhz5c6hgBRAPnmJsxw5vDTKZT1TYa5ynR+LA=; b=rsQ8SWO6fWV8wCNPFoEX4zoKdGIuoKi2OCUi0f5aqhvfzaR4VqOiYVFDlUQg7gvoeF 3iov4eP4fXaNOhWx5UU8NNMgELyMBWvI8mgylypUn0Qsc4LZMcGmAIr1PiSyQYXW/5Mb 3bxbkt/ySVe92bUStureEmuYa9nVjuuk43S0fl95qXrzytOFlb7tEpLnFDsN8TjXfwyO be/8EqdSy9EB0lNlO0ceAJsgZs+Rni0lxqqBlJ8Jfc4k/TXBiQVTdjmvXzufQl0pPXWu SEywoW7rWZdh24BNyinuMtBUKEK6pKRhLNNNYwo3ZzUMfoOqE8ATcbiLE1xsR3vlZu9w T+Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gJsxNnNl; 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 w3-20020a170902e88300b001b829a32f2dsi7823240plg.457.2023.08.08.11.44.33; Tue, 08 Aug 2023 11:44:48 -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=gJsxNnNl; 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 S233135AbjHHQnq (ORCPT + 99 others); Tue, 8 Aug 2023 12:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233120AbjHHQm5 (ORCPT ); Tue, 8 Aug 2023 12:42:57 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A939516578 for ; Tue, 8 Aug 2023 08:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691510131; x=1723046131; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=lp2BCntolGG4mTS6F0ktq7rcph+RoXn5XygwILHKL8k=; b=gJsxNnNlVpD4h2H/u22UJdqSHBda8ZzXkCSpGsy9EvznFmfjO1BkMRIY qAsKy/OjueO38cNdAfvDDb84Wv+AzICdJ3wbaSDbUuO99YPtr5Ejf28dX hBvF0Rbcz8HjQMidX2wLUXG6iSfXmY/HvSpXYF3GFscfjQx+bGphqK7eY 7zqFmEx2unLz6kN2V31AVL7szy8jPZKapDpW5DIKFGDFcQJB/1uqHogc9 OoJaGJu+UBCOLhVMklmtTUOI3MsK28o5xOZDTECwooB8wc1m2AT6REEEo 83mkfDG/G68Md0qlEzax+h7BEwhfO18tcjJcFO3cZ/ZDG+nXeRsafmucz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="437078680" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="437078680" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 00:50:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="681146338" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="681146338" Received: from kechen-optiplex-9020.bj.intel.com ([10.238.156.126]) by orsmga003.jf.intel.com with ESMTP; 08 Aug 2023 00:50:00 -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 3/5] mm: Add structure to keep sva information Date: Tue, 8 Aug 2023 15:49:42 +0800 Message-Id: <20230808074944.7825-4-tina.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230808074944.7825-1-tina.zhang@intel.com> References: <20230808074944.7825-1-tina.zhang@intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham 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 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 30e4d1ca39b5..435d1c1afd23 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -670,6 +670,11 @@ struct iommu_sva { struct iommu_domain *domain; }; +struct iommu_mm_data { + u32 pasid; + struct list_head sva_domains; +}; + int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, 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 5e74ce4a28cd..3fd65b7537f0 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -595,6 +595,7 @@ struct mm_cid { #endif struct kioctx_table; +struct iommu_mm_data; struct mm_struct { struct { /* @@ -808,6 +809,7 @@ struct mm_struct { #ifdef CONFIG_IOMMU_SVA u32 pasid; + struct iommu_mm_data *iommu_mm; #endif #ifdef CONFIG_KSM /* -- 2.17.1