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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 233ACC43460 for ; Mon, 10 May 2021 02:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFEE2613D3 for ; Mon, 10 May 2021 02:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbhEJC6b (ORCPT ); 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