Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp872080rdb; Sat, 7 Oct 2023 02:40:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHny7cBJvuyRkemGyeIAEoi6jt2+c2zeTObVJNyXGF4ZQf3sxeiuAXy3swRrQ7Eh3KPzUr X-Received: by 2002:a05:6870:a448:b0:1c8:baa5:a50f with SMTP id n8-20020a056870a44800b001c8baa5a50fmr12037532oal.27.1696671624283; Sat, 07 Oct 2023 02:40:24 -0700 (PDT) Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l128-20020a633e86000000b00578b487825asi5603891pga.208.2023.10.07.02.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 02:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XfAzzzYo; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4F7E8819D9F6; Sat, 7 Oct 2023 02:40:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343706AbjJGJkI (ORCPT + 99 others); Sat, 7 Oct 2023 05:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233085AbjJGJkG (ORCPT ); Sat, 7 Oct 2023 05:40:06 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1A3B9; Sat, 7 Oct 2023 02:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696671605; x=1728207605; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=Fe1kKrqXO4SlXascv1mxo9WqF7ASNwiBR97YZdX28wA=; b=XfAzzzYo+pxYetJ+w901oi4lDAUgRf2rriESMFnF8m6To+5NQVBoJxg0 /TD1GawRXhqinxhx2Db7qeILa+GTbgi3sCdhSumR2PJxrCFZtghfdbSAD jl7QDvU/FHTxDUPcPFhsnZ4pfyCGdHsxIQvL77nGR8FW5WcmWDHhXO6jv VgKu+KdoM/hInGWebtYePib15iPCyO3tfX4dUNSdctXgcbxegpwDTLGVN N5oot/GkbbdQD98DeUIukj1p03P684bRwbr7guvzyXssnC9Gg8IxVBEwR hz4xM7aZNvYCXM6s4Fuc/A2n5elkhJnou9pkqvTLpwKou2VQsaWZe3MJZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="2515754" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="2515754" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 02:40:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="999646492" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="999646492" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Oct 2023 02:36:04 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sat, 7 Oct 2023 02:36:04 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sat, 7 Oct 2023 02:36:03 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sat, 7 Oct 2023 02:36:03 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Sat, 7 Oct 2023 02:36:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WomOBMLgKHPxSZjmpW83rGDa/UWGUCv4NU8/pCYL82Swi0nQbc/9wIAuLUM9v9g3fQCG0Gc73+z40BplbeQOn9y26Lp7pgLdELOKrIiHw9Eg3/raC6qNyfz15S1Ir0BRFwf1W+HfWN8c56xSZKnV85mlxYhdgfz9vDbmm4BQxAP5D3O9jbyoik6TiiK/6Fr+5TsQIrCZzX++28Ubrm/tkoiI62Mg00N6GiLzmpg6PQgb+hU2Lva8sKek3se7B598ToPMsFPCHPjghsbNvusLSuHzsFhgtCFSy1FHCB26vx190MugPwcl9SQFm/K+KcQasKJhxdgJnyNEz/tJjrJbBQ== 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=LcvWP8T+vHnATj/Z5DQX2oTmYJfbbtoXQOOLZ24Pn/k=; b=cAG8/+SCHXxZzazs1TGBAXu3ydpeyeLx4dCjYDWJqTMyk3YSpOcZEA5PRY0kjTOHLaWfhd+laNYnQuwzDQ+u4k5u2OZ9UdyczEMNxCFYP+UYTB4Dl/sNaAImB6052GRYheSyEpM1bSg1afF4OnPJ7PsBF3UD/tblWTePJH8O3FnRS1kKG6w1vLfcByIbHBWay05zYRAwJaAn5bOWmtGTxCeGN0zIsi1zmPDb2EaF6yVdnApA9zvC+MmeUxY2yGZxw2KRrMWAILdYkvDb6frdzsyKhoBxTkeIjus3dUSZaJvHCG/GXI/iV1YwUhEQFmzJAg6D/qdHIXBx08tMc5Y5Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) by CY5PR11MB6536.namprd11.prod.outlook.com (2603:10b6:930:40::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.42; Sat, 7 Oct 2023 09:36:01 +0000 Received: from DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::f8f4:bed2:b2f8:cb6b]) by DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::f8f4:bed2:b2f8:cb6b%3]) with mapi id 15.20.6813.027; Sat, 7 Oct 2023 09:36:01 +0000 Message-ID: <05dec0b1-61ac-c3af-e238-322c1eec57ec@intel.com> Date: Sat, 7 Oct 2023 17:38:17 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Subject: Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op Content-Language: en-US To: "Tian, Kevin" , Jason Gunthorpe CC: Robin Murphy , Baolu Lu , "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" 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> <20230926162920.GQ13733@nvidia.com> From: Yi Liu In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:194::22) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|CY5PR11MB6536:EE_ X-MS-Office365-Filtering-Correlation-Id: a0f5d95b-d5a6-4663-6da7-08dbc718d0cc X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wLjjYnywlmLzMq+uqD35BROhB8Ywku8o4leFoeej26aOVjSIBnwZ/xSEMJ+bhMp0nZqb6iHkkWt9aY5mae2cWv87zFc4PVOhxKm3N5EHz3rYQv6q8eKHnAn8gm0yns0Gv5bMYHr2Yfa5oYIJPQSpX0idLfmxJcJVpGSTp6jIlzeSvmFnxC2DI1GgrKgcNKHOA6ENYz11B8v0fWlkcM+fgTizrm/W2y0QMs7Td3jg8z6cckHEVoku8Of/GRqY8n9v3vLl207nryEXXGs8doS/X5iz3lK8F/kK8Jf5etJeYczQxr29bfptFgQpPjqpL2swgWX86t0FqGvq8T/CovTWFxlOgCdLDO9u4B/rmdx5i4050KbntiisbP0rjTOqrIolK7f5U4pm6TWOERA7+3G2YQrPu7PaNThd6GGq2OVQo0/Mvg6q9FBhsS9MRgf7JamARt1COwo1VVyPIAniTwcFfnXroDygl9t5Waz66yM02uzBru4IwCtDS2XpwsFDoT+a0OHjKwPqwZFxKSZMRQE9biamKyqm7vbsW2p+azMLzXo832Qr1z8EehW/8SosA33vI1y0mIVT7ZMVQ2lhCwH7TEI3xID+NVJwVoIu7GQ+dAaQZRDBbWeTzsFs56uEfyzrW5Q2bhLabbiicxFVcoyU3A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7529.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(346002)(39860400002)(376002)(396003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(6666004)(53546011)(4326008)(5660300002)(8936002)(8676002)(7416002)(66946007)(110136005)(54906003)(41300700001)(66556008)(66476007)(478600001)(31686004)(316002)(2906002)(6512007)(6486002)(6506007)(83380400001)(26005)(2616005)(36756003)(86362001)(31696002)(38100700002)(82960400001)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eFBHNG1DZWZjMHM5cGxtTnRod0dzaFJwTlk2bWdnVldsVnFaQ3JFekhtM05v?= =?utf-8?B?U0NBcEplOUtGZGpmdW5SZG54M2trZU8xdmsvVUpkbUdqVFJqeXl6ay9heXRQ?= =?ut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ZkRQMlpIelcvWmlpS0N1RmpG?= =?utf-8?B?Z2FUN014MlpiL2tVU09TT0UxKzMvSjd2WHdQY3ZOblpSTmRrcFNrd1RIeEZF?= =?utf-8?B?T1kyeVNwNGgwYWliNWx6MThGN21KVHhsMzBlQzhDYytraHdobi8zalNxWkFt?= =?utf-8?B?QnJicjJTU29aaWNBM0lESmpxSmpyek5VQ3Vmc2QwVHJMalZmbnhkcWhSSk04?= =?utf-8?Q?qQuw4XKjGuoGOlkuiS3gy0SfP?= X-MS-Exchange-CrossTenant-Network-Message-Id: a0f5d95b-d5a6-4663-6da7-08dbc718d0cc X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 09:36:00.5330 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oWhsyxDVmbH+H9GiPNeYD/7y0Goqn6BZfVLnvIm0yLfNRSPJgVsF8ev4A0Cs4KTd4pjlRUoei5HXIv2H2s+efQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6536 X-OriginatorOrg: intel.com X-Spam-Status: No, score=2.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Sat, 07 Oct 2023 02:40:21 -0700 (PDT) X-Spam-Level: ** On 2023/9/27 09:08, Tian, Kevin wrote: >> From: Jason Gunthorpe >> Sent: Wednesday, September 27, 2023 12:29 AM >> >> 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 >> > > Looks good. Probably hwpt_type can be also renamed to data_type > to better match this interpretation. ack. -- Regards, Yi Liu