Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp29334pxj; Wed, 2 Jun 2021 23:30:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx4qAe+UQO7S5D8wUNzmrTlKRYcrDSfuvvUwyNUmwhhxrxjaxPTv/mmgeiO/0KxthTthyl X-Received: by 2002:a17:907:770a:: with SMTP id kw10mr37865146ejc.213.1622701854319; Wed, 02 Jun 2021 23:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622701854; cv=none; d=google.com; s=arc-20160816; b=wM0RYD/gzeqEZcQ5WnbeN4hvZauOtdUZmKIvLrX3txSTsX6ZvSslgzPUqn5LXbRYDC e0gp8w4KN8B3h3FLzIMZYRPLxaQEC4o3yGhBqnpZONGhYH2nZ6HBEFn4c9TUbnuWVmn8 r5eu8EIaNEdyyG/nSmcmTVP2oBairDMuHTsKBi4SZ9Xb7QaXFPBUkocrgsntCMTfgSjE Af58APMlHv9VnrxWHqHZmA6QTB6li9ePrYGosVvV6f5btgwHugNQm3ZiZORdomFhEOho 5TnpocYBXpZk1rApvfRDIs6tN6B5kGhFRXVIKzzXsJNLou44ajqnHSi+ZcBt4UQ48kPv 4z0w== 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=HpSc6xcZGf9KVPyz/lVF1Xly+SCUH3lIROtHUCmAWa0=; b=fXaG8XgsnPoPdb4O85/XrXiq+v3G9wMxUX0/uu8MXr5+EoXUhsIQxU7OqOr/E7QFXq xbHmYhKHe2kbChy/Fp9zTzvq7d32ClC/dyo+CUlTnczX+iEs7qvospH3LLnN/3n3o3IG ZelxlNum1/XHQ5GOic3PfeXcHLCCUQztGLBToef0AuaLCrnX0DFiSzbJC5Qa6E4sFj/B ivKe+kvB9YBWz5znFTEtszQYaIHZS+T4yS3XdLnZRBJTAI2OKKJeQlYNMGvdRv/oGcvU fOodxY05mDx0PmcIIcUPTqpOcIhmRfPCCNemzyBdndfR6U55MJ+ya8P+JFMpZDFEgXyw KAIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=dKNw6CKp; 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 t19si1710621ejb.193.2021.06.02.23.30.08; Wed, 02 Jun 2021 23:30:54 -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=dKNw6CKp; 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 S229911AbhFCGaL (ORCPT + 99 others); Thu, 3 Jun 2021 02:30:11 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:41555 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbhFCGaI (ORCPT ); Thu, 3 Jun 2021 02:30:08 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FwbYy6DNyz9sWF; Thu, 3 Jun 2021 16:28:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1622701702; bh=aDuwQw7JrOoWOZBdQAxjHc0hPzIrNB9PMwrjph0YmcE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dKNw6CKpKiVdxCeJpQ2DPorhkr+EONZiqYqYZqC8QIAFzxeywisBFGPqJ/edk+09f cWjm2rFfdwfk2GX0nalZfUYRHjrrrPJ8ZjLmiotFQdHSc6E6Xd4Q5cvTT046PLbFuI V474o5BtKuIKa7tr6mqAot0YgGYf0J+3y3B+P3bg= Date: Thu, 3 Jun 2021 15:48:23 +1000 From: David Gibson To: "Tian, Kevin" Cc: Jason Gunthorpe , 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: <20210528195839.GO1002214@nvidia.com> <20210602165838.GA1002214@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3SygcrTGvz8uv5oi" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3SygcrTGvz8uv5oi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 03, 2021 at 02:49:56AM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Thursday, June 3, 2021 12:59 AM > >=20 > > On Wed, Jun 02, 2021 at 04:48:35PM +1000, David Gibson wrote: > > > > > /* Bind guest I/O page table */ > > > > > bind_data =3D { > > > > > .ioasid =3D gva_ioasid; > > > > > .addr =3D gva_pgtable1; > > > > > // and format information > > > > > }; > > > > > ioctl(ioasid_fd, IOASID_BIND_PGTABLE, &bind_data); > > > > > > > > Again I do wonder if this should just be part of alloc_ioasid. Is > > > > there any reason to split these things? The only advantage to the > > > > split is the device is known, but the device shouldn't impact > > > > anything.. > > > > > > I'm pretty sure the device(s) could matter, although they probably > > > won't usually. > >=20 > > It is a bit subtle, but the /dev/iommu fd itself is connected to the > > devices first. This prevents wildly incompatible devices from being > > joined together, and allows some "get info" to report the capability > > union of all devices if we want to do that. >=20 > I would expect the capability reported per-device via /dev/iommu.=20 > Incompatible devices can bind to the same fd but cannot attach to > the same IOASID. This allows incompatible devices to share locked > page accounting. Yeah... I'm not convinced that everything relevant here can be reported per-device. I think we may have edge cases where combinations of devices have restrictions that individual devices in the set do not. --=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 --3SygcrTGvz8uv5oi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmC4bScACgkQbDjKyiDZ s5LHWA//XLNAmCjZXhhflQU9dr/nQ8aAcicFwWhaZzX2v+8YuOCWt1u2b9O2Qtnd fYOr3khb983eHexf5jwEIVgf7OzbcbsywHB2m6Y+o8940ybteoDeK9GXINp1B0Tx q7GB4VtU3LhIumTZaiml1glDQPmZOtvntLTCQhAY9ynT8+GctbJTVf47dxi3aRff xpTSrkyO3pwlXSQMpjiSP7uuYI4OZ28A9v5C/fvvKjYAiWV5oKoJvMbY91E9uKwF vRV9vUOnq9XU+p9laziHzHVowiaq4wWmSP+DAqehdp4h/B78oT9xKxvd8/+tIopp NOOjhmqwlYOHB7HZgP3nK2A1gzNlFMzo7nCUBTYpdSB+aZMCfmLKhihoY45wKswk bV7mFju9KjvhIe7nby8KFI4UossQANvvQxtMShXl11h/2Vh8gXCeG7gm6/F0QuGc SPa4PPjWH+lb72aFu7wH8AxzVEezof2gsKyyYhKgxgFaXtI8V4DYhHBk84W3Xy+S op8M3AOGzk+tPGz5FUeIwqkvZYQaQVP5AbhroUilAaI7OaQ/qmxPupi02b4AV3oR yhOOINsW1r+EvGRZzsD5utY1XLTQTeEuXdi2ydhojMsCXrZa2r8Ed2HWDS0Wh+yV Xf7prWcJhkicS2LUH/l1Ras21cl2lCYOkZab+GAQJX/xhitcRm4= =fgPw -----END PGP SIGNATURE----- --3SygcrTGvz8uv5oi--