Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3165838pxj; Mon, 31 May 2021 22:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7aFnYTAvz92tzm22y6i5iWBwDSsj1RhS35iVSuIv0aSzUcvLWPHVeuU1HhUPM+Jcr+UIP X-Received: by 2002:aa7:c84a:: with SMTP id g10mr29382124edt.326.1622525166963; Mon, 31 May 2021 22:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622525166; cv=none; d=google.com; s=arc-20160816; b=KQPp9kZybPM92ZkT80vkanoFmJoLJCcg16KHhC6lu4rm/y9M1CiF4cP6SGrWhYNFlK Ckb2M7081fqx/oHHnTTOn7ORdnJGNTjdLndwI4y800w/ltKav1PFsMmbDvkfp3iBmV3V UCoWKfMRQ9vRtnIuAP4upyP+ZmGSJGA+zmgxAAfxtQiUgK69z7z4nf8eIpdrUPmYg1qr LHJ+7HnnpTorPBl8Kw1vHd1xg6UprmFgv9Vl1DspcUObEV2aQXY5j8lvN3n/QKT4zpni ENlpNH6ewRKUrkPWl5oUvVIrKbhp54MVvSujQb7+IvbwBM893GMQvAEbH3XSjL0WuIPu pQbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:cc:ironport-sdr:ironport-sdr; bh=5vXgFgn7uh5oFRgQfhI/Mb3RquwI6ntzWu8mO6eCdSg=; b=v/veAnRF8QuchNRFr0YEMlZ7mmm1x1zqBuQ/P3lw+qCrvwXH5LLhx9R6I/OWOpiquR /nVjSz1K/7DEkOnrhVJZ3i1gZeOyBeMsbnaR7aCulNKGunKiYyLxosF5sBNClp09kuVO XORW5nwSmpaEvr1Z/95vjliEVBzuj40fiYAbrx/+g8X4xq9iujyOaFYVeRu7RiA5RvmJ KhuFulSzzQwZhhk5a6/UBQqDdGsGc1i6Q1b3At1XcCeE9JK+U/wGwzo3rrnO6b/D8Var KVLafzQ+Qw17IdZEgPlObaH4GElLZXjt0I1CniTFO7i/jZjFHdLTBjcglhAdDBphRY3G 5ZoA== 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 i8si14503487ejx.200.2021.05.31.22.25.44; Mon, 31 May 2021 22:26:06 -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 S231607AbhFAF0E (ORCPT + 99 others); Tue, 1 Jun 2021 01:26:04 -0400 Received: from mga03.intel.com ([134.134.136.65]:46455 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbhFAF0C (ORCPT ); Tue, 1 Jun 2021 01:26:02 -0400 IronPort-SDR: YbTWwSOBbZVsDosE0wgD8Tz2wwMRLVGJvLcHijLsoJWpmPIlcRr4adhSgbZufiV2pMokqHfKC3 YLmIKflH0gHg== X-IronPort-AV: E=McAfee;i="6200,9189,10001"; a="203508638" X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="203508638" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2021 22:24:21 -0700 IronPort-SDR: 9/26xGdp6Lz9x66jJdkf3SzA1PYii11BJIvKVB0+a/56W0qSgeYjSmdylmkMihaKUpOfvXuquH x+Vy+yi2JzkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="632749269" Received: from allen-box.sh.intel.com (HELO [10.239.159.105]) ([10.239.159.105]) by fmsmga006.fm.intel.com with ESMTP; 31 May 2021 22:24:16 -0700 Cc: baolu.lu@linux.intel.com, yi.l.liu@intel.com, "Tian, Kevin" , LKML , Joerg Roedel , Jason Gunthorpe , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)\"\"" , Eric Auger , Jonathan Corbet Subject: Re: [RFC] /dev/ioasid uAPI proposal To: Jason Wang , Liu Yi L References: <20210531164118.265789ee@yiliu-dev> <78ee2638-1a03-fcc8-50a5-81040f677e69@redhat.com> <20210601113152.6d09e47b@yiliu-dev> <164ee532-17b0-e180-81d3-12d49b82ac9f@redhat.com> From: Lu Baolu Message-ID: <64898584-a482-e6ac-fd71-23549368c508@linux.intel.com> Date: Tue, 1 Jun 2021 13:23:07 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <164ee532-17b0-e180-81d3-12d49b82ac9f@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason W, On 6/1/21 1:08 PM, Jason Wang wrote: >>> 2) If yes, what's the reason for not simply use the fd opened from >>> /dev/ioas. (This is the question that is not answered) and what happens >>> if we call GET_INFO for the ioasid_fd? >>> 3) If not, how GET_INFO work? >> oh, missed this question in prior reply. Personally, no special reason >> yet. But using ID may give us opportunity to customize the management >> of the handle. For one, better lookup efficiency by using xarray to >> store the allocated IDs. For two, could categorize the allocated IDs >> (parent or nested). GET_INFO just works with an input FD and an ID. > > > I'm not sure I get this, for nesting cases you can still make the child > an fd. > > And a question still, under what case we need to create multiple ioasids > on a single ioasid fd? One possible situation where multiple IOASIDs per FD could be used is that devices with different underlying IOMMU capabilities are sharing a single FD. In this case, only devices with consistent underlying IOMMU capabilities could be put in an IOASID and multiple IOASIDs per FD could be applied. Though, I still not sure about "multiple IOASID per-FD" vs "multiple IOASID FDs" for such case. Best regards, baolu