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,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 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 A72AAC433ED for ; Tue, 11 May 2021 03:54:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8711C61154 for ; Tue, 11 May 2021 03:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbhEKDzS (ORCPT ); Mon, 10 May 2021 23:55:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:36670 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhEKDzR (ORCPT ); Mon, 10 May 2021 23:55:17 -0400 IronPort-SDR: LqEMSbAqPHTjZvTYzvcaY2k7SAMAO/OAnS5s6JRTlGuasQSRN55t6V12VSrhiAuSLwxPR1+XtV DOdH5nJjqCEg== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="179611174" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="179611174" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 20:54:08 -0700 IronPort-SDR: BGkUROo0isoG62lW2JllWLXLCmesj1plEIE8OeOyfJmGo/B2YJ6alU7HCdoy+34HdAxDy4SOl8 qxbcEgvx9lNw== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="408616471" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 20:54:08 -0700 Date: Mon, 10 May 2021 20:56:32 -0700 From: Jacob Pan To: Jason Gunthorpe Cc: "Raj, Ashok" , "Tian, Kevin" , Jean-Philippe Brucker , Alex Williamson , "Liu, Yi L" , Auger Eric , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Wu, Hao" , "Jiang, Dave" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <20210510205632.13ff7308@jacob-builder> In-Reply-To: <20210510234500.GI1002214@nvidia.com> References: <20210506122730.GQ1370958@nvidia.com> <20210506163240.GA9058@otc-nc-03> <20210510123729.GA1002214@nvidia.com> <20210510152502.GA90095@otc-nc-03> <20210510153111.GB1002214@nvidia.com> <20210510162212.GB90095@otc-nc-03> <20210510163956.GD1002214@nvidia.com> <20210510152854.793ee594@jacob-builder> <20210510234500.GI1002214@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On Mon, 10 May 2021 20:45:00 -0300, Jason Gunthorpe wrote: > On Mon, May 10, 2021 at 03:28:54PM -0700, Jacob Pan wrote: > > > To satisfy your "give me a PASID for this RID" proposal, can we just use > > the RID's struct device as the token? Also add a type field to > > explicitly indicate global vs per-set(per-RID). i.e. > > You've got it backwards, the main behavior should be to allocate PASID > per RID. > Sure, we can make the local PASID as default. My point was that the ioasid_set infrastructure's opaque token can support RID-local allocation scheme. Anyway, this is a small detail as compared to uAPI. > The special behavior is to bundle a bunch of PASIDs into a grouping > and then say the PASID number space is shared between all the group > members. > > /dev/ioasid should create and own this grouping either implicitly or > explicitly. Jumping ahead to in-kernel APIs has missed the critical > step of defining the uAPI and all the behaviors together in a > completed RFC proposal. > Agreed, the requirements for kernel API should come from uAPI. > Jason Thanks, Jacob 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,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 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 D418DC433B4 for ; Tue, 11 May 2021 03:54:17 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F8146191D for ; Tue, 11 May 2021 03:54:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F8146191D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0B1ED60698; Tue, 11 May 2021 03:54:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qN87V00jtTWH; Tue, 11 May 2021 03:54:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTP id 10C47606A0; Tue, 11 May 2021 03:54:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E1B5AC000E; Tue, 11 May 2021 03:54:15 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id CEEB9C0001 for ; Tue, 11 May 2021 03:54:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id AD31C40186 for ; Tue, 11 May 2021 03:54:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3J6PAvsrN6bY for ; Tue, 11 May 2021 03:54:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp2.osuosl.org (Postfix) with ESMTPS id 12F05400C3 for ; Tue, 11 May 2021 03:54:12 +0000 (UTC) IronPort-SDR: 0mNkaxn/44Avsi386CcAwHtlPaNIcj9nMNN58kXTcpmj9dVBPbI1GWMFqjyh6V2asWvnkEAUcN LWIgLdyFnmzg== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="199024670" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="199024670" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 20:54:08 -0700 IronPort-SDR: BGkUROo0isoG62lW2JllWLXLCmesj1plEIE8OeOyfJmGo/B2YJ6alU7HCdoy+34HdAxDy4SOl8 qxbcEgvx9lNw== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="408616471" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 20:54:08 -0700 Date: Mon, 10 May 2021 20:56:32 -0700 From: Jacob Pan To: Jason Gunthorpe Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <20210510205632.13ff7308@jacob-builder> In-Reply-To: <20210510234500.GI1002214@nvidia.com> References: <20210506122730.GQ1370958@nvidia.com> <20210506163240.GA9058@otc-nc-03> <20210510123729.GA1002214@nvidia.com> <20210510152502.GA90095@otc-nc-03> <20210510153111.GB1002214@nvidia.com> <20210510162212.GB90095@otc-nc-03> <20210510163956.GD1002214@nvidia.com> <20210510152854.793ee594@jacob-builder> <20210510234500.GI1002214@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Cc: Jean-Philippe Brucker , "Tian, Kevin" , "Jiang, Dave" , "Raj, Ashok" , Jonathan Corbet , Jean-Philippe Brucker , LKML , "iommu@lists.linux-foundation.org" , Alex Williamson , Johannes Weiner , Tejun Heo , "cgroups@vger.kernel.org" , "Wu, Hao" , David Woodhouse X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi Jason, On Mon, 10 May 2021 20:45:00 -0300, Jason Gunthorpe wrote: > On Mon, May 10, 2021 at 03:28:54PM -0700, Jacob Pan wrote: > > > To satisfy your "give me a PASID for this RID" proposal, can we just use > > the RID's struct device as the token? Also add a type field to > > explicitly indicate global vs per-set(per-RID). i.e. > > You've got it backwards, the main behavior should be to allocate PASID > per RID. > Sure, we can make the local PASID as default. My point was that the ioasid_set infrastructure's opaque token can support RID-local allocation scheme. Anyway, this is a small detail as compared to uAPI. > The special behavior is to bundle a bunch of PASIDs into a grouping > and then say the PASID number space is shared between all the group > members. > > /dev/ioasid should create and own this grouping either implicitly or > explicitly. Jumping ahead to in-kernel APIs has missed the critical > step of defining the uAPI and all the behaviors together in a > completed RFC proposal. > Agreed, the requirements for kernel API should come from uAPI. > Jason Thanks, Jacob _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Pan Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Date: Mon, 10 May 2021 20:56:32 -0700 Message-ID: <20210510205632.13ff7308@jacob-builder> References: <20210506122730.GQ1370958@nvidia.com> <20210506163240.GA9058@otc-nc-03> <20210510123729.GA1002214@nvidia.com> <20210510152502.GA90095@otc-nc-03> <20210510153111.GB1002214@nvidia.com> <20210510162212.GB90095@otc-nc-03> <20210510163956.GD1002214@nvidia.com> <20210510152854.793ee594@jacob-builder> <20210510234500.GI1002214@nvidia.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20210510234500.GI1002214-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: Jason Gunthorpe Cc: "Raj, Ashok" , "Tian, Kevin" , Jean-Philippe Brucker , Alex Williamson , "Liu, Yi L" , Auger Eric , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Tejun Heo , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Wu, Hao" , "Jiang, Dave" , jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org Hi Jason, On Mon, 10 May 2021 20:45:00 -0300, Jason Gunthorpe wrote: > On Mon, May 10, 2021 at 03:28:54PM -0700, Jacob Pan wrote: > > > To satisfy your "give me a PASID for this RID" proposal, can we just use > > the RID's struct device as the token? Also add a type field to > > explicitly indicate global vs per-set(per-RID). i.e. > > You've got it backwards, the main behavior should be to allocate PASID > per RID. > Sure, we can make the local PASID as default. My point was that the ioasid_set infrastructure's opaque token can support RID-local allocation scheme. Anyway, this is a small detail as compared to uAPI. > The special behavior is to bundle a bunch of PASIDs into a grouping > and then say the PASID number space is shared between all the group > members. > > /dev/ioasid should create and own this grouping either implicitly or > explicitly. Jumping ahead to in-kernel APIs has missed the critical > step of defining the uAPI and all the behaviors together in a > completed RFC proposal. > Agreed, the requirements for kernel API should come from uAPI. > Jason Thanks, Jacob