Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2782685rdb; Tue, 12 Sep 2023 11:55:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEfxaL/Gm6Db2c6xc9cTHlLtW2zw24Rxdu5dwgAm+PjilmVQywNzCbr5AGf372svD7ATEx2 X-Received: by 2002:a05:6a20:1602:b0:140:694:ac3f with SMTP id l2-20020a056a20160200b001400694ac3fmr295529pzj.59.1694544925741; Tue, 12 Sep 2023 11:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694544925; cv=none; d=google.com; s=arc-20160816; b=FBK/8t/g0YuUhbbTUUGaXDK0ts7gjaA8zY4TLeHutDvetXCxyKb5KPbGMtYTLuweXB Eb3GWgfy+W6ZnsvZtTEs6xut3Y0P1cQKEq3gE4X+YOvo+VuJ3Y0zUDsTUx378RPmu/yz k+Yc+g2SuzmiJ0SeEacPrzl8GP9yHoBiRenP9eS0RJ3YQJpLWSf00iGIfH8CX1ZROez3 rduSH+Y36EVXcwqxGblYtbb72M+1c1fMa3qA3HuZWCsEtJd/iANeqwTCUWdohicMdyBz Yo/yneNl80wXWrsBDVDE6gQtYIBgJmoS3St5LH2l4X9qNhIGK5ZHqybkrs2Jnj7SqN8f l3gw== 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=41gBt8KHX1wv3wQueAkK+8oubH9Zs7QDaq3ue3VSfqk=; fh=zW1GPeUL3MQGLvvmLmBmaazP2MzqJ1fOEi8He5Dzy3k=; b=SY+USq/3hlBiJBnRc3uhX6S9/NtYqa5mCTWiLpAoLE/Lr2ZPMf8AJxACSOzIcLiIAC cw/maw04dJq7HbzSAOhIJ4y0Oqbi+LeHYVcHTXoITOMiQlRsOGJt2tDWUvpebO6MLfNX FxqF13RgQK7OpygoJMsl3ORQhotDaxiRj+I9h3ywWKFURkgMxzYjNeyLCh9Kb/21gsHB EJi+jKBnTvB2AZp40QhpZSZ5jd5tRiB5/q4Y+ybD3NSs9+IVvjOcjXino8YT6n0qaSbP GygFcWUO3kZtodJsIb7wMdCWSSE+0oXU4gbEXrx74UkUAhbtujfv96uV10u4niaTfB9U tvtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bNG97GLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ct5-20020a056a000f8500b0068a68054661si8314460pfb.71.2023.09.12.11.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 11:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bNG97GLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id E3FDB81F1D9D; Tue, 12 Sep 2023 06:00:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235427AbjILNAN (ORCPT + 99 others); Tue, 12 Sep 2023 09:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235357AbjILNAD (ORCPT ); Tue, 12 Sep 2023 09:00:03 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B02810E4 for ; Tue, 12 Sep 2023 05:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694523598; x=1726059598; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CH0kLtQV/Lrtt2u1C1f8cD+t2SUUqoIwKlnXYe5Qiqk=; b=bNG97GLa5Rxvbsh0RMYwtn2PdPq0HPf8cZEvGFnhBcjObM9rjqOcp0ud 1Tg99gMcAcNFfZpHA2Yo4Ey4zojRaKVQmzSAuo0bRJk5zGfgxgnS1GvYM rXpXZ/9F7lT+Vj2V4RUZ5Ycmbr4WaxTfQU953GVwWliXuB5PwO88QJivC UIFDHbsXUcAnuXXWjYTXs1zuElxckpQZsuC+hLU93bv4EnAiPoZepcGJL 5ajnx/xznG4o42x4lESlCLDyi0RZ18GX99ZYkeGnNc++LPLlbQncbG2AP xcPLR9qNDzyTW8Ocpvwdza7/9SFSQeTXTxosJfED7q6+purirndOvJoBb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="378277329" X-IronPort-AV: E=Sophos;i="6.02,139,1688454000"; d="scan'208";a="378277329" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 05:59:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="858799347" X-IronPort-AV: E=Sophos;i="6.02,139,1688454000"; d="scan'208";a="858799347" Received: from tongshi-mobl.ccr.corp.intel.com (HELO tinazhan-desk1.intel.com) ([10.255.28.214]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 05:59:55 -0700 From: Tina Zhang To: Jason Gunthorpe , Kevin Tian , Lu Baolu Cc: Michael Shavit , Vasant Hegde , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Tina Zhang Subject: [PATCH v4 4/6] mm: Add structure to keep sva information Date: Tue, 12 Sep 2023 20:59:34 +0800 Message-Id: <20230912125936.722348-5-tina.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912125936.722348-1-tina.zhang@intel.com> References: <20230912125936.722348-1-tina.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 06:00:27 -0700 (PDT) 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 fry.vger.email 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 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 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 /* -- 2.34.1