Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp201699pxj; Thu, 17 Jun 2021 00:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykXb16JqoaxX3QHw/6LUsSFlZZRyGS/9i8/xKYOubKPJnY5naZaC2tOwP2BmC2YUNea0Pz X-Received: by 2002:a05:6402:1510:: with SMTP id f16mr4614157edw.377.1623914644377; Thu, 17 Jun 2021 00:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623914644; cv=none; d=google.com; s=arc-20160816; b=HmtemEvwky5IvSAeAqdUS+aUHlavXzootBBYL9GC9cUdCTQLU/hGHnXqGbX66MvAXI r0nyleSR+ErzCHNZHD686tElCX9My5eWT2l9e4lHW76dSY6qRMzavPP5T4HGog1ZSVyQ mrBeRD17joe6w5q2X0v3c1x380HA1Ct1dUjmi6dh4TXZ17y09BVp2Sft6vV8C314lpcq 3VWpUy9mibEUotHp6mPNsJXU/73u2iwWori01vuE6IyHD1+/K79fEQGfWHAnF2aykBI8 fPheBWfNVi/uehUxvc/KJhgN0a0+WfO42paqg0Ez02b06PlGaLT1r3WQwj+lYd6vGw4N LqAw== 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=Z4wH0IlhDWjMdppm3dUWCFVzOSAzP65BMjVarenviAM=; b=NXu1wr7XixAG1eqhx9aKGJss0XMgoSJIWmbiAUmtUfHgsGmZ/R0BtZW6L0Fjnpc7wK 87VT/eTkkCINthdivHqYLKGKp9d0ti87es70ORKBXGfcAFHW/KnHRg2//2rKfHclFUbj k/Q6OX2mQF8BQPrcJVKMhDr+joS2dOnsg/I/dddRV/SVQxli0EYzDVEQAZ2KMTy5fOUE CGS87FF0NfaFC351pxNJKXRS8iDsNEcH2BVYGoAU0dhqZRZoxtO+rbgt3Jkq7rQlQls1 JrRkIuy0jNKpCWD2DmmUEL4YJvHDYRcfrmPzxV/nWjgkj6LjnxZ0+PuXRmhegBwB8Bzy +ruA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=ENOesf92; 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 j10si5007648ejd.87.2021.06.17.00.23.41; Thu, 17 Jun 2021 00:24:04 -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=ENOesf92; 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 S230403AbhFQHY1 (ORCPT + 99 others); Thu, 17 Jun 2021 03:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbhFQHYS (ORCPT ); Thu, 17 Jun 2021 03:24:18 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20DE7C06175F; Thu, 17 Jun 2021 00:22:11 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1007) id 4G5D5W491pz9sT6; Thu, 17 Jun 2021 17:22:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1623914527; bh=zVWbZ8t57yg6jr2vkel/FfVJmSI+OssX8pb3npfVLG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ENOesf92LKWneTrHhvauCH/Tmz57Jo+jwf8vIfQXhSZv8qrfNtxWwMvrrUa2SVU85 L0HfZQWRvkWHZMCKtSOeTz9BQwNcM4AlPFK8MywJ35dgPX49Y+2nTAo3fTCsNIzYfq TJ1ygljN2+gEkdiRP9N8vES/H6QCe87y/Ri6vUKc= Date: Thu, 17 Jun 2021 12:42:31 +1000 From: David Gibson To: Jason Gunthorpe Cc: "Tian, Kevin" , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Jason Wang , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Jean-Philippe Brucker , Kirti Wankhede , Robin Murphy Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: References: <20210528173538.GA3816344@nvidia.com> <20210602161648.GY1002214@nvidia.com> <20210603115224.GQ1002214@nvidia.com> <20210608190406.GN1002214@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5bobZhJ8ovb9pZNW" Content-Disposition: inline In-Reply-To: <20210608190406.GN1002214@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --5bobZhJ8ovb9pZNW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 08, 2021 at 04:04:06PM -0300, Jason Gunthorpe wrote: > On Tue, Jun 08, 2021 at 10:53:02AM +1000, David Gibson wrote: > > On Thu, Jun 03, 2021 at 08:52:24AM -0300, Jason Gunthorpe wrote: > > > On Thu, Jun 03, 2021 at 03:13:44PM +1000, David Gibson wrote: > > >=20 > > > > > We can still consider it a single "address space" from the IOMMU > > > > > perspective. What has happened is that the address table is not j= ust a > > > > > 64 bit IOVA, but an extended ~80 bit IOVA formed by "PASID, IOVA". > > > >=20 > > > > True. This does complexify how we represent what IOVA ranges are > > > > valid, though. I'll bet you most implementations don't actually > > > > implement a full 64-bit IOVA, which means we effectively have a lar= ge > > > > number of windows from (0..max IOVA) for each valid pasid. This ad= ds > > > > another reason I don't think my concept of IOVA windows is just a > > > > power specific thing. > > >=20 > > > Yes > > >=20 > > > Things rapidly get into weird hardware specific stuff though, the > > > request will be for things like: > > > "ARM PASID&IO page table format from SMMU IP block vXX" > >=20 > > So, I'm happy enough for picking a user-managed pagetable format to > > imply the set of valid IOVA ranges (though a query might be nice). >=20 > I think a query is mandatory, and optionally asking for ranges seems > generally useful as a HW property. >=20 > The danger is things can get really tricky as the app can ask for > ranges some HW needs but other HW can't provide.=20 >=20 > I would encourage a flow where "generic" apps like DPDK can somehow > just ignore this, or at least be very, very simplified "I want around > XX GB of IOVA space" >=20 > dpdk type apps vs qemu apps are really quite different and we should > be carefully that the needs of HW accelerated vIOMMU emulation do not > trump the needs of simple universal control over a DMA map. Agreed. --=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 --5bobZhJ8ovb9pZNW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmDKtpUACgkQbDjKyiDZ s5L55hAAz7xTXdVl6Sc751CmGpD70USGAOw/RdKHKOF7XHOzBuYE9TL3q5fk1JDy xbJA2l9E6UsZDNafSc4V36fAx7MUHmengBK4zqzLK3uhP+xq/4IfJ1vugMt3SJNW Bq78GzvTs3O0j/eVDp/Ha81XK20Dy/RFfcP1E6j7YDSsXjEwkOwavFyna/xMPpGP HJl/cLDR2rXrAIURWO33A3W7am7TZVsLPzXblykE03XVPHDupsZTDr/vd6GXf4W0 8atDbuq09y1mi7fLdNaOMx/LVZTFQtaQwd8+1jprYEc4UJ6n/f++HS7NtNCBsPwZ QH0LJrWjW8RaG6IVOPuQIwJ1SBAZ/gtXC65UdrBMAjQaKjxoO5b/WvUxXpXktMod CD2dYHIzo/RKmg7NBTExYOzw9J31jIoNLXXu1Ao++RmXSSHlCb5aWkS3TQFilnMp hdZm/4Aih4DDrgFdDYBuhanzS6IpRAwysxDj9h2cJWOR/OwYdZAcnZHS03FC6DQ0 fzIbGVFKhVk+Kstnkb8AgoLgdIFSONHdUoH8ISWIZ0bO+XGBGE9PjeqV3v9C+EhD J8xPnFzRlGgK1BleopuME+ukjT4t1yjAfqud6EYVKzN7DcfC9kkwTNtFX2CRjRNV H/hCA3c9kxdjRi6tk/juYHoLEAHevB1IAtTukDrsw6f+vxSQ2yE= =PXAb -----END PGP SIGNATURE----- --5bobZhJ8ovb9pZNW--