Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3169289pxj; Mon, 31 May 2021 22:32:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhbKe5Lt4LqJ5TFOI8yL/UXiNQotHgVJn9bmBhNnkBC5Nfntj77ppknX6FgrJXqiwy3+OH X-Received: by 2002:a17:906:6d17:: with SMTP id m23mr27608429ejr.73.1622525543663; Mon, 31 May 2021 22:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622525543; cv=none; d=google.com; s=arc-20160816; b=uNy1yHWI6xoFvBYl0vv9kDMGhjFOBifZoVppQz8ab8690qrDMHELPhGW3WN4X4iOsD QghOVqhQXvmDcny9LYhosA7czj2CXK4F5nu63lQg7/xHqhkr9O3NvyKN1ErHrhW4v0kP GNMhrQ62uYAws9fYcTnQyC0zG1lsonh6+peg/0Lne0jMC/KJuUXBvUYd3diZxtvC7NgF K9bohsmHYCQCeVNuaglByGskQYaYQlUbsGYda7c9FXLUbJeLsZF9FH1L7ilvZH/tlGwY pitUtLYRKUS5N2X+tg22wLAHaDZYjg1lNW681Txk1Che4Yj+O/d/XLVn876d5fulaIIw kwAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=siJz2CTmBAQXJpnvED6F5Lh0Z4do04zZE0SUG5Fvo2s=; b=VL7sf1n0y7o2CmrNI7rtcyXZd0YAHNaBgRkY9Z9krEVSKwmtlG85NipAjeff3rpxML MClIUQYbVUwTj0gu7CsfBxNy7hiuC+bVd5jpip8MCnUvWDTDInZfh5fVD9RumveCcAKI QG1iA8Dh8jIhpdikEPKl0P04QgMHc52wNnIZlmzwQvQ5qR0lw3vgQsbV3uvq/C76ZEKN 0+HhwdZlIoPjIY9BnKBNDPdFvuKQZ4OVGdEJD2BG+RCPNlZ9SFsjXBJgfWlTbGqBf/dm /QuxQoHbCOAMlHVMLkorDyK4V7q0i44k+DXek/RQh1Png6jE+ifNi4kG4EYs+MLYZBOk DGrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZZ2Gs+WA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si13614207edb.418.2021.05.31.22.32.01; Mon, 31 May 2021 22:32:23 -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=@redhat.com header.s=mimecast20190719 header.b=ZZ2Gs+WA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232915AbhFAFcD (ORCPT + 99 others); Tue, 1 Jun 2021 01:32:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56136 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbhFAFby (ORCPT ); Tue, 1 Jun 2021 01:31:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622525393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=siJz2CTmBAQXJpnvED6F5Lh0Z4do04zZE0SUG5Fvo2s=; b=ZZ2Gs+WAwGUw4hJSrtGoi8pFBeenRUCZil/IUzcdrozKK0LSvAz/CqeIN+kKwLkFYc5qDY 0x8/5YfX9+mWPuaWy59Ksgq7ANoc4AQYyo4dS426j21J6l5x/1EVuQq5hMf/rsS8io6Cla d2C8xtBN0BN5tzdqL95wQpbc89LhBKM= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-xpobtnF0PC-wDGxexPVjJw-1; Tue, 01 Jun 2021 01:29:49 -0400 X-MC-Unique: xpobtnF0PC-wDGxexPVjJw-1 Received: by mail-pl1-f198.google.com with SMTP id u14-20020a170903304eb02900ec9757f3dbso4000736pla.17 for ; Mon, 31 May 2021 22:29:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=siJz2CTmBAQXJpnvED6F5Lh0Z4do04zZE0SUG5Fvo2s=; b=e/+B1k0x9UGW63ky6HjTg+PwRjYSSOl3tVxHFI1aH2DYt1zPXXvFPnKyxK61BgKCdg jaFjAdJ/DsuoV5Pia22Hs2+0ukk1159S+3VnPPhtqbD/GVhzU2IEOnUBruBjfZvk3EV6 cUeyj/JeiImoxYkDPGmqmzGCoiQGSeTRKHBYlUKqCsNBGoTiD6jlZ9I38SIVv4kThhQW LvdydVGmv/9q9swyLKMpDeOy4A8+YhOEO2OoLSNr52hCr+1LL8Wl+0DY6YjNGPGOoziM QCvcTGxjPnQTBJJ9REg66qV1BKtJ0j7e05JCS/GzE3c0MAG5g8QkO9zmT7C6DNC9Ksgy JnHA== X-Gm-Message-State: AOAM533CyRz4HtQOgjsL3RHplcpcxfx+uNDUxoy+CgceykdNQ55+HtAp 6z7lSuURkBt5bssPerY+CNZdNEinr36zKWNd26PhPiypRtLPUinPdEqkVBsHXG3J0O580FrNoyJ jPf0nfqU+xjiZjivjfZfOJR7j X-Received: by 2002:a17:90a:4d0a:: with SMTP id c10mr2950615pjg.206.1622525388810; Mon, 31 May 2021 22:29:48 -0700 (PDT) X-Received: by 2002:a17:90a:4d0a:: with SMTP id c10mr2950597pjg.206.1622525388516; Mon, 31 May 2021 22:29:48 -0700 (PDT) Received: from wangxiaodeMacBook-Air.local ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y20sm12198235pfn.164.2021.05.31.22.29.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 May 2021 22:29:48 -0700 (PDT) Subject: Re: [RFC] /dev/ioasid uAPI proposal To: Lu Baolu , Liu Yi L Cc: 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 References: <20210531164118.265789ee@yiliu-dev> <78ee2638-1a03-fcc8-50a5-81040f677e69@redhat.com> <20210601113152.6d09e47b@yiliu-dev> <164ee532-17b0-e180-81d3-12d49b82ac9f@redhat.com> <64898584-a482-e6ac-fd71-23549368c508@linux.intel.com> From: Jason Wang Message-ID: <429d9c2f-3597-eb29-7764-fad3ec9a934f@redhat.com> Date: Tue, 1 Jun 2021 13:29:39 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <64898584-a482-e6ac-fd71-23549368c508@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/6/1 下午1:23, Lu Baolu 写道: > 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. Right, that's exactly my question. The latter seems much more easier to be understood and implemented. Thanks > > Best regards, > baolu >