Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp960835pxj; Wed, 2 Jun 2021 16:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGl+TXn2yADyHJkKY/oeVH4OnBpmQweekslwZI/TM21Ykn0myAN+Z/In87aN+ALp4A/i5M X-Received: by 2002:a17:907:c06:: with SMTP id ga6mr36603411ejc.229.1622676506468; Wed, 02 Jun 2021 16:28:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622676506; cv=pass; d=google.com; s=arc-20160816; b=ySU27PYJpV3sDgtFkXv27KpwOQJe7NGNihyR0+KrOH0YzllNemCqhLHsMHBOBmlAy4 c44i2Bg26r8nBzbUm3buYGsNoHGWbPL/ffGBn2Zn5gVfczcq4GF/SJXT4yhIwaSS2VRf d4BtBGlODX+6Ev74ACsOq8VIfGhjRk/esh/flSPx9l8PMEvM1GOtcESAG46Gcpxq7KhB pvP8glC57hjFZXluNzamASetMylY2ib6E84KqapJeefvGfVSQSWu4C4I2h5X8MgGnlUP nwpSLpn2jsCO6pxoEaWmcp5+48vRfUPTZ5RIr7SMkWynn3k0a4Fi7KXTTe2YLwwxOjvA Pf9w== 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=gZrdkgWbonFUe8/oj+jZZUaM12ytKCO0DBycev9Q0gc=; b=yu7H5SPldplhnsq4DOD2iomgmvYM2lWzJATKgMrCjpBQZebTjTHfRGCRAXgH7g7vT9 VXXy9c/ayHW7DfvYTATthpq+eo6EFlNKm+JTXOLKg1olE/SieDYFumWYx2/sjOMRFlvw uCAsAKA28MCy4apuOvYik9vvTuu3T2EGjBE+SWE22FPBnBHVShmocz3kIlYZRPLWcDLa 3LXbEDvaWMYXNkeJdKp2A4noEx6qboSHHhB2IX10gyejflPNNnCKraxEppZuy6+Ro7ed muEAn5gFIoVicpyVJN3r2zRb8mLem+lwZP6bYIEixYfX3yqPCzUJXxFpCiYQfMnBoNuP XAZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=CR37NUVp; 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 m2si855375ejk.237.2021.06.02.16.28.03; Wed, 02 Jun 2021 16:28:26 -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=CR37NUVp; 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 S229774AbhFBX2r (ORCPT + 99 others); Wed, 2 Jun 2021 19:28:47 -0400 Received: from mail-dm6nam08on2052.outbound.protection.outlook.com ([40.107.102.52]:64801 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229626AbhFBX2q (ORCPT ); Wed, 2 Jun 2021 19:28:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKEgSYvXpOi61AsBJqkLSKaaFOLSdkvv01HfrR2b4N4t4H0bSuaoJn47pU5BZCezYoxoqMH5VydY9hFwhZNJeZBWhAEMboBoKtCvF1JFjsmMpg4u3Uyt0X2RstS7MibJjQJNsKgTosK5mpPFLYUyzaPXR4pknZuZYQmbbOp3jm6doyKPf2vVFhxMBVlpVCjy7hpF756wZqArQv8qe3KNbmg+N7FM5DPgzwy91sccsukiHpIUMbi1IrQSbhcqmOm2POM1kkUOUjobNONWH5QtuQyhxabKmW8VELLme+HqohHdC1Ec1KE5czHlin46BM7VYiGRjKJWzujRK/KpNqscog== 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=gZrdkgWbonFUe8/oj+jZZUaM12ytKCO0DBycev9Q0gc=; b=OE1fInDttkV6bOZ3tjbN+FFyCp22BPI6F0SKUhCIPAU18A2dBTzCAz6nD8nRghPRyp/KmgEUnQN3rfzO/ruLTWFBOkPl2MMNzuj95KIJB+TFJRZ/FG7Zy2VbBXZe6v3V3zU2IsFHvMqxbc4Bs9JBFwgf3yNr2CcFyJ3o8AL34y7lQMneMB422OcwQRedAUzWHBx1Dq4Mq1A4vZ6wRXqJoigvQjc330ahhjl+x1GlwyesB0QBe9rU9hz3km0yMyfRCXLhoHoYuVsYT4yHXW1BVbQKHcrx04920fezN4xCudgR3qsTce6bCd8a7KONwtzNWtQKFzkMAgUR9VAi6G/T6w== 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=gZrdkgWbonFUe8/oj+jZZUaM12ytKCO0DBycev9Q0gc=; b=CR37NUVp0gaqpNCLOWYUZaUfW/9AojzRairE2G0Zh6oLCtn74+WOdn36C9tcpTc3Q9floWLsrQzJAkAoY4MoN2WmV9CkmkSEuiqeWJMtsmWLCDfyDnjCI6NJbX1DmUdn4PH0KeVibV2rUkvXApsXoUmmtdWJcWuH/hYmEp54dk3OmENVcgNqhr7hO6ir5fHPXJfN5Uacu8Mx5ChEfLejEZ2w9AT4TI2T+1kAMw1bOHbXEc8iJiARYtufUGCH8Wk4oTTAY8RVgHSFVU9mfXwbAo1xfneoCpwceNa8M72yEpCfImIsKUgfU/XuLTrV5r2quNvftoagkUipvr3gbhdY9g== Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5304.namprd12.prod.outlook.com (2603:10b6:208:314::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22; Wed, 2 Jun 2021 23:27:01 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%6]) with mapi id 15.20.4195.020; Wed, 2 Jun 2021 23:27:01 +0000 Date: Wed, 2 Jun 2021 20:27:00 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Jason Wang , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Jean-Philippe Brucker , David Gibson , Kirti Wankhede , Robin Murphy Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210602232700.GM1002214@nvidia.com> References: <20210528200311.GP1002214@nvidia.com> <20210601202834.GR1002214@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: BL0PR02CA0095.namprd02.prod.outlook.com (2603:10b6:208:51::36) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by BL0PR02CA0095.namprd02.prod.outlook.com (2603:10b6:208:51::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21 via Frontend Transport; Wed, 2 Jun 2021 23:27:01 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1loaGK-000nU2-Hc; Wed, 02 Jun 2021 20:27:00 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b5c0518-58d7-453e-5a8d-08d9261dec7e X-MS-TrafficTypeDiagnostic: BL1PR12MB5304: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BU+zRYD9FkNGtHPmrbSKimdwhgH/MiQCyly4PIiEn3M6REBqA4Fw4lkl2k9R8Y+N/DPZuM29GtsdmXvFMWvJgjukFA1aG1i1g/IV2GnzMb/tj5OaJnrzp+EYtpEOO6AHhMJBmR8WQXoxxun1IomkwIDTvGADI7gtSfp4jI1T6kmvZCiFntHhd21I7A367dyrjUIjKi4QdDxbAOfXX6s7YxXJ8TNQE3PXQ5CeWsZcywCtWZKrd/zOkheM+nXTN202T7outfx/jHK4TgPVyMySAr8uT2oFvUIUycmhg5niwlL7oIs2Sett64+TNLgmlW6YB4xeCVqAYj6jpvdvLjjTNFNLgO5jHAygSJJklDJGqvMnLL4JEiuV10iXXI40mHYqTGtZrCd3ziXSR4p5BVIbBSXXo5t3nliEbcgSSU9MwfXSJ4/QF7N5k/8xc9WyjX30EjQgox30fsx/DI0olbVRrFLpB7w3LSn02rctTb6IhNhF8oyjue2nwUJIIWXN7/q1OJRtRIayFayHWpNWoinGNU9iz7epZoJJq5j5iO9t/G2fkR2TzvbUwxNRLpA05PBV5S0AIY1aDAYLRiCM8e0SEEYiihuMwBD4jqp1JQnLoB0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(39860400002)(376002)(346002)(396003)(6916009)(9786002)(9746002)(8936002)(186003)(4326008)(1076003)(478600001)(2906002)(54906003)(66476007)(7416002)(66556008)(316002)(86362001)(66946007)(426003)(4744005)(26005)(5660300002)(36756003)(2616005)(8676002)(38100700002)(33656002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?/vtsiPMw8z7P9wAKGhALEjONbN/3Xl2uwCbIojOkXzpmml5sKGAxF2jonxmo?= =?us-ascii?Q?V8Cvk7ZhnWbuU3ehnSxFJ19xkTLqZsiIvG7VgMevrqct8v1/hItQKBsbjDfe?= =?us-ascii?Q?G5zCqZ3HOJ64CyIwZyjt8GB9qWhIXNjzpPkgAQNPVKk92bBEn9NiEWeJVjeF?= =?us-ascii?Q?uDqYVNxNg0cYTWjdVIdg3B/fLPyyvsBZXdZU+UdzrNr4ZnGWr+Bj2/rRb3Ko?= =?us-ascii?Q?gVZpdTI+U6/OutpbzK+uMBTCUNLwsbJRmIkqbP6i09uYxRPMik+P7GNcpOGi?= =?us-ascii?Q?Xb3h4qLYyY7Z2lWIzfd1GQBCq04WVQ1mR8Ds9xAZLieW00QkU0qo0cC3Oo61?= =?us-ascii?Q?pAjsofYylzM36kbtRekS582j+dGFIFEzGEAkQgIiD3nb4bRDcm3KHRNFQpi/?= =?us-ascii?Q?ept2HwN6jcwnXtdNJEDRN6+V4KYQt0+EyNcShdE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ttqNjK3BIc9E?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b5c0518-58d7-453e-5a8d-08d9261dec7e X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2021 23:27:01.5138 (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: P60kZnQMNKds2LGRYCQmsz8iS26mIQ+fZAPmGRDf12JIFxjNPTUBIhRDkJsojO6m X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5304 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 01:25:00AM +0000, Tian, Kevin wrote: > OK, this implies that if one user inadvertently creates intended parent/ > child via different fd's then the operation will simply fail. Remember the number space to refer to the ioasid's inside the FD is local to that instance of the FD. Each FD should have its own xarray You can't actually accidently refer to an IOASID in FD A from FD B because the xarray lookup in FD B will not return 'IOASID A'. Jason