Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2232444rdh; Tue, 26 Sep 2023 17:36:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDo38/0/3ZRaTNQnYDKg7UCFTsu/O67zvV+HJ2grhQ4L4Icfio2h8q4D4QP8pOuxByxFjk X-Received: by 2002:a67:f582:0:b0:452:66a7:1ac with SMTP id i2-20020a67f582000000b0045266a701acmr671932vso.6.1695774990820; Tue, 26 Sep 2023 17:36:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695774990; cv=pass; d=google.com; s=arc-20160816; b=k9uAa/lgl3DJ9nlc19kawK8aO3IpWCCdxscuJxqsZ4LeMvGJQm4BHLviLc7LxKgQNx f15d4fxFrVPBIYFUD73FN33188H3aoAKWCgz8xSgtypIASXk1ypbvsVIjGDN1J3Z8aso C9/G9SELLaFrqSuU17UBAL24g/4XHznioLwDxN4OrBtgyfKBx5yRHx9EUZUGxucva3xw xUl1hpAu0xI9weZmEcoxhy+BNEzPwk8LFdDbMv1uwv+vR9PprnJbEvlD9A9j/pVHssNr ECR3+zDy9JOufEZ/bN17QImNDYDVJm+7s+AsAZncKxUoQBNkLt5e3h7J5WJWf6SVL9EM OZoA== 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=zSm7SlJrPg1mL1tUxO8WpSf35tOqbovoZrphaO39JQ4=; fh=pBD02uvs1V8mSmdyuC0i7/4aBkGuzi5Fqg+K3AfYKbc=; b=citpWs93n/sDgdh9/Gh7l/1XyBtiNloyolx5jk68nHhINMeDVN1r4tEoYnKbk7uoMR aC0qg/N7ouNFfLnwWYM3Y1hxeglmGpfnxhpPPZS/HRmyhrwtSVcYPEKS+mbLbyyXYy35 UZ+jMHNmeVXqM8SL9KlK2PqfD8rHAxUs8Qg6G/QTxF/96rOTNB58u2XuOGXtoHvh8NhK AHAwScKW8yiSe8c/8i//wpDogzH4844RgsnaE+W3h6HDx2FvtPzdzQeKrLTXteOk+jan HVJckONVoXbbAO++7+DjxiJJmP63HepsjvKPzDS75YtTG/1RmHeBU/ZHf//ygJmjV+bZ q88A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=YIPlAA5j; 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.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h185-20020a636cc2000000b005652bd3d3absi13252777pgc.43.2023.09.26.17.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 17:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=YIPlAA5j; 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.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D6A08832C9D0; Tue, 26 Sep 2023 09:29:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235201AbjIZQ3b (ORCPT + 99 others); Tue, 26 Sep 2023 12:29:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjIZQ3a (ORCPT ); Tue, 26 Sep 2023 12:29:30 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2053.outbound.protection.outlook.com [40.107.244.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F2A2B3; Tue, 26 Sep 2023 09:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ch2PmERPkgVFPxO9G9eEJW4NQGqjxYX2vxeAbyd2S7IhyvBYJ0N5eTw+CmzmfWIk3GUfIMYBygbrwL1Jtzks9YhNZxeq4HIFIYsE8F/t35UEuG6e72WHn2f/mtksKTpNomKCq+vfX9ykPCdQlBCpXUjPgNWKO++Afc13xk0xGsV43CS1PLTLIjfir+759aEYsTwejm2W8EM1DYQ589k19A/sa+krHb+fhWRbhYWymbvKEKazW5cr7NjUvMle9RmLmPnflT8dLPLydszqukIeCCJaJQUMCVwmNDd6/TVxC4RZGryjLnx++YjQK+PD239CC66vDrUQSAhFYNMGpPUbfg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zSm7SlJrPg1mL1tUxO8WpSf35tOqbovoZrphaO39JQ4=; b=SVgqCaGGNuNNE4T0cHHJR6EIZ83hwavRBNf7R37RTRWBMfcfYX6Aa3M5I23sOAAQJZoxGLmqWlIbQ3qy7tWdS+3GfOcKGtcdiGNkDFzMAXFo+FtVWd3aWoBy5Uda8bOQufREkzlc56D1w9T2mLVFaQ9PPWcZHeVhgST/Q4t+uwAOKGren3R3BAUvsSTiMxB74byMTr8/opjTjQ6Rbq36A1Q+/yARZ/MBItW8HM7ZWYimebMXpWmGIGOZCDLCECAPB0A9qEDIRCO47mKw7Kz5kbiFm7ty7HRQFpx6r0kPCy3SpzSzzYkTreIkwZpyZGs6xGU++gUq7L5/HYghOMC+Ug== 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=zSm7SlJrPg1mL1tUxO8WpSf35tOqbovoZrphaO39JQ4=; b=YIPlAA5jz794dPezFqGZ29A8Xj16Cj0yoOxFVXA1l4DbT8D2gHzvArLIzVfl85DgqeQzlziUjySVw7AOlihrUHQu9DOG8eblvXElhnVfKAwfln9oQwDslZB3B+3UZuYn5l1tdD60TuZymsGbjrU9OJr2leBV8U+oMGFKejqBpCUVZN67g5VshsvX31ev5uKkU/9oNugN4qh/HiXLCCUdd+OEWE+hiasM68BHswA9r9u6S67a70SH7ISS907oW0MOZvmNOGH29hX5gQfoP9ga3SNCukDmTpRgwVTMPc34u0Vf61XSMwTetwO2vRWwu3n6ssDLx/ZDzJVl3/EgEjafdQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by CH0PR12MB5369.namprd12.prod.outlook.com (2603:10b6:610:d4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23; Tue, 26 Sep 2023 16:29:21 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%5]) with mapi id 15.20.6838.016; Tue, 26 Sep 2023 16:29:21 +0000 Date: Tue, 26 Sep 2023 13:29:20 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Robin Murphy , Baolu Lu , "Liu, Yi L" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "mjrosato@linux.ibm.com" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "peterx@redhat.com" , "jasowang@redhat.com" , "shameerali.kolothum.thodi@huawei.com" , "lulu@redhat.com" , "suravee.suthikulpanit@amd.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" , "Martins, Joao" Subject: Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op Message-ID: <20230926162920.GQ13733@nvidia.com> References: <20230921075138.124099-1-yi.l.liu@intel.com> <20230921075138.124099-2-yi.l.liu@intel.com> <0d37a1b1-e7ef-fa73-d17c-629cd254ae75@linux.intel.com> <20230921164447.GQ13733@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BL1PR13CA0230.namprd13.prod.outlook.com (2603:10b6:208:2bf::25) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|CH0PR12MB5369:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e5e7933-ab80-4249-0d92-08dbbeadbcd0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WRTN9nTps73dgWaJwvR7N7CsG9TGIaSlvWfUl+Lvu3eHrvE4FSX9gD+ODg0tQTiWNR2JHRe5PZgz0yna6ZPTUB/gevhfyKH9TQoeER2iUs7P+/Izl9kCCYPRJNntIxvkyQa/fVkJAcyemt/ozKGayaUKz7SOK3yRUzt4dYtm+z1cloVPNKEExbr2Tzf8BT05pBEBXlTydMB9uodrwwg1eIh44mkvKYUwGVPUewzbXAmOdgio+PWvNgrp4cs7QTVQtKDMUKaD0ERDYmMnGomjHkPV/ma5eOZUt1BdzNXyXjKnjm1VXgWYKfbuIz5r7j6tq6x+uLE0lFLdAfDNMnAdS36YiI6cJT8QgvkafMM28zmiSgHrSLQNQfaCGZEb/J9GHDMLXqsrO8nlD4gaD+/4mDG62ASnJ1kKd47pts5ICXHhX4i8nC7pCt7GhWCiS2Vu6ExJqcxN41ca/XTjPX+gOozqsvjvwylvYR4qIGvdIZXuikHfsRX2BwgEmEqKG76tfQw8gdAbq9JE2seGU/vNgXKnkScosoaK9CpAAgrIgieDy06+8ky/0Nuvxk1BND8O X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(346002)(396003)(376002)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(6506007)(1076003)(26005)(83380400001)(6512007)(33656002)(86362001)(66946007)(2616005)(478600001)(38100700002)(316002)(5660300002)(66476007)(6486002)(4326008)(41300700001)(8676002)(8936002)(66556008)(54906003)(6916009)(36756003)(2906002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jVlEflHhPcVV8eihy8SrU6I0V7NCqVFSEe98VoKrtfMOXzd23oyly1iWQq8H?= =?us-ascii?Q?ept4pxa3uX2wbnCEtsXICDbrPrd10kEI0GArE8z/7w7RxgpxUipoqaDC4nEh?= =?us-ascii?Q?4DhMciPVZiSsCPbnGkB4NLMNC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=?us-ascii?Q?u8j6H2XUoBvVlhjAVTKgEQQKjuEjQYC57RFKr6IrRsvZTB8qUrrf+BPjGIVH?= =?us-ascii?Q?sn5BvWVeWsQP8patnYstzvXoAK+WBwoqWAm6wmDiJXERPeLD4/MRWaqPHuF7?= =?us-ascii?Q?OWfmd1fXDWXW9g/jY2wGPAutG84MV8/af7beYTWwMT5tQOxWLH6AR7fx5EWL?= =?us-ascii?Q?+jMo3s9EdA4qFn8+LrSJNppUcdPquRzHSCC8KB4xTb5nXDIrHgv8oKSjlYDu?= =?us-ascii?Q?iCCUiNP1686F5ZkgI07Yo+DkirNPrZbTdK3ALwoePB0nY5RtcTPcCePpkLkm?= =?us-ascii?Q?pDPmOFHxtI9GfCNccB1D07DyKBAwHrvx3d8wRAB4Ru88V1JtHn6J0qolX1n6?= =?us-ascii?Q?swwRwzxd+9mtwfkg8MRmcVz9zVW+m0M0hSnnsD+KW9ylVf6uWkvTx26+MXH9?= =?us-ascii?Q?0OHEu4ob7A1mlUlcm/tDS6rU7/HHJj2sPjvfwSUNNKrAEdZJhBMfBrG9jU3H?= =?us-ascii?Q?ZMChC1rzFCjMqv0eTp+u5I8LvPBNO+HATroRu8dMiuJwsfZOxpGmRm/GkjMM?= =?us-ascii?Q?hs/lcIOPpFfBZ4JOxwyz+XKkDiHBWq5IJUpMVoaf?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e5e7933-ab80-4249-0d92-08dbbeadbcd0 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 16:29:21.1288 (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: aSiqyPE3midtuK9TwP54pNLYZWdWancUMQiaYwFf9KtBNY0e64vAf2UW4Vbm7QIP X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5369 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 09:29:52 -0700 (PDT) On Tue, Sep 26, 2023 at 06:37:55AM +0000, Tian, Kevin wrote: > > From: Robin Murphy > > Sent: Friday, September 22, 2023 5:48 PM > > > > I could go on enjoying myself, but basically yeah, "default" can't be a > > type in itself (at best it would be a meta-type which could be > > requested, such that it resolves to some real type to actually > > allocate), so a good name should reflect what the type functionally > > *means* to the user. IIUC the important distinction is that it's an > > abstract kernel-owned pagetable for the user to indirectly control via > > the API, rather than one it owns and writes directly (and thus has to be > > in a specific agreed format). > > > > IOMMU_HWPT_TYPE_KERNEL then? > > IOMMU_HWPT_TYPE_GENERIC also doesn't sound a straight word. At the end of the day this enum is the type tag for: struct iommu_hwpt_alloc { __u32 size; __u32 pt_id; __u32 out_hwpt_id; __u32 __reserved; + __u32 hwpt_type; + __u32 data_len; + __aligned_u64 data_uptr; }; That pointer. IOMMU_HWPT_ALLOC_DATA_NONE = 0 IOMMU_HWPT_ALLOC_DATA_INTEL_VTD IOMMU_HWPT_ALLOC_DATA_ARM_SMMUV3 etc? DATA_NONE requires data_len == 0 Jason