Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp207776pxj; Thu, 3 Jun 2021 04:54:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzKlpa73158Yj7YmVF0lVV+NvFim7wQfeEfHCnEreIfc66pwo/FzziTrb32NPkPog0hpn1 X-Received: by 2002:a17:906:27d6:: with SMTP id k22mr35917429ejc.323.1622721245623; Thu, 03 Jun 2021 04:54:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622721245; cv=pass; d=google.com; s=arc-20160816; b=SrU18LP5PI3Xm819yt3tWhlgDbvmUVH6gkvbVeE9dI9Kp2iI6D9VbXrl4S7288PdZM //+Ulufbo9I0cBCJD2kfUkJy+QqKXKnrujui53szdTKV5Qw98perBWDzWZUDD7mwS0jw 9OTQthftXAXR+IJJSlU/sf016WANHKu2pGDrtIJwXsI3DAJ4B3OsrdeX6/PZ+cihPYwa s9BqmvVUQ7BmbB+uU1usBRFfG5s3qMSUT6RsXr+jEfoCrnYM9ZSw6hAeKlSQB3kV/BYy U2XB8SA1nSG/Q/PUJoMhEB7X/dsoFF5kMrwtPspuizOOPE+7Ov6dy/AzqvpfUT69MfLC U6Yw== 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=zfdo1JI8lwggwQ/aQjleEx2IvU2adaBBNvh7RvjON0I=; b=DLYJObzM6tH/W+lGHpA/1a/a4Ao+jR4YAR5RWH019vA/7b6+pHxgFXvm57DL869UJc S4QcDQlgdtHeBCy6lAF0vFafHXjcRnGwoJhmx7RkF9p9fKQYMdEopF3etSh93PVhrCbZ S2cWTGd4RAdw/vPO5bDCkp925ZedEHRBgaXEmfekKj3uCK9X/dPJaAnl5CDaESAEPOYK LItyd2YQp04dsjRCmRnSFiC3uuJafezKHaQzal1/SKPrTNI4gNgsw+56arxrpfUPKWHr 5TVJaQ2YIfX+z52ho0yEuObAGZEEDtpD7oAbbRyoiFNT8TLl3A9x2PCUaOCLVPFS6Fez /ZKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="dB/YWf4/"; 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 m5si2036619edr.557.2021.06.03.04.53.43; Thu, 03 Jun 2021 04:54:05 -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="dB/YWf4/"; 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 S229817AbhFCLyM (ORCPT + 99 others); Thu, 3 Jun 2021 07:54:12 -0400 Received: from mail-bn1nam07on2073.outbound.protection.outlook.com ([40.107.212.73]:15841 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229629AbhFCLyL (ORCPT ); Thu, 3 Jun 2021 07:54:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lTZqBvyII4z9L8EWPzXXvSp6d5UnIEt+8QbgF5PvtuQ2UjHleiQEO1z8k2bYPRyYR/xoYkHyeafCHcC1PQ9RelnQ3Jw4hvsoA0BW9ppXDaTnpqbxhv5c+J2lFCf6oB8lM1dysdXdKdhQtzNZymqDZIY5Y2LDqSWy4uXZCN1K9r26XY1m1DBe3E0fDpPKDppjLhNj2QfXVpVJSS0uNuTuaBNrmSjT1pSDYRZkRYyoS6hsGDGMncX1RQlBkRyXMXe1+vtK2c5cQBYNaA6VsK98qnap2jVfRwRXzusuZZti0B7Zfmwe2/Sf55+eH2u6MAb5aCXBllHZoOtASr/70bsypA== 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=zfdo1JI8lwggwQ/aQjleEx2IvU2adaBBNvh7RvjON0I=; b=V6ePCxbmZKPdjksyIxn7NBMC7t8UnnVSXbf26Kzvzl+kqDrlvG4U3VAC0VhRdYdP7/XY66UxB4LwGTpVgbZ2zQDrglDVi8VWnKkJnCdPyRdgakHh1wRm7aEFAJ932xHoGG3G1MP4x6R0ofCb7yDp4+c9YDBe/LWb+3yS5nr4wft66/fY1wsTdrLeQ9vJAz+g0aW2PwoS3D4VXycTvmWex0+7VnGtIlv4O8rvSoO7pDBntx1N/2xj2cxXBdxMdwH3VwwfrpRcFEDyvCNz4p5b4B6V9Qh1FvuDKDiUKZDaYCpltGrNYgsPaIjp9mLdkGDYjhPn878BgbbMpzTD4aiBBg== 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=zfdo1JI8lwggwQ/aQjleEx2IvU2adaBBNvh7RvjON0I=; b=dB/YWf4/Du/d0eZzqer3B8UeC1CHoINDv6XR4ceqkRttboSDpiYuNZHWQzXbGwGe46K8S+u1Y2T3D6naqF4XuvCU33A2omKFdBJdA/rzI+C5+ntdYqLJWlE/KPK4TZPT0QQ0R2o76TSMn9giMIBr61Mu4QEUCXuASgK4UDaRUirnNsxvAZvTukzJhoJcv2RkuLI2zuqqM3JoXWobsf5gKFMm3Ljv2MyI/THev1Zj6Zrk1es4h5eeoMihtodf0QpGNpdioHFuzGxoB1k0cTbL4Slq8nqpGcuTphrO8Q67bq1B5GGupIs54ZINgw74B0PgsnsVR4xWJsj6WbeqNPI4XQ== 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 BL1PR12MB5363.namprd12.prod.outlook.com (2603:10b6:208:317::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20; Thu, 3 Jun 2021 11:52:26 +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.024; Thu, 3 Jun 2021 11:52:25 +0000 Date: Thu, 3 Jun 2021 08:52:24 -0300 From: Jason Gunthorpe To: David Gibson Cc: "Tian, Kevin" , 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 , Kirti Wankhede , Robin Murphy Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210603115224.GQ1002214@nvidia.com> References: <20210528173538.GA3816344@nvidia.com> <20210602161648.GY1002214@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: BLAPR03CA0090.namprd03.prod.outlook.com (2603:10b6:208:329::35) 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 BLAPR03CA0090.namprd03.prod.outlook.com (2603:10b6:208:329::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.21 via Frontend Transport; Thu, 3 Jun 2021 11:52:25 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1loltg-00145Z-Kf; Thu, 03 Jun 2021 08:52:24 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15159c70-1470-4a5c-4e24-08d926860e2e X-MS-TrafficTypeDiagnostic: BL1PR12MB5363: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XodmQEzUirKZAUXr2IvKHEHBFwea2eKxMRz3/Ml0GKZ0vcuvthcNc8X5R/nufNq5RGDLJs33ZymznHPJNM4BE0oQeKW0IzMogJ4YpjI/RVY2YoDecbhfN1bJgxozwTal2KxqyU133eWdxClybS6aTLqwB3/NV3ANlsT1j2KnNNbgQI4DLVStAqh0/3FxCm9GX4earfsognbF1LOT+/oshfM6wMWBJy/KBcZnNW521VWxQajMt0hijfDto3OE+na0B+IMEU27b+ckBBFsSyOtTuMzcPZyBtTPoc0/Wodo2RTTA4qV77kCybamMABK+4uh51ZP0ZR7NOvPaZ5hRGhfAJ6PTP4km/GqjgC8/S7ccSNQaTx2KYMe/PzncxIK0fSnGh1mx2xMKdbRbvyj3OU/JfClH4yPbjondQK6xc+j23kdB2Gpl0KX0Zd/zRhSUUe2GkWr6melMvw4rok89EZlNDa6nFlQ/ydXoMpNn9Wsrn6cdQKqTcU0waz+8nWz9d4pcBKGEqZqQkXMjble+sSNYjl+ECs6+chZ8RD57YqZfu3H1fbLt7+OoLmPCKVhsT+K2UZnD7k1Gn2zyDt3HEYRWlF7wkiCGsVF8NYUtsisTgU= 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)(136003)(396003)(376002)(366004)(39860400002)(346002)(9746002)(8676002)(8936002)(9786002)(66476007)(36756003)(2616005)(66946007)(426003)(6916009)(86362001)(83380400001)(5660300002)(66556008)(478600001)(4326008)(1076003)(2906002)(38100700002)(33656002)(186003)(26005)(7416002)(316002)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?XjNCsi3LGcJSh1Qs2Amz//HMjoIxnaodrzJFYYpegWoP6CigFDBy5mg0TaIv?= =?us-ascii?Q?zlfh3Iwszf86vwxqeDfXOPJUfxhNCAPVhMVxCKcxCH9tvClVSg9kEtplAGVL?= =?us-ascii?Q?YhjTulKEpsej9RdaefE213i6+VkRrmqPAhc3vkAyyy6qbjKjFMP91W0+7B5H?= =?us-ascii?Q?Y0YCm9f8K2wVcBBjOKcOXwMsoCAr3sgqm0yAB6O9dgllnnhyJtMydIKQL+DJ?= =?us-ascii?Q?fTHXHM9Y9X0/mJz41lwqJ8wBjRHMhM/AyHdsFBe2xqpk7ooM/CDc45NxrNya?= =?us-ascii?Q?Y3MFhhlDgtEs9XIxdUUu5g1p+nQXJzsMSB57LLo/LflVfYZiCmLlLLst/IGR?= =?us-ascii?Q?hIUbw6QpB5aUPRs8I0AkKEOupZUad4l+VS9kFRmYOToagpwH9Vqh5/EyPgY7?= =?us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YZxhoPNUccca4MJV+Ve?= =?us-ascii?Q?ISW0rVukVyZMpZkN+0B1a6G+?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15159c70-1470-4a5c-4e24-08d926860e2e X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2021 11:52:25.6597 (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: LNQ0cdhvW9NK3CeF/1pA+vxue41gOzI2Rq8C6unKJNQ8KChvd7LjaunneL9j466z X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5363 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 03:13:44PM +1000, David Gibson wrote: > > We can still consider it a single "address space" from the IOMMU > > perspective. What has happened is that the address table is not just a > > 64 bit IOVA, but an extended ~80 bit IOVA formed by "PASID, IOVA". > > True. This does complexify how we represent what IOVA ranges are > valid, though. I'll bet you most implementations don't actually > implement a full 64-bit IOVA, which means we effectively have a large > number of windows from (0..max IOVA) for each valid pasid. This adds > another reason I don't think my concept of IOVA windows is just a > power specific thing. Yes Things rapidly get into weird hardware specific stuff though, the request will be for things like: "ARM PASID&IO page table format from SMMU IP block vXX" Which may have a bunch of (possibly very weird!) format specific data to describe and/or configure it. The uAPI needs to be suitably general here. :( > > If we are already going in the direction of having the IOASID specify > > the page table format and other details, specifying that the page > > tabnle format is the 80 bit "PASID, IOVA" format is a fairly small > > step. > > Well, rather I think userspace needs to request what page table format > it wants and the kernel tells it whether it can oblige or not. Yes, this is what I ment. Jason