Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3025095pxj; Mon, 10 May 2021 16:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ6KSu/Qcy43vKb8Jx54SlfgNm0opOuWGzGBnLP1ZKbb4sK6zmL+q/MUEFW2rdXyzLjctK X-Received: by 2002:a17:906:8a51:: with SMTP id gx17mr28189949ejc.549.1620690385847; Mon, 10 May 2021 16:46:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1620690385; cv=pass; d=google.com; s=arc-20160816; b=y9As8mgF/YoUoD92rls+8cDepULJAdum70SsOqCbdLFk4d7uRBjiM8fOD1OPp9ar7N 8d0JqgBrkkSa/fXY68uNJpJhcswdLCjmorkEYiC7V0QFdSQHzjcchSF4jrS8iBnQjXEj D590IBfr5IVhwNwH2HzzgCXUW4oX0Zyb0wbEb9JDRizuX6SgKIl9JihcNEiJbHdEgZZ3 KSczLNefYLxMfs0Rjn1+1wdM2WpGFf65BRskPoYE771D7OBU/tRy6Jv86P1PgjLKlIL+ po70AivNXpRIBt6r5fJ4082nskYz3e7p8b2eLXBqmawfTcQ16GYaicR8VDWXZYDHf2jg XbxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x7YvY3ghFZVy/MxSq55DpMslbyjZ5dtdU4r62kwxoiA=; b=ifauuBQxlSgVe27DU9Dp1PBJzmKv9BUCGpnd85wTP3cQf0jpH7lEdP8CV4OPGSRLbJ WwbusAT3pZmSqUSdHxOCtsny6VVUlBOLJDtZOTBL5C0Rua5c5U9WYB6tuJvciNW2bflS xg/f+VJ84CQuzE/YL+8g7WfMht0or7n6wQGAEZ428GcyoAjZ2Tw/LCwf9FL8F3xbQiJB /lr2rbIjJd1L7+cfUUcZQeRM3BVJYkrcM+hvirOg+AcsLs+fuGx5VmPZiIHUF4xbTx1x QpPd6bN4rmnXEjpxLsDJ4i+qv7crhEZAiPlhWvcOYNaNRL6dLLRakhnaHdMHqJUVslCI MehQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Yq7gr1UX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si15418564edy.288.2021.05.10.16.46.00; Mon, 10 May 2021 16:46:25 -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=@Nvidia.com header.s=selector2 header.b=Yq7gr1UX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbhEJXqK (ORCPT + 99 others); Mon, 10 May 2021 19:46:10 -0400 Received: from mail-bn8nam12on2074.outbound.protection.outlook.com ([40.107.237.74]:61236 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229925AbhEJXqJ (ORCPT ); Mon, 10 May 2021 19:46:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fChj2XsbUI5A53OiEq0v1UCsCOCICwB5OUpQvJhrz09zABzCnI0/0AcUfAQTJ2ZCJPzxk/n5cQSppVS0XoAfFDoEb7vxCg+Lpjwlnp0AbKrOPsYcCEIHse+UWN2yzN+bIWUd8YlAb7w9Bj9cV0M1uWoRGPSv+TH3o4CfSMIToGqs2O1Ilgjk9nq9y7l6NnsojSVPmtLQAsqYU6m85W4n7Rn7fQ20M4+gRQok/rTuc+EyqGbPzWoXx1hc/TyH0B0vARmX2sXBhc+RXHXqTFX+knlUpuk6kubaBpb70RJ8DSz0cPCvzLELK1o2jUZ1xchrx2dDdeluTOjy/5Rbv2rH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x7YvY3ghFZVy/MxSq55DpMslbyjZ5dtdU4r62kwxoiA=; b=DiksCGr+vh+f8hJg8SdxNvN2Mt2Uu+WT0JdGV4o3gNMvRcPw+v+eH64RwEcx8Jd5WTlkWgcS+uQZQRs6MvdVqHp1a2ZFEIPCsYgdM//6LStWQeE4hGTn5iJOb2pUnrb8DObUn9th2tIMTFRtlQU5VzlYp3qtqkbme5fZ5nHK3ZgatdWGK31DEgF9SGaD6oy3YMyDUMmgGVU9o0ygMIDP0h1Sx6EqnDja7ev08XwzeKDm1cAuClvGu8j76K1A62x/UIhoxYXlK+Ig5ORPH1iWPiCgrRLY9lqPLUvz3527w9AzBwBaa1ewQkpT17dXX6GS7po7peD36B+BFumoLbL/1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x7YvY3ghFZVy/MxSq55DpMslbyjZ5dtdU4r62kwxoiA=; b=Yq7gr1UXvocILLOd/cAZX/SeIuPRzT2nlY8iA2gHlK+T+O8REUIqM67sUydNMVMQ1W2hCWb6JmMxghjM0z54FI4m7H1TN+MmpPrZuvc91T3D7OUUM/YSBkQK3Y3wc0NYxo371BOxHUkl1GX4ETN277n93RAqLwYT8EPrjuu4MdizO7soom8G1mFQbnWh7tHbmCMR6ekWFwFKOS+Rtgsi49w+nbw8SjtLnbrFzd4uil/1SJn8Ccig0q76mz9Fdqk8oi2s+WZg1RqRmFMUIBZAAt/J3diEuPzIQ0enSyKYgVSDuwjQLLg5zOgSPRN28KS+C8q54Zc2sR06Dc5XL5kWYg== Authentication-Results: linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM6PR12MB2810.namprd12.prod.outlook.com (2603:10b6:5:41::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 23:45:02 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039%4]) with mapi id 15.20.4108.031; Mon, 10 May 2021 23:45:01 +0000 Date: Mon, 10 May 2021 20:45:00 -0300 From: Jason Gunthorpe To: Jacob Pan 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" Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <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> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210510152854.793ee594@jacob-builder> X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: MN2PR13CA0027.namprd13.prod.outlook.com (2603:10b6:208:160::40) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by MN2PR13CA0027.namprd13.prod.outlook.com (2603:10b6:208:160::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.11 via Frontend Transport; Mon, 10 May 2021 23:45:01 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lgFa8-004ynM-DO; Mon, 10 May 2021 20:45:00 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 447649ce-59bf-4c95-5af4-08d9140da0e5 X-MS-TrafficTypeDiagnostic: DM6PR12MB2810: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5iEiZ520upX09gKKQjoChrV3BJ0BV0SaVBKVXQzB4BSHTf/W4jOg1Kk+O9OMMzP1gvYkM7NaTFfADZNE6zIGQNlVbm3newncEQItNmTdQstATKavVGI5iaDuXrR7eG1Y4cxd1LEv+KNI8btagNyrzqL1gECfnev4IVT6kaSae/K/hpNXs5I61gFxjJX7cBsO0s+DnuIV2B3FXzcufDQLeTBX4HcBrJpPa6/s5gZWrr7xg/8T9Ys0I2yjJ7uXAbNtslwTSSUMWstzWo8E669yeQa+CFqIP3gIpCKyiJFdFHD0stZPNcNhaWf26DJ/BHtnUXx4gWEPnlqeUBsxZooKZQ+cTGPhKGDgKtCE6/8PqDdjDmANR+9lXQaBvy0nCfCUJeAcYoyW/fvFvt3T0byaB09azj5Rc3BQT18YprgvajouzKZTjwghfj1+YEm2mN/chGHJdfsmWB0uw2RAsl4m94Y/C217k2dEUE3+PgOXhySO56WlZyjs5w9MqTdWBIb8Bos6OHQzIbtwsga4YSC7lnm230cIhZoP1JeTSaBJH+kLEz47g+uM+7BkVeZwkUzve+7LSKoFFE1v9yV1PUosXXkPsE4iwxQHBmBOyUjRMWI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3834.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(346002)(136003)(39860400002)(366004)(426003)(9746002)(9786002)(26005)(66556008)(186003)(2906002)(7416002)(66476007)(8936002)(38100700002)(66946007)(6916009)(5660300002)(1076003)(478600001)(33656002)(4326008)(54906003)(36756003)(86362001)(8676002)(4744005)(2616005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?BUp0s5BeV2Fu7aan6cme8pJEjLjmizN1izrXIo0wVMfIZNaAh6CIxsStMMhF?= =?us-ascii?Q?OwKSZz4yMD5VkbrIdogs9sq07BYP70zCsACd3eDWF0n1u9Puzrh8MsbGXoVQ?= =?us-ascii?Q?hUYhHwkYRrVwBE88kxwbechK6OqhwJiLQSbbpSyHv3gliLG4wxtDx8QpOaE1?= =?us-ascii?Q?xC9MY2L2oNTmOyVIKyZyl+vys29cPGM/2fWdNuoAt8bRe2oaeOLV8esH/1Xm?= =?us-ascii?Q?4Z2A0rUmjYVm8UQU6M14qL1xR6JEbl6+pK17gDP1+ASebzGvXqyGTlV7oZ10?= =?us-ascii?Q?1FxwqYb9qqbYBb8yUShrNoDRPI+UfIs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ascii?Q?mtUg71gCLltiXWtWYEMXAfHNeF16WiBk9WPV/XfaI9euOIdjljGT8Ib9sVkX?= =?us-ascii?Q?TZ9SHcBPesUJV2Fptxl1DudkeR1FzuDHOM5bvmpkjO9o3za0kGJVmVO2ZyXr?= =?us-ascii?Q?7egJhqdz70+joWcrFrvhBy2x?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 447649ce-59bf-4c95-5af4-08d9140da0e5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3834.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 23:45:01.8080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3XhNRUt8mzrbVQl0PbldETwrxrvBuAkqSYmK5e2keHnU+/EHyXuCVzu3MbABNGhO X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2810 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Jason