Received: by 2002:ac8:5491:0:b0:40f:fb00:664b with SMTP id h17csp611290qtq; Thu, 10 Aug 2023 10:27:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZf0E+Fk83YUp0oRHLyDpOHM1JgaIZY6M9jsLTyPeXC5A3sqEruHdxqIB3lmMIDhcdoyVX X-Received: by 2002:a05:6402:693:b0:523:bfec:4902 with SMTP id f19-20020a056402069300b00523bfec4902mr480162edy.0.1691688473354; Thu, 10 Aug 2023 10:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691688473; cv=none; d=google.com; s=arc-20160816; b=jybXJoX44HGBWWeuWjgYsgnTwwc//yr14/y7eBTRI8XxsqC66X5WNLadx0ynKmMZFh nZonwJ2BeqcPOBi07R/MvNT3n/FNalb9Q6AaoNY1i21Dc6rqSzTLCr0jKHywidA7Tsyr lV2XPHN2MMPFsns2EU5h4r6ZVPPbzII06/FO5+t9VMG9guBYJxdrvwhaxRN1lIJA+fNv uF11O9PivOAJ0WbL8DW/Mqz7ctbs9FeLSmK0HuJIqBdB6VEpV2DRYBZG3fTzbAFlp7t5 SDeKq1rsBOuFF3hge57lwdwlC4t+4O+Er2zQ6ZsYERb8CnxI2TJHzvjcIhMGN5OkQgsm rO6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OAmLYynJNs/JRcQ7yD4Mxp1X2smKrNsOj/BixVS0HCg=; fh=0Jh+9DZqN486JafHeiLZubsLsIbZMVHDlSbp6+SPBGs=; b=arOJdx0mPMM93v94m9o85SlMMJ2ifrmR736oQ2vVFUWWGrq5nIbCqaNNRhwzFALBQ7 dvyZuzqunC5s3pODyTa8ZtPH+0fC1y+ayNsKXMNls2a+0wjaA23P2+JaMXFwot1ASXsK /dRnJiXhdWmW9QydQPWbvsS0FRDR3wbi1xhB/P9FINk9IqLgEi0BMnsvXb4MuwxJaAus zwXElLUAaBw8cBZh+NBvxVIMOMmuQuDr0lpV49DhIwkJ8LFwXH4cMCizGIPOxWlwhK+H MmtRugHXpXaE+Yheyy/re267MPMm+yWNwUqqDghXpxbZz3iopMqsvXeNF+Cdt+Z5dkgA OgMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EwzA123z; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay25-20020a056402203900b0051ff0e743c7si1801191edb.397.2023.08.10.10.27.28; Thu, 10 Aug 2023 10:27:53 -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=@ziepe.ca header.s=google header.b=EwzA123z; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbjHJQgy (ORCPT + 99 others); Thu, 10 Aug 2023 12:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234199AbjHJQgj (ORCPT ); Thu, 10 Aug 2023 12:36:39 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1D4E0 for ; Thu, 10 Aug 2023 09:36:38 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-56530cfee38so759623a12.2 for ; Thu, 10 Aug 2023 09:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1691685398; x=1692290198; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OAmLYynJNs/JRcQ7yD4Mxp1X2smKrNsOj/BixVS0HCg=; b=EwzA123zqRuBCUp3mBzJZO/MCbDuhKtsKqOmqiiUSIPF7GW4sIzA1kmam5Sv9EbhcS sujDPRcIz2RJpmGrkkH41TanVkT4nF3kNCZC5LEj7uB+aqXFFzMX3lS3dXxmR5NtirD5 i7/iErfrBWWOuvMuPIvvjBEe6UsaQgkB483TPaJBcCWdehU6xkcI96tyODjzX2kZHt3Y RBgqE4idU6N1zrS1q/QCqELnR4jSLrrUCXBsPiixpRfgS7zDR7LGo1bKpnfUN/pwS8ve XFHtPPLxsjGxol0TuAREGFDa2+V5moEylhvLtnBs055TnHHCED8pKxZBwg3NOw4sqYzb Q9pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685398; x=1692290198; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OAmLYynJNs/JRcQ7yD4Mxp1X2smKrNsOj/BixVS0HCg=; b=APpoRf2iqlha8ij0TMTFeFns6QkH05PjiAAXIv9BnMEd+NPXqrt38IxJmtBIVY1bL+ ezXyduDRPisxi+UNfYKuN4ASy+ttBgxmoRpsRoABTaSw3RzycuDLEzcy4ncTMcnTJ2dI GXtin1yv15ygYJXYpiRH8HRMTpszGCM2fHuTbaq10sCEbmYdeqKy1pKjxO+7KjEBkkGe EKW6GTkm+mlkIgkRRe5mTXzQXs+e3BIcIIoT4eOrXZ7PuTj9qPTkOd7BurTP0ousRj/D i8EcPiv4R63js88gnPcV1js0M6AgKLMJcOzsy6DzBRhdB5T6y4/z9Qk5L7KLY5bY+PBu zExA== X-Gm-Message-State: AOJu0YxOtqBlW7G5Il1uwMNNm8gRsNUi4Ace71x68cWS1BdDH1CDuliO /AJvBLgkGbrR0akvaEp2Z9w2ouXDejfbaFR5s1w= X-Received: by 2002:a17:90a:a50a:b0:268:5fd8:d8ff with SMTP id a10-20020a17090aa50a00b002685fd8d8ffmr2324584pjq.0.1691685398017; Thu, 10 Aug 2023 09:36:38 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id 9-20020a17090a190900b00268032f6a64sm3828826pjg.25.2023.08.10.09.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:36:37 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qU8eI-005H23-NJ; Thu, 10 Aug 2023 13:36:34 -0300 Date: Thu, 10 Aug 2023 13:36:34 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Baolu Lu , "Zhang, Tina" , Michael Shavit , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/5] iommu: Call helper function to get assigned pasid value Message-ID: References: <20230808074944.7825-1-tina.zhang@intel.com> <20230808074944.7825-3-tina.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 On Thu, Aug 10, 2023 at 07:52:52AM +0000, Tian, Kevin wrote: > > The driver should rely on there being exactly one iommu_domain for SVA > > per mm so it can hang the mm_notifier off the iommu_domain > > I'm confused. Isn't this series trying to allow multiple domains per mm? It is doing both. The main objective is to allow de-duplicating the SVA domains in the core code. The driver should be able to assume one SVA domain per instance, or even one SVA domain per compatible instance. The driver should not do any de-duplication. But we can't just store a single iommu_domain in the mm_struct - we have the same problem as iommufd and we need to create more domains if the domains we already have are incompatible with the device. Arguably this should not happen, and in any sane configuration we should have only 1 type of IOMMU driver that needs only 1 SVA domain. But right now things like SMMUv3 have problems crossing domains across instances, so we could have one SVA domain per IOMMU instance until that is fixed. Jason