From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74ECFC636C8 for ; Thu, 15 Jul 2021 18:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 497BE613CA for ; Thu, 15 Jul 2021 18:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237244AbhGOSJM (ORCPT ); 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