Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3561301pxt; Tue, 10 Aug 2021 06:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydMnkpCbI9GIZW/f2ZvTLccbMymgdscqGufkSq0sbqOTsJ81I4muHo8IrJESnok6u/NOuq X-Received: by 2002:a17:906:691:: with SMTP id u17mr14010875ejb.149.1628602065939; Tue, 10 Aug 2021 06:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628602065; cv=none; d=google.com; s=arc-20160816; b=QYE8YWuiPEpvgOp9ZI/zWJ0suecJ50S45sDpCStQWDk+NqEGVSReXOsKE7XKUnBeEY m55NzXN5yxbwmItDD95AgL8i6bW2gJzyrZAiObSVPKDheJgg7yhlVL4vDMNz7zM5DVnw S21eMkuJAW0A8llw1GkYq8itjx6RAt1tVY2nN+ombw716TjG12AAaS7cVJbo+Y4tYxMA Sw++0CxePZayI4w24hLl+3bUc+8H1mOg03ij2aE1BuRhOVm5J0fUVbgqOiYDH6Mjuso5 k079Z2s/HBz6qEt3T5v6xrbhatfecjOSrqJDmwzlzzRciEPnFq1o7xySJtdNEwXGvWDw 4yfA== 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=sLzUle4HNjbt2dpuzLJ/SCgyEaG1KNFjSdG9/ykRLYo=; b=gnGLAs8y5M2fxkVyLB4mx6+2AwqGs/SGqrlKCaz9t1/Hb1Xu9L+rZXhpFsbCOpRSGi PX1aDgkj3YmCxThMcZ/P7Rwg642r5mpC6VxuZM9dbK/l/+4fpN4xdAcx8Lb9AEx0xI4S 4lVNN0jTzjwp8kQ2HmKYT3T/Kq1xfQVEO/3JWPLJdIEkQsVmVg4tAkWtihUow+qTFTKr sigPAk3JgfP3uf/aN5zsMRh4rno25oYicW22VschNgqbGkdYICr5NJ8a+pq6VymnBdWE AJUNyWv9OC0YJ4H8zrJFN5I+Pdc+i++i/W5K40W8jOvATSXWpfaN8BzOjDGcRPn0cHQ7 SIrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=bE7CtES0; 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 v8si19412502ejx.192.2021.08.10.06.27.15; Tue, 10 Aug 2021 06:27:45 -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=bE7CtES0; 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 S238509AbhHJKTV (ORCPT + 99 others); Tue, 10 Aug 2021 06:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238874AbhHJKTR (ORCPT ); Tue, 10 Aug 2021 06:19:17 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BFFC0613D3; Tue, 10 Aug 2021 03:18:53 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1007) id 4GkTSS0p5Qz9sRf; Tue, 10 Aug 2021 20:18:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1628590728; bh=sLzUle4HNjbt2dpuzLJ/SCgyEaG1KNFjSdG9/ykRLYo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bE7CtES05Gb33ZZWvfgfzvroh0FvJfb8WbKwzViGUD5LeQNvpQdpBjLHr3/24sjKE idwd62N3gx53z8IIFvjSpMJmdpG2PsCBaDejyPRTtyHSVN+DF6VILSwEauB+I9+dYU MP3gbRCUPVOCSQu2vvetmvzqO+jHEvU6RMZhlms8= Date: Tue, 10 Aug 2021 16:10:12 +1000 From: David Gibson To: Jason Gunthorpe Cc: "Tian, Kevin" , "Alex Williamson (alex.williamson@redhat.com)" , Jean-Philippe Brucker , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Shenming Lu , Joerg Roedel , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Kirti Wankhede , Robin Murphy , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , David Woodhouse , LKML , Lu Baolu Subject: Re: [RFC v2] /dev/iommu uAPI proposal Message-ID: References: <20210806123211.GR1721383@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="odEeZa7MqmWAODkt" Content-Disposition: inline In-Reply-To: <20210806123211.GR1721383@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --odEeZa7MqmWAODkt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 06, 2021 at 09:32:11AM -0300, Jason Gunthorpe wrote: > On Fri, Aug 06, 2021 at 02:45:26PM +1000, David Gibson wrote: >=20 > > Well, that's kind of what I'm doing. PCI currently has the notion of > > "default" address space for a RID, but there's no guarantee that other > > buses (or even future PCI extensions) will. The idea is that > > "endpoint" means exactly the (RID, PASID) or (SID, SSID) or whatever > > future variations are on that. >=20 > This is already happening in this proposal, it is why I insisted that > the driver facing API has to be very explicit. That API specifies > exactly what the device silicon is doing. >=20 > However, that is placed at the IOASID level. There is no reason to > create endpoint objects that are 1:1 with IOASID objects, eg for > PASID. They're not 1:1 though. You can have multiple endpoints in the same IOAS, that's the whole point. > We need to have clear software layers and responsibilities, I think > this is where the VFIO container design has fallen behind. >=20 > The device driver is responsible to delcare what TLPs the device it > controls will issue Right.. and I'm envisaging an endpoint as a abstraction to represent a single TLP. > The system layer is responsible to determine how those TLPs can be > matched to IO page tables, if at all >=20 > The IO page table layer is responsible to map the TLPs to physical > memory. >=20 > Each must stay in its box and we should not create objects that smush > together, say, the device and system layers because it will only make > a mess of the software design. I agree... and endpoints are explicitly an attempt to do that. I don't see how you think they're smushing things together. > Since the system layer doesn't have any concrete objects in our > environment (which is based on devices and IO page tables) it has to > exist as metadata attached to the other two objects. Whereas I'm suggesting clarifying this by *creating* concrete objects to represent the concept we need. --=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 --odEeZa7MqmWAODkt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmESGEQACgkQbDjKyiDZ s5Ktrg/+MU/OVbhaG0pM1dSjmK1fu9a3jQ3S7egfXHqBCHsGei0mCcWonB4WX71t JghxefYDxyliljq9AQuZuOG6LmHAr02cy0bPhHlZwnjXnDvHjZcOkcfBMNLdwtAQ uhUCXkPBq1nH9liPYMPKBsk6skgKuT5kiO4IiQgmptD3qMDUumzdFWU4FlwFtEeJ izG3YYaqr0v1C8I4zCT5kBibk5EFTWwE/ZvHtaYK9yDjOi4b1X79F2EBR/arNcY3 /Vdq0sdCqKstC3g3az+K5Akdti53oNltLWTnqvFbbpZmPvIhOZ37zScMc1bmjrxf 5icEraXNHQW0dEmi29qZLeqr0cmYXhcrfXnneRCprubUMxdfkMVRA5LxqS0vqBOU wSoGH1d/3D5BKm6lTpvZCc/QsAyxgwYgX0gxURGKt/CrWOkC+XXXgCO3x1j+xG3V 04k0yMEk+9K9+YT3oxjsdOGThJW0ZNA5fhmBf4I/NxRCtPwldXdIVOC1DdB0iTW1 0XHE3Wvp9yjMpVt6bt1NOt8lfn74aVkWqjDjpEIdyWtGqaJQVgynAozorT/SBIUI awVwsTosKBG9Paf3L82ZETY8rIPvqJCFu+KgFumeaS5Xyl0z4eUDrnEgNdH9B3mh QEEffkuuuV9L5zxyp+Ir4OWtE4lNkjkcylCpEpklCV2oVLBKVFI= =LOUq -----END PGP SIGNATURE----- --odEeZa7MqmWAODkt--