Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp722595pxt; Fri, 6 Aug 2021 12:05:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIXNQIhHyTtzILNRJUSGER+XKa635+oGlDMML1xbeEtHB5AHybcISwNubeQrhYJH8iBhwy X-Received: by 2002:a17:906:e54:: with SMTP id q20mr11407842eji.86.1628276716291; Fri, 06 Aug 2021 12:05:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628276716; cv=pass; d=google.com; s=arc-20160816; b=0y0ykR0GmTxokk2CeeGdv7w2ZC5areWeA/KCMrKzqI1B9m9nvrKFnwsU8PCkZMLsJZ UubSDlWP45l22WEaffoVtO9cNTV5py5/qaG8Q+DUZOWe8I0hALO72o5PdEUdd+YGyPtc eMmh5kQjkzIdVY88OLQfw0dx8SwqurxwiIHC4LCZSVetVGCd0+Q3FKtvavdR7lPBqO7M qyViWR62P2rNKxLIt6Skr0q9Ga3KI7xnoXJcYStMydL0+ZaBX82zT26Ju4YPu8C4Nd/f NwAahxS2g3H9cNLL+dvOjYGwq4a7QHwj+eMxZ3Ap+IU5ZnZAqW/nD/BEo/R46QOUm4zz 6fvQ== 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=zxgcBaozIY21A72wPLO3n8YHDQ9KpNXJwOe+l1yDXcE=; b=OONvQfsgp5afz4qp421JG27ZB+d1xzoWbrsLyz5XNsVFsjfeeZIXCNy3l40g/MqCYw VHKmKdnvLIqEgRLNK2lliOvWL3hvf0aAGHCbIfR3L8wW4QzDoJOXX8uLFA8I6R3BlE+r JP0TTVK8S4evplCWZqBw5x2N2UETI9CDHcZZLqU8me6SnOq4ecz6YQQSMg2JK0qrWN6Y UkTgp7PhhnC4iVRgoTtTTWCEDpO8ayAUcztF8TsYjD4kONZqsg0yviqsMBD+Qvc4JRRc /0vcK+i0mD2cg8uYAhmDfWWrSKTvG5Udq+ZVikLNdZVf+t37+neTZariCvaWLScM1+4k lmAg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=dQ2Z1BpX; 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=QUARANTINE 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 lg6si9327094ejb.390.2021.08.06.12.04.52; Fri, 06 Aug 2021 12:05:16 -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=dQ2Z1BpX; 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343703AbhHFMcg (ORCPT + 99 others); Fri, 6 Aug 2021 08:32:36 -0400 Received: from mail-co1nam11on2074.outbound.protection.outlook.com ([40.107.220.74]:11233 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343689AbhHFMca (ORCPT ); Fri, 6 Aug 2021 08:32:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=at5Y6MJ6WB9pLEfeBQyUVsuMjVD82Cg3iwUwRZ7AQMA1Akgy2cvvg4i9n/ULsacDp20/O8JSw10H7XXFQATs27+zN0xK0/fNxEXKVoura+BVod1CwAgCvdNRNycvHAHsxB4u26rlvi4X7A6Ftmo/X8mE+6BcM85BCINSOLX77R0MnTSIuJxlbSB6llgXXGTTQUfqHzEQFcb1o8Ld+CYk9YV9l180vYSYHokdMrlzDQXiuRM7StPKiTZKd990KoRkq7+c1lG4jSt2/LYiBOoNaTagUC4Qo5UFEG+YRUWAUbrIFc6gPCkor0NbACZ7an5aYQekEBB0NXw3pEBHbUoMnw== 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=zxgcBaozIY21A72wPLO3n8YHDQ9KpNXJwOe+l1yDXcE=; b=cvcpfVIVppnca4DqPJjfMCcwdSuyOt07OoZAFt3h4v65bFxjBQoISpJbVRs7DltjYH4Oar6f7fpERVc+gYItETGcbEz5gvScBPv1dTFfw54zw3XVXsfYh9vbiZ6o17ScqCGmuY5dR1rWrNEH1u8n++Qr68Pi31yqbe9Y/3kvkYekoxDNkid6+wzZNxsx9kdlFjzBPRv+9lHN1iGfjMTBQ3iTdaSOOsDlTAYX/YAa7pmzToNLEJ1V4iTFBGTuMFrLv1dtQvcjqis2wIwKtkLNqLT6E2l41YY7+2RhmeZE7O2axqz4QYGnwxd/2AwBFiwNjMUuVf/j4hCaA7aUpGLdgA== 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=zxgcBaozIY21A72wPLO3n8YHDQ9KpNXJwOe+l1yDXcE=; b=dQ2Z1BpXVwG6/8dktf2hTI0XcMTZKH+qs0zkWT2fGGDsX/63UXVLzPxBXlKVSMTEX9jjVUyT/pjxymYr1Y0tnlu652PxKDBEAoGGqOa13gNO0jWZ8YKzuwRbnSq04t/PfEwVu5MJdf3pWOCZmiu0e9lsbXrYJYE04j1dH5n7VIiYgJEmzTakP2xMiEwBdWLMssNyS6NVjqOWXMLDEAqhVnB6uNrLuG8009isneyTEKi21Hi1RkuohsTeEJiXM5dSZnNHYrMq1QuTNos64x1lumpeCXzMKxxDqqQZxN/o/1dm+2ymwk70bgMmHEv13C7f2hK+A/XzOKARTDjZ5dh4FA== Authentication-Results: gibson.dropbear.id.au; dkim=none (message not signed) header.d=none;gibson.dropbear.id.au; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL0PR12MB5523.namprd12.prod.outlook.com (2603:10b6:208:1ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Fri, 6 Aug 2021 12:32:13 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::1de1:52a9:cf66:f336]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::1de1:52a9:cf66:f336%7]) with mapi id 15.20.4394.020; Fri, 6 Aug 2021 12:32:13 +0000 Date: Fri, 6 Aug 2021 09:32:11 -0300 From: Jason Gunthorpe To: David Gibson Cc: "Tian, Kevin" , "Alex Williamson (alex.williamson@redhat.com)" , Jean-Philippe Brucker , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Shenming Lu , Joerg Roedel , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Kirti Wankhede , Robin Murphy , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , David Woodhouse , LKML , Lu Baolu Subject: Re: [RFC v2] /dev/iommu uAPI proposal Message-ID: <20210806123211.GR1721383@nvidia.com> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR01CA0004.prod.exchangelabs.com (2603:10b6:208:10c::17) 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 (142.162.113.129) by MN2PR01CA0004.prod.exchangelabs.com (2603:10b6:208:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Fri, 6 Aug 2021 12:32:12 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mBz1H-00EEeK-Ji; Fri, 06 Aug 2021 09:32:11 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a47022c9-3eff-47a2-0309-08d958d6376f X-MS-TrafficTypeDiagnostic: BL0PR12MB5523: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fS/26FeFwFUDhMvwB/Qabo58Ph2TKoSkriRWE4viLxS/7lT7dWfMLi59cBm7SgqrXL2yACuX1wrAlcbiRZoyqCKeUwCN2uNqCIByTJNlKXe9jVH50xdnGVusP2kkk0BZdBfpV5gH2cB0RMcMvfgalZTfvsjU/dklpbf8DQqV70/Gf0mVJ4bdAk/IDIK6AhSWDMIWZAZwYRXvXB4TYrCcjIPn8pFjQqJg3xIZF5v08Bb9dKNFm5kq/K9/tFvQR8QD0+BiJm+rQNOvGlXNwJKaq2AwQ9KFq+Fwlf/Pk/37TKip2n7yGD5VPLccRYZboE4JpG6YuuQNqy4GgdTB7KWHyfH6NPI3XT8J3qw934GnW4ODlCbok06lCkjOuyUqr63NuR6Xpt7ww5KVbqCpCrCioLhqMhSDf8CQYrzotNlgTPlcfo47/Petfr75ga/thbMz9P4UMa2FL/CLthp0iBTKNNXb09/Sx/wBIv/nyrxxelEidsRZy1b3OBdgmk4NtK2cDgu/Qpo4aIvDWxYT7NkWUQEApl9aK4uX7iEMeYiQdgsVt06cSIG8aGuSIqDSXTzHJKSbh/o3666TKwns+aJvCEetKl4R4uZdOXr+jPz80vwfSaQsbiYvy1M3PZljfn/Vqz8zqskOihxEAgHoZMu91g== 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)(376002)(346002)(366004)(39860400002)(396003)(136003)(8676002)(66946007)(66476007)(478600001)(36756003)(66556008)(8936002)(33656002)(316002)(4326008)(54906003)(9786002)(9746002)(1076003)(38100700002)(86362001)(6916009)(7416002)(2616005)(186003)(5660300002)(26005)(2906002)(426003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZoGtCKWDGSeqMtMB9E0TCF3Cjuy+PBjPK3UBXOYtBPT1My5dqmVDSJZD2TFe?= =?us-ascii?Q?HuQabW8keUIHciVPO+CTEW0YjOB51DuW6esffOU4nIVTrD1vUmSyGcBpKUmZ?= =?us-ascii?Q?BHqFRoAFjoHnbN+ho13KqGFmfyhgPjqvEm7cQ98cZ5th5sW024CUhTo+FCkL?= =?us-ascii?Q?XcVrwfl4FCpG97IME8rqZHNnmfMWAVtSbZOoLvgghR1TlK2azna3oqY39S7r?= =?us-ascii?Q?9vvVSAbq9uL4BXzVfKJLHzhNjEZeG0TpuvQPQPYcnByCMldSHw8QbVjze8AC?= =?us-ascii?Q?GN7qlKvQF63cjerIMOiXuIvwisqa4sCFHl1fGkn0h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tke474h26DKuQjfRrFhWExEumERrSq0Kuj6xcAN9?= =?us-ascii?Q?3zeRo25V+0NFXfyIV9+9M8ZbmyuEeHkaeN13488EV57XKTOuyMn6hWyfM69r?= =?us-ascii?Q?kfR++YQGJoUyflLJrRDeo3yH?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a47022c9-3eff-47a2-0309-08d958d6376f X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2021 12:32:12.8462 (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: /ml2Rrj4ELvmAtFBWP/8H65+5m3xSzGMcNTFvQ2UQA+d2STujQiMtDdVE47CypcL X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5523 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 06, 2021 at 02:45:26PM +1000, David Gibson wrote: > Well, that's kind of what I'm doing. PCI currently has the notion of > "default" address space for a RID, but there's no guarantee that other > buses (or even future PCI extensions) will. The idea is that > "endpoint" means exactly the (RID, PASID) or (SID, SSID) or whatever > future variations are on that. This is already happening in this proposal, it is why I insisted that the driver facing API has to be very explicit. That API specifies exactly what the device silicon is doing. However, that is placed at the IOASID level. There is no reason to create endpoint objects that are 1:1 with IOASID objects, eg for PASID. We need to have clear software layers and responsibilities, I think this is where the VFIO container design has fallen behind. The device driver is responsible to delcare what TLPs the device it controls will issue The system layer is responsible to determine how those TLPs can be matched to IO page tables, if at all The IO page table layer is responsible to map the TLPs to physical memory. Each must stay in its box and we should not create objects that smush together, say, the device and system layers because it will only make a mess of the software design. Since the system layer doesn't have any concrete objects in our environment (which is based on devices and IO page tables) it has to exist as metadata attached to the other two objects. Jason