Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2227895pxj; Sun, 9 May 2021 20:01:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhWRtLMd1gA2P1/wdvfEkyXFvHer8Pt131G2bcEcToRF2HIAQOhoKbZN32FBN6jvjhBHDL X-Received: by 2002:a92:3307:: with SMTP id a7mr19567839ilf.113.1620615695985; Sun, 09 May 2021 20:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620615695; cv=none; d=google.com; s=arc-20160816; b=RTidCTGyvrX6JYOUIHiKOWPvyThsc5luiDLNl1lOuJh9bggyrBMGlejdZ5Hdf6rSS3 ni6uaK4MKo0xvnPeqkfP6cvC3GDAVeCJGUA8eYmzByBcjs1gX9Gjn/o9tsTRiicLVqM+ 8pZV+ZOrRFGxNdli9aQ1+lrc/JuDyZpYPIIbhP3jfy7Q7HXJ2eeMJ4XZcw0rJWtfIPeX +1+NvP7Viu0UJ6IvyWUvbiPQXbeaTKVM7wm0wvDHJXKlLQLKA4FCxxwA2ZIMKufEs5ja mVfknvykKzMMddUqiREkAy0vpb3Blqv8S9MvHVfnWyPHkmYNwimVy4dDdTtgdIYY49fd vdig== 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=zzre30e87Uq5FxmXarbdD5k0Xuzm4RhI4szuf4Pa69o=; b=uPer8nO66uL979FcIylS+w9JUoUldZmnrW3hWgTMdUu1a33QAYR5BCsquJrUImZSji 997mEwIUgmisVfB9Dgtygro0f36FFpkRV65NdWQgb23urL6HWbbj6quShB7VU9F5KM8O 4J+lPeEyEguoaw2XWoIeSpYFVIpuVT16PDc2yjrhqm/xLU4XOk/5CNX/6uxErq6tNg3y V5UyJ+LDA2wo9y57e0zEADG5sV/276qSg4vPjU28jIhvU/eP/vbZDz5JjafbqIZRuLUE +je5plmqJUpgsCNrTmNJ/Rjl8JK4G3cZ9SHeGNb8+gPBUkGWS0xMEaePnZJKolBF4Acn TVcA== 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 a5si14866603ilq.155.2021.05.09.20.01.23; Sun, 09 May 2021 20:01:35 -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 S230165AbhEJC6b (ORCPT + 99 others); Sun, 9 May 2021 22:58:31 -0400 Received: from mga07.intel.com ([134.134.136.100]:51083 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbhEJC6a (ORCPT ); Sun, 9 May 2021 22:58:30 -0400 IronPort-SDR: E6BOKqRC3jD8z47qhsrPSJiparxwyQBM0KDe7bSBSM5f61ZqzO2FJ99grDOktqP00D80wojYJw h8p8idKlE0Yw== X-IronPort-AV: E=McAfee;i="6200,9189,9979"; a="263030892" X-IronPort-AV: E=Sophos;i="5.82,286,1613462400"; d="scan'208";a="263030892" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2021 19:57:26 -0700 IronPort-SDR: 6K91kGL+MSn6CKe/D+S+5wlos8v6m0M5XDa+qOzvai4vrihr7gv1hyF8fEllhvE+Z003sBqTg7 jQhqlwfqP/xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,286,1613462400"; d="scan'208";a="621044664" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga006.fm.intel.com with ESMTP; 09 May 2021 19:57:21 -0700 Cc: baolu.lu@linux.intel.com, Jason Gunthorpe , "Liu, Yi L" , Jacob Pan , Auger Eric , Jean-Philippe Brucker , LKML , Joerg Roedel , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs To: "Tian, Kevin" , Alex Williamson References: <20210421162307.GM1370958@nvidia.com> <20210421105451.56d3670a@redhat.com> <20210421175203.GN1370958@nvidia.com> <20210421133312.15307c44@redhat.com> <20210421230301.GP1370958@nvidia.com> <20210422121020.GT1370958@nvidia.com> <20210423114944.GF1370958@nvidia.com> <20210426123817.GQ1370958@nvidia.com> <20210428090625.5a05dae8@redhat.com> <20210507110614.7b8e6998@redhat.com> From: Lu Baolu Message-ID: Date: Mon, 10 May 2021 10:56:37 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: 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 On 5/8/21 3:31 PM, Tian, Kevin wrote: >> From: Alex Williamson >> Sent: Saturday, May 8, 2021 1:06 AM >> >>>> Those are the main ones I can think of. It is nice to have a simple >>>> map/unmap interface, I'd hope that a new /dev/ioasid interface wouldn't >>>> raise the barrier to entry too high, but the user needs to have the >>>> ability to have more control of their mappings and locked page >>>> accounting should probably be offloaded somewhere. Thanks, >>>> >>> Based on your feedbacks I feel it's probably reasonable to start with >>> a type1v2 semantics for the new interface. Locked accounting could >>> also start with the same VFIO restriction and then improve it >>> incrementally, if a cleaner way is intrusive (if not affecting uAPI). >>> But I didn't get the suggestion on "more control of their mappings". >>> Can you elaborate? >> Things like I note above, userspace cannot currently specify mapping >> granularity nor has any visibility to the granularity they get from the >> IOMMU. What actually happens in the IOMMU is pretty opaque to the user >> currently. Thanks, >> > It's much clearer. Based on all the discussions so far I'm thinking about > a staging approach when building the new interface, basically following > the model that Jason pointed out - generic stuff first, then platform > specific extension: > > Phase 1: /dev/ioasid with core ingredients and vfio type1v2 semantics > - ioasid is the software handle representing an I/O page table A trivial proposal, is it possible to use /dev/ioas? Conceptually, it's an IO address space representation and has nothing to do with any ID. Best regards, baolu