Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp272248pxj; Wed, 23 Jun 2021 21:56:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTVVSjjiOLpOw2c5QkWLcPsGjTeaOMxzzFXt0k5rH5lEuRGA13AfbmjHuCzH+riSGzdgj+ X-Received: by 2002:a05:6e02:1c2c:: with SMTP id m12mr2297164ilh.94.1624510601253; Wed, 23 Jun 2021 21:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624510601; cv=none; d=google.com; s=arc-20160816; b=NDuB5HWfBG87DoeaU+hhQG1pHg/6amSujeuBRHPM+9kVuPqEe+Mc1dNFk+EvigJ1IV dws5sA/463dd0w0MAroZqWzyY/u7FW4vCWCpCz+EJYNNQ3lY3vUoyXTq6hn5x0GcrDS7 pCQ4zqE82e9eey07TEAn5y03kKtko6p4AwVdhQt/sIFw2MqaIp6f2PVXG3j6IM3RgtCa Lsg37/4z8uyba0I4D57XFF3aUL2bWpWIT6fdakAujhXvpXsiO0KKO7KB5VGYjN+ySWnX mnRkr6PT1TJMjLmAszE030jpeiqmdwNwjBcKlatEXbMa3Br9iC0Z8bJMEGw5S6vXJZbt 94oQ== 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=MP7fWv/wuKPGtgb53a0uK0F0t/beP5MgMIj1shqXRmA=; b=zh4qVRn23hTaBaNU6qCRIkxxjdaxrLYPsiUOBsY7eqqhCSwT0iq1D2ycLZVUZCzTGc jWfNfqlnaqWwekMRaavW2n1BsP3D3COySChDbG1MS/XljRTPJXy2AOm6Q490Jb51pQ1O beO2589Ip+oWAnD2KYh5TL1KPqp5rYrZ0TiKOvDMkNJrRvDCmFEy1Fsoctra44J/X6Ap CPnNpMZNs8VW+q9m9+vSvHzvDpkOjgsQdMJFkUalSAs1tc2+jp89dSQaICmalPniNtrR dBI7aU4zU1UDF5jfl5guwsj2WpIsOF104d4TEKNSWREX8XUWFNyKdO6faWWDKkrPbUHU g7LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gibson.dropbear.id.au header.s=201602 header.b=XrQJxQdJ; 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 a8si1985439ilt.107.2021.06.23.21.56.29; Wed, 23 Jun 2021 21:56:41 -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=XrQJxQdJ; 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 S231215AbhFXEz4 (ORCPT + 99 others); Thu, 24 Jun 2021 00:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbhFXEyt (ORCPT ); Thu, 24 Jun 2021 00:54:49 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A303C061574; Wed, 23 Jun 2021 21:52:31 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1007) id 4G9SRT4N9jz9t0G; Thu, 24 Jun 2021 14:52:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1624510341; bh=IQ9z+FM1iAU3YGel/DdKjNbW4g2/iGQc7u1SOhwdQ0s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XrQJxQdJWPhjxVgCbCvSQiloi3rkVpfm2OknyTuLr5aJEyPSYbjaSQbwKTATK4Dh1 a8jj2iFI0crcsm/IlvkPOx3yxN07wQw4ubXDYMVa3Ozx7AM41RbF2ER1ENOkGosarx VynjZgaWVK3oVxha+EdKVz8Phcc0ery4TQpvqyqE= Date: Thu, 24 Jun 2021 14:26:11 +1000 From: David Gibson To: "Tian, Kevin" Cc: Jason Gunthorpe , Alex Williamson , Joerg Roedel , Jean-Philippe Brucker , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Shenming Lu , 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: Plan for /dev/ioasid RFC v2 Message-ID: References: <20210614140711.GI1002214@nvidia.com> <20210614102814.43ada8df.alex.williamson@redhat.com> <20210615101215.4ba67c86.alex.williamson@redhat.com> <20210616133937.59050e1a.alex.williamson@redhat.com> <20210617151452.08beadae.alex.williamson@redhat.com> <20210618001956.GA1987166@nvidia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BSFjbAhaUqNWeFX5" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --BSFjbAhaUqNWeFX5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 18, 2021 at 04:57:40PM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Friday, June 18, 2021 8:20 AM > >=20 > > On Thu, Jun 17, 2021 at 03:14:52PM -0600, Alex Williamson wrote: > >=20 > > > I've referred to this as a limitation of type1, that we can't put > > > devices within the same group into different address spaces, such as > > > behind separate vRoot-Ports in a vIOMMU config, but really, who cares? > > > As isolation support improves we see fewer multi-device groups, this > > > scenario becomes the exception. Buy better hardware to use the devic= es > > > independently. > >=20 > > This is basically my thinking too, but my conclusion is that we should > > not continue to make groups central to the API. > >=20 > > As I've explained to David this is actually causing functional > > problems and mess - and I don't see a clean way to keep groups central > > but still have the device in control of what is happening. We need > > this device <-> iommu connection to be direct to robustly model all > > the things that are in the RFC. > >=20 > > To keep groups central someone needs to sketch out how to solve > > today's mdev SW page table and mdev PASID issues in a clean > > way. Device centric is my suggestion on how to make it clean, but I > > haven't heard an alternative?? > >=20 > > So, I view the purpose of this discussion to scope out what a > > device-centric world looks like and then if we can securely fit in the > > legacy non-isolated world on top of that clean future oriented > > API. Then decide if it is work worth doing or not. > >=20 > > To my mind it looks like it is not so bad, granted not every detail is > > clear, and no code has be sketched, but I don't see a big scary > > blocker emerging. An extra ioctl or two, some special logic that > > activates for >1 device groups that looks a lot like VFIO's current > > logic.. > >=20 > > At some level I would be perfectly fine if we made the group FD part > > of the API for >1 device groups - except that complexifies every user > > space implementation to deal with that. It doesn't feel like a good > > trade off. > >=20 >=20 > Would it be an acceptable tradeoff by leaving >1 device groups=20 > supported only via legacy VFIO (which is anyway kept for backward=20 > compatibility), if we think such scenario is being deprecated over=20 > time (thus little value to add new features on it)? Then all new=20 > sub-systems including vdpa and new vfio only support singleton=20 > device group via /dev/iommu... The case that worries me here is if you *thought* you had 1 device groups, but then discover a hardware bug which means two things aren't as isolated as you thought they were. What do you do then? --=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 --BSFjbAhaUqNWeFX5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAmDUCWMACgkQbDjKyiDZ s5JgnBAAijxDul/b69WVeLvr273k1oikuFzryDz0SoUd6u2u3P7j6lAs+Dcv8JhT 1axAxKuR0AVeuXynUT+3495hpYmgk0oxgnVqv6aJN8mnClivsB8Np6X01ECSNvWE sZCjNghU0iexB3mykPf3yNTT0GCOnLmSooAIuBd+EihcYCdMYWkCJlMzJFs5Q10f BdHdbSft/nr+anGf7JNI5d+S5iZ/IadIU9/0Csz2jz52SmdYTTfp2aEPB8PTPcf+ +bF6xw1afgI+YvUn87Ortey5Vh1yvXWMoVNHD1YsY+/gtXeacONIYAewina44dim nSzeeLRZH9lumHDaOl5Aa59cePtQ+1N5hSfSTTK9MNzutkVn7vmHivE9XugJ3lUO NdrDbEhs5shVc/g4Te7yCagVc6F61z4onbsSCsJAw9s1IJcgqh9lytXPo91BoKM3 5RM/TV4Jp8Xege18mnEcv6rVcTp9FrBswbWR6cZG3gakVdF2KAvMFyqYHqzGRz9f GaBPSkCddBxbghmHnDhCbU9nWZgoR2ieCCFEeqxj42vZj5sW9Jm5gVpzEQv1Wqem vb4FjnRyiK14bx9P/mcZFwyWYcu8pZ/KZst6aKLB2mS62GzvnTJO8gnWzvHyer7s Uw0G0wSCHLFFm4ubP01I7xv+Fa0h7R4hSrmUitr5aFYfMMF7bUY= =v6Yg -----END PGP SIGNATURE----- --BSFjbAhaUqNWeFX5--