Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3733500pxj; Mon, 7 Jun 2021 19:30:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFs5ZJvVFHDy9tzePS0oX2ZhK6IZhwLELGHW72Tt/cDa0nmvafQ1XYarIez2Uk7z60iuSR X-Received: by 2002:a17:906:c833:: with SMTP id dd19mr20392570ejb.255.1623119423891; Mon, 07 Jun 2021 19:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623119423; cv=none; d=google.com; s=arc-20160816; b=dkXu6wpVoWbwVPALyv3YWsCT1pkcDZxY3iNKqC+gBk2D8biSyuRi96+QZk4v5PL+0u dQnmwrd4WHgDoL0cgu8AKzaBBiMEOhIBe2lkW+vn1/oVHE6BsRQsfDCr0+sSbUSclSmy x+fcjNoDnj+7pN5buk39IpOpe2oGJJEcMdHA8AcDglxRwtVr9AIgFlmCoKZ6JrsRLVgW YM2QrXhLxaVrxBvSboUmlX174D7tz6AlMEzN1awtxgpbbIHXewlwJtzDHIt2jBGRoslm Z1O8Y1bbG7PpI36sWAf7o3tg8fNBcNO0Pq3DkqjuaXCiNuaTMuhq+EI4sUfEbOdVwNGM YbDw== 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=c5PUx/4eZ4rZnOD62+Pxwkpn7JfJPzWEO++TOuxlCG8=; b=hcReGyy1thunVbImG1DnvPLFcCKF/qkUi+VAbOb7hy3Hvom8KYRvEXGabs3j8YkVOX 4ULYWAbAsIIYiIe/fKMOthVM7aeCBn70AGNsULdO7gDeIrsOimnUoYMeCWdeYdTF9RVd vYl0YI4B+C0eVDvR/sJ/wnLL4778KU6Luad7/zQGsA2+tWB7KwlOb/dqDpF36WXkTuqG KHZQzbAA6pvavidjxB52tgTzin6iyJdwKJzydlG59WhuQ7AY0LJjXPMSMYiE9YzRyQaC tdT3QbsWQzZQq6noYEziaPufnH/wvqF1aZistt2UpJ4AeI62egpo4E5hJNgJvxNEU2YQ J6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b="Fl9N/rY0"; 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 t14si14343948edq.26.2021.06.07.19.30.01; Mon, 07 Jun 2021 19:30:23 -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="Fl9N/rY0"; 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 S231588AbhFHC1y (ORCPT + 99 others); Mon, 7 Jun 2021 22:27:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbhFHC1s (ORCPT ); Mon, 7 Jun 2021 22:27:48 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B982EC061574; Mon, 7 Jun 2021 19:25:56 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1007) id 4FzYxm6L3yz9sW8; Tue, 8 Jun 2021 12:25:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1623119148; bh=lncYIbxArPowV0MRkDFVxKOswtaRzRtG9W2xdghAx6E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fl9N/rY051u/vXA8Hw32d6pExmLKI3N41TquwdbFFNmvj4ancl24Wkx4HSWiolM+/ pT1F2q/2VhF59OyNxNlXSpAEqFIyRsYMFMf4P3aALG2JOQUSOwl3st8G4JX8vKfRtM 3qtkRUSTv9gMnqY1vA6bx6Z+lDdwhUTBcM8bIE8I= Date: Tue, 8 Jun 2021 10:53:02 +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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g5xwcfR2A+2YrJL6" Content-Disposition: inline In-Reply-To: <20210603115224.GQ1002214@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --g5xwcfR2A+2YrJL6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 just 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 large > > number of windows from (0..max IOVA) for each valid pasid. This adds > > 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" 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). I'm mostly thinking of representing (and/or choosing) valid IOVA ranges as something for the kernel-managed pagetable style (MAP/UNMAP). > Which may have a bunch of (possibly very weird!) format specific data > to describe and/or configure it. >=20 > The uAPI needs to be suitably general here. :( >=20 > > > If we are already going in the direction of having the IOASID specify > > > the page table format and other details, specifying that the page > > > tabnle format is the 80 bit "PASID, IOVA" format is a fairly small > > > step. > >=20 > > Well, rather I think userspace needs to request what page table format > > it wants and the kernel tells it whether it can oblige or not. >=20 > Yes, this is what I ment. >=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 --g5xwcfR2A+2YrJL6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmC+v24ACgkQbDjKyiDZ s5Khrg/+O8Zfek3/FbN5ebI8tszXAHZwV5BjxM1PNWD6PIjlBfD/7OG7REO2l9w9 6idpUCjPhg6/3wuCDpPfqgD5xvhKwyW05VrcVUWhKbmMNXZ47iBRkOpeBY99JoIl IVJeoRMXRwtdHGem7WKJfrg2KZl7uoFDMB5oxswwukVPfVCema7SGEsjnXXCaeQU oUnl8usFPedPUgf04GUlN4mMOQccOiLcg3B6SxytX/yWY+aal0M3XGcWVIT61vOS 2FEcYxwn1qcZOYMcmqyanLxaAo+8fQ7fSeacF6c5mPG1JJWfdn4J3PCn3Ot8Jz3x GPvUm2V79AEu8OyEYLGbGnnEY44TaYho40gaoW67Oq3c5vw/jfxKiTDHQ0sZGcE5 /Zx7zjw3XbSDogbyG2EYmZK0peVNPcu1UhWXRYMnC6C2KFWDZnxrJLO8/qNNpIHd CQXpnEVj8LX5aU4bpg3bTWiidYQ2Ifb+VEyDrJ6NouWwPySDO5Dwv/JySPz8gHbl 4tmiWz1ZdHoTEY1pSrirzPI1S0OY+5n0S5xXFeRayOFdE+3PZ4a5Mn+FEIIh4ynE SYygZh5LM5KuCjLbT1LO7/bUsCWpNBe9yP0C4kTi6rUVvh4nWq7vO9qpxtMeoVyv Cd809jz15Cs2A89v65hLgF4MsgFKLxApFx/yXUkp6b27l6gw8Hc= =2eQJ -----END PGP SIGNATURE----- --g5xwcfR2A+2YrJL6--