Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp611561pxv; Thu, 15 Jul 2021 11:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIjB1u9QePLgNanXqel6CtgD+teldPPLFVrCJLSovD18CrnRr5hxn+CpFhk+0g3VqnO+lj X-Received: by 2002:a5d:8d16:: with SMTP id p22mr4156005ioj.90.1626373762181; Thu, 15 Jul 2021 11:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626373762; cv=none; d=google.com; s=arc-20160816; b=x95dHHssFjekqByaDywHJbWXn9u4ArLV9/9L5Egf9AY2b8/oaymh8KMC06Mi+dTFE0 m/sRAs5CSY99UypfrNekTA44vFNSRPh08DZJPoD3rFZNnlqoVSIkFsIonIAOkizoFHxK uVoWH7h8W7ZmXAZ5XAe07VMiAdno5HAklG6DOcfnyExvuxYyP4QIJ1Fm7qr7g1sNH9G4 rinvqXb56EUV2bFBnIpodH/EHjjSc6Kak3+sze+c/SgrWWPTK1d4sZQ2eht0t2vLJeXZ 17IAMHjGwy7qjHGAzMAX7VCkU7Fl0IThNseMYxlB98SqnaQO2q43fApOMKKq1d8lkE/V meGA== 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; bh=59glciA4vDLbGmzNtpn9eTil4MkDwqAnMH2X/yC7N3E=; b=0znAzr0SB0Eejxb+rh3ihHVVVFXd/LrcpoO/2BG3+Nxxx/ROdBsXEEd5Y4JEJ+aA6D 53mEQRpJjym+ngJ64Gc2uKuCGKxy86AEucJXaVkBQCHW5rBGHoRgscPPFhr4nTDEUt3P 3704pO//9CbfP4TsXhNoJkS4UjyaRSV1Lk9h73kOs+kdGLYMMfD/xyW19CJQgGXQyac4 KDiu2q0wIJYnkTH49g3we8s5NjONTdwC+q8ewv8ULDvRqdpX+cvcPQJce/buWKyuI4Li vk+s8uwQqQJYWWi5igphwQwh62sGC5qiQiYNL39naaMtzOMCqMAC24UPyQ92LULKfeUv zllw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si7936362jas.5.2021.07.15.11.29.10; Thu, 15 Jul 2021 11:29:22 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237171AbhGOSJM (ORCPT + 99 others); Thu, 15 Jul 2021 14:09:12 -0400 Received: from mga04.intel.com ([192.55.52.120]:16898 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbhGOSJL (ORCPT ); Thu, 15 Jul 2021 14:09:11 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10046"; a="208786306" X-IronPort-AV: E=Sophos;i="5.84,243,1620716400"; d="scan'208";a="208786306" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2021 11:06:12 -0700 X-IronPort-AV: E=Sophos;i="5.84,243,1620716400"; d="scan'208";a="460476517" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.36]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2021 11:06:12 -0700 Date: Thu, 15 Jul 2021 11:05:45 -0700 From: "Raj, Ashok" To: Jason Gunthorpe Cc: "Tian, Kevin" , Shenming Lu , "Alex Williamson (alex.williamson@redhat.com)" , Jean-Philippe Brucker , David Gibson , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Joerg Roedel , Eric Auger , Jonathan Corbet , "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 , "wanghaibin.wang@huawei.com" Subject: Re: [RFC v2] /dev/iommu uAPI proposal Message-ID: <20210715180545.GD593686@otc-nc-03> References: <20210715124813.GC543781@nvidia.com> <20210715135757.GC590891@otc-nc-03> <20210715152325.GF543781@nvidia.com> <20210715162141.GA593686@otc-nc-03> <20210715171826.GG543781@nvidia.com> <20210715174836.GB593686@otc-nc-03> <20210715175336.GH543781@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715175336.GH543781@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 02:53:36PM -0300, Jason Gunthorpe wrote: > On Thu, Jul 15, 2021 at 10:48:36AM -0700, Raj, Ashok wrote: > > > > > Do we have any isolation requirements here? its the same process. So if the > > > > page-request it sent to guest and even if you report it for mdev1, after > > > > the PRQ is resolved by guest, the request from mdev2 from the same guest > > > > should simply work? > > > > > > I think we already talked about this and said it should not be done. > > > > I get the should not be done, I'm wondering where should that be > > implemented? > > The iommu layer cannot have ambiguity. Every RID or RID,PASID slot > must have only one device attached to it. Attempting to connect two > devices to the same slot fails on the iommu layer. I guess we are talking about two different things. I was referring to SVM side of things. Maybe you are referring to the mdev. A single guest process should be allowed to work with 2 different accelerators. The PASID for the process is just 1. Limiting that to just one accelerator per process seems wrong. Unless there is something else to prevent this, the best way seems never expose more than 1 mdev from same pdev to the same guest. I think this is a reasonable restriction compared to limiting a process to bind to no more than 1 accelerator. > > So the 2nd mdev will fail during IOASID binding when it tries to bind > to the same PASID that the first mdev is already bound to. > > Jason