Message ID | 20230925023813.575016-5-tina.zhang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp983933vqu; Sun, 24 Sep 2023 22:03:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0tb1Wt5T/8BegTqp9AxYkfy+Abc7VvNJBmEyXhy6oGIv/u9Vzs0kAZWnTZQYpqmlJ1xbi X-Received: by 2002:a05:6a21:99a2:b0:154:edaf:f410 with SMTP id ve34-20020a056a2199a200b00154edaff410mr5161108pzb.58.1695618215091; Sun, 24 Sep 2023 22:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695618215; cv=none; d=google.com; s=arc-20160816; b=EnK2x8Qy5HcCymyGJI2uQ+YJKBrrHsf116dQ+ToyKShAC43ECTXeijzu2vCNqoUZgo YagplneXQGbPjnQt+hTZqgrshNppeQmA2NKwwvmRPOB4/YABdr/zPf9SvXcZ9sGQ6YUy 97SWoXJe96f3S5ORxwuGts7HSUYPfMgo8brBu6lBOdIc2x1dUro7NCcuPT2fo21D/lXB rEJrVtfmj/pS6tXkIK3iWrTlJsG+wSTrns5TwYYAtFmezj4svRo7YdkRycbZMCbQy8ms bReLFCAmhJrnZrN1rZwsQdbWuKPS2b/X3KhztpKQSKWKJvsXPfeDNl8WYXYky2R2djtl O9BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b7kbVyX1303n8eY7Br86BfNpThN3/xEdljOTtUVJ6bg=; fh=zW1GPeUL3MQGLvvmLmBmaazP2MzqJ1fOEi8He5Dzy3k=; b=Zownru8Vz0pLac+zcj9Zc/z9b1s/PVW0SlsYnXSfaCgTDTSQPdcdEHrzBFeVaamOMX Lc3zXI2x5xsAXAtOzG8vwgN2dYXh+gq4kGOUPImGnbXBPmrDK13DizlSGScjqTIS6mCx rn6ByYx3IRnxr89aTPB4mTJcc0DZLXbhccz2E66BfLYqnrGkEfRc2BocZsBr0Uuf0NH3 0Pa4t9ZbMtCBEYj2dl0dh6jBByTAuOc1uw91AYzstcQsmo9vSMMoczpnvOiusodbGw3y fvVZJVLl6H3tbTEE3t7zMXbpGTM554pBjrmzors+wkMUmMvtBY/asm4AmjUWHdlK47Jc 7bpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eWEW9zbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x4-20020a17090a6c0400b00274b944508fsi11334132pjj.39.2023.09.24.22.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 22:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eWEW9zbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9F94C80CFD0D; Sun, 24 Sep 2023 19:39:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbjIYCjQ (ORCPT <rfc822;ezelljr.billy@gmail.com> + 30 others); Sun, 24 Sep 2023 22:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbjIYCi7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 24 Sep 2023 22:38:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBCC8CDB for <linux-kernel@vger.kernel.org>; Sun, 24 Sep 2023 19:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695609520; x=1727145520; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rZw7/JQ+5UMBseQ+c8DZ8L7FV4YJqRAF42KGXZ68hoo=; b=eWEW9zbxHPyvRR0GT8kJh8OE0bgFn+nXdztUL3G6NyKDu2iWDOKFezC0 wNfcZTkQlZW9u4rsAn68J1sKCI/EQkIJmr8e6yGYiRyRSzjvxZwDvMa7V 8/33HmdPpMRnMCCIdwxrHX6Ahmk3Psh6AEmeW7TDNX+atAmI6AyosXMXB 3DXK+vH2iR+3G3ip57XmXkjmWruuvQeGXp6LchOCanwvyyL5MLQjsRHZ3 clvDquGzTFlGUnIb72opoYUijMU5m/RNYSrKBU0HgXJPVqN9vVL9i8mye qEE3MjPLWqdtjJ5F5CMGTNIOltYCnodlNlZGCJp1yyOqb+J90JuwBaFdF A==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="360534612" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="360534612" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 19:38:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="777505084" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="777505084" Received: from jingxues-mobl1.ccr.corp.intel.com (HELO tinazhan-desk1.intel.com) ([10.254.214.78]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 19:38:37 -0700 From: Tina Zhang <tina.zhang@intel.com> To: Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>, Lu Baolu <baolu.lu@linux.intel.com> Cc: Michael Shavit <mshavit@google.com>, Vasant Hegde <vasant.hegde@amd.com>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Tina Zhang <tina.zhang@intel.com> Subject: [PATCH v5 4/6] mm: Add structure to keep sva information Date: Mon, 25 Sep 2023 10:38:11 +0800 Message-Id: <20230925023813.575016-5-tina.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925023813.575016-1-tina.zhang@intel.com> References: <20230925023813.575016-1-tina.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 24 Sep 2023 19:39:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777984565670770432 X-GMAIL-MSGID: 1777984565670770432 |
Series |
Share sva domains with all devices bound to a mm
|
|
Commit Message
Zhang, Tina
Sept. 25, 2023, 2:38 a.m. UTC
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 <vasant.hegde@amd.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Tina Zhang <tina.zhang@intel.com> --- include/linux/iommu.h | 5 +++++ include/linux/mm_types.h | 2 ++ 2 files changed, 7 insertions(+)
Comments
On Mon, Sep 25, 2023 at 10:38:11AM +0800, Tina Zhang wrote: > 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 <vasant.hegde@amd.com> > Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> > Signed-off-by: Tina Zhang <tina.zhang@intel.com> > --- > include/linux/iommu.h | 5 +++++ > include/linux/mm_types.h | 2 ++ > 2 files changed, 7 insertions(+) This is fine, but you could probably squash patches 4/5/6 Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Jason
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index db2510da28c1..b9c9f14a95cc 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 36c5b43999e6..9f4efed85f74 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -670,6 +670,7 @@ struct mm_cid { #endif struct kioctx_table; +struct iommu_mm_data; struct mm_struct { struct { /* @@ -883,6 +884,7 @@ struct mm_struct { #ifdef CONFIG_IOMMU_SVA u32 pasid; + struct iommu_mm_data *iommu_mm; #endif #ifdef CONFIG_KSM /*