Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2648033pxb; Sun, 17 Oct 2021 21:34:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxetQhJscj4C4tPQRIXJ5EtNrkaeHK9RjnF75LELzaaesAyo3XayEYMeaecJ8oO6Up8hECY X-Received: by 2002:a17:906:4f8c:: with SMTP id o12mr27184073eju.115.1634531650839; Sun, 17 Oct 2021 21:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634531650; cv=none; d=google.com; s=arc-20160816; b=ZgEJPy/b0B7oKN3YY/MPNWfu9MCuAcDMlc0xf0ya2TvoYL55n+CLzxg9YMpv0rtOtu 6ZMAdd45ZD/hoAjqN5EtuRy2YsDdAJGEOKgqayECg/U+Q6nDLTqwoIPWdw8izbUhC2+4 y7TjLUtj0k0rMrUETOkWGTfejH/9xAtwqHjDKpTQ/xjO+L6fpTjWJzSoifboanc6zdfO 1xiRUIyxX9GtU4TNH1VzD3vZa7/IMj8TQosa1cC7BvGGAX4z3ThROG3whG6YggKnFM+r XVU5qfy3VtM0qmLj9ujtXIFHD8X7qRFUgX3OBH+RaFZvZkeJSQDFvK1+JMzxcLVG0mmq fgvg== 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=LRKhCx62a8FylBa2igF2cBSiVauxjdJGZXJ54N9UUEI=; b=eAXXPKzNTzr3YmgrlEksQbWtblusMf6ZGfA6d+2gGw7Uu628flBXOgldkAaaNqB/Ef /5knmpMzHbuV1P9PKCMOylAWIWQdBl/Y7Nm0iG8s406I9p/ku8zw0iDoshAiumTYTuAF fYRyQa9DObsD3Mx3BTjRz6twNJjQi0kOcY33AtB6dqRZtR7jwf0yGjvapLisW21m4Vdi 5eXNzPY+bjTq79c9KRZWfcl6LXEtaRKH1XTey05KcJI0RMgYDR10pZcxDsFaOdvWN9mA v6ryARPQX4HP1sVF3eKSYF5KpONYPP2dGVofruK/Bs/n8vvWmhpYRVLBxejGU1/aJNYu RRbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=CK3WSFHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si23949498edb.152.2021.10.17.21.33.47; Sun, 17 Oct 2021 21:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=CK3WSFHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230025AbhJREQO (ORCPT + 99 others); Mon, 18 Oct 2021 00:16:14 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]:56183 "EHLO gandalf.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhJREQN (ORCPT ); Mon, 18 Oct 2021 00:16:13 -0400 Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4HXk5j5s6Dz4xd8; Mon, 18 Oct 2021 15:14:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1634530441; bh=LRKhCx62a8FylBa2igF2cBSiVauxjdJGZXJ54N9UUEI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CK3WSFHOUcDld4zE8yNAbqC4FyrTxzjVPfpA0zyCBUJMVp/le3OFTrYzrTlBoVQzh fXlROTKB0lSqJV5mx/U5GpTOASEgdS9niggv8iq/2N2ypTus31h0JEGlksaBT41awn zTaAZeSbIf9ckhrJ7VJNbj//fwPRZPbQN6A5//Zk= Date: Mon, 18 Oct 2021 14:40:54 +1100 From: "david@gibson.dropbear.id.au" To: Jason Gunthorpe Cc: "Tian, Kevin" , "Liu, Yi L" , "alex.williamson@redhat.com" , "hch@lst.de" , "jasowang@redhat.com" , "joro@8bytes.org" , "jean-philippe@linaro.org" , "parav@mellanox.com" , "lkml@metux.net" , "pbonzini@redhat.com" , "lushenming@huawei.com" , "eric.auger@redhat.com" , "corbet@lwn.net" , "Raj, Ashok" , "yi.l.liu@linux.intel.com" , "Tian, Jun J" , "Wu, Hao" , "Jiang, Dave" , "jacob.jun.pan@linux.intel.com" , "kwankhede@nvidia.com" , "robin.murphy@arm.com" , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "linux-kernel@vger.kernel.org" , "baolu.lu@linux.intel.com" , "nicolinc@nvidia.com" Subject: Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE Message-ID: References: <20210922140911.GT327412@nvidia.com> <20211001122505.GL964074@nvidia.com> <20211002122542.GW964074@nvidia.com> <20211011171748.GA92207@nvidia.com> <20211014150610.GS2744544@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NfLXu0kVKdtqKGuK" Content-Disposition: inline In-Reply-To: <20211014150610.GS2744544@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NfLXu0kVKdtqKGuK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 14, 2021 at 12:06:10PM -0300, Jason Gunthorpe wrote: > On Thu, Oct 14, 2021 at 03:33:21PM +1100, david@gibson.dropbear.id.au wro= te: >=20 > > > If the HW can attach multiple non-overlapping IOAS's to the same > > > device then the HW is routing to the correct IOAS by using the address > > > bits. This is not much different from the prior discussion we had > > > where we were thinking of the PASID as an 80 bit address > >=20 > > Ah... that might be a workable approach. And it even helps me get my > > head around multiple attachment which I was struggling with before. > >=20 > > So, the rule would be that you can attach multiple IOASes to a device, > > as long as none of them overlap. The non-overlapping could be because > > each IOAS covers a disjoint address range, or it could be because > > there's some attached information - such as a PASID - to disambiguate. >=20 > Right exactly - it is very parallel to PASID >=20 > And obviously HW support is required to have multiple page table > pointers per RID - which sounds like PPC does (high/low pointer?) Hardware support is require *in the IOMMU*. Nothing (beyond regular 64-bit DMA support) is required in the endpoint devices. That's not true of PASID. > > What remains a question is where the disambiguating information comes > > from in each case: does it come from properties of the IOAS, > > propertues of the device, or from extra parameters supplied at attach > > time. IIUC, the current draft suggests it always comes at attach time > > for the PASID information. Obviously the more consistency we can have > > here the better. >=20 > From a generic view point I'd say all are fair game. It is up to the > IOMMU driver to take the requested set of IOAS's, the "at attachment" > information (like PASID) and decide what to do, or fail. Ok, that's a model that makes sense to me. > > I can also see an additional problem in implementation, once we start > > looking at hot-adding devices to existing address spaces. =20 >=20 > I won't pretend to guess how to implement this :) Just from a modeling > perspective is something that works logically. If the kernel > implementation is too hard then PPC should do one of the other ideas. >=20 > Personally I'd probably try for a nice multi-domain attachment model > like PASID and not try to create/destroy domains. I don't really follow what you mean by that. > As I said in my last email I think it is up to each IOMMU HW driver to > make these decisions, the iommufd framework just provides a > standardized API toward the attaching driver that the IOMMU HW must > fit into. >=20 > Jason >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --NfLXu0kVKdtqKGuK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmFs7MQACgkQbDjKyiDZ s5I36BAAtYQDHfUUrAAR+l1Nr+R/rx7GXp/8R6KR+CE1dfsCsiwzcMldNS97f68g KxmxUoteQOeNn6s92JZ3MjvQS73SBD0n58JnUmdbjK6KmKn1yURJ7c01qI9/u8mG f/F2nmTTtnbGNizIWVOcT3v+rVOpriok8+PVrzYLPZdwINIwGu9BvGTRX5rUH7dz ebxBx708ex+y8Xjgahp6lN6TcpH4kZMe+7EihSh+94g2qqrjF1O4NG1E+nj0KA9a AZohwPPqYfY2wq1ymxzEjbXHbfxoYMJGD0AdMGQoYeA4DYwokqUPcZbYCROl/EN2 hIMMjGkSLshVpla4Gswb0hIzZNyj4y6OwlnUHaCt99H64n35A14TZP+nB792qRyo VdfYNa7bt2gyCVMJvIYjyIkT2GcsI6cUJY4xX6InPSU1cNwGH+hWiLyJ2uWz12zD bOItcIEZFWX240UW8q0SOqfC/Yv18Z+hHtMWmv+Blwjq7E7qDGQTp9EvOga/VqsQ bGlHugTZpZNnx0FsRQWva6RiyU+wvcQi49Uw565KotIqNkxE02PfcMOW4xTeKu39 p4LEMCw9ZdiGNF/vjSbpTBW+m1JvLpILLAi/xyqymcFBZbwxpUn+nMl2RcDJy35C lBD9bu0MRYmWCcIm6B72rMnYR1+/zd/mVRZ2TdEJ3syDKgdGeAo= =y6hM -----END PGP SIGNATURE----- --NfLXu0kVKdtqKGuK--