Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1668295rdh; Mon, 25 Sep 2023 22:52:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEob4LJ5+ySx6cU7T95xNAbG9F8CVNFgm47izr4hYKngbAHQmxOcf/shTWxFswHVYg3EkMa X-Received: by 2002:a05:6808:907:b0:3a7:f650:af9b with SMTP id w7-20020a056808090700b003a7f650af9bmr9729246oih.55.1695707570725; Mon, 25 Sep 2023 22:52:50 -0700 (PDT) Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 141-20020a630193000000b005775161c510si11920714pgb.504.2023.09.25.22.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 22:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lFgmE3H6; arc=fail (DNS record missing); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 76A1980D8FFD; Mon, 25 Sep 2023 22:51:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233624AbjIZFvB (ORCPT + 99 others); Tue, 26 Sep 2023 01:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbjIZFut (ORCPT ); Tue, 26 Sep 2023 01:50:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 470A3F3; Mon, 25 Sep 2023 22:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695707438; x=1727243438; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=/f/baeBZnpWHFvf3SVlGYtunEgrXyNYeWpFEQgMheM8=; b=lFgmE3H657ixEn0gtsbNNwBwUOIWNaLO8tLTlwRGn6wV9s6zi+3v1NlB LRtJJfmAwOfAJ7MEePNmr3vfCGpkBdcnqphnRbATQJKcP1sAXVNdVspv5 pIIstTd0ZOwnF8ibnDPERvU/xbZahnB0+1T/4jS+Ta8zVywDSQg83q+LJ 5svAIZmHM9WCyMEA68ZLMVN7WG9NO6q+jQbxQlsdltoxoVYAna9f4y71V 1dvKp3wYFPgSNlVEuNbvqdPgzxlPvjw+fgODg3rGBkG6ThZoMHIZKvg47 h1myG4pGEuhibFaKnF/tHPAGvCFu2XTVXqKkG9vQB6a25hLIgyLo7juCY w==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="360869635" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="360869635" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 22:50:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="698339547" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="698339547" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Sep 2023 22:50:37 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 25 Sep 2023 22:50:37 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Mon, 25 Sep 2023 22:50:36 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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; Mon, 25 Sep 2023 22:50:36 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Mon, 25 Sep 2023 22:50:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7/UViNJlx92Af+5k8my0M/eCJhdGoZ7vcGvqjPBVpWE0JATi55pboSHvTf4heHZqk4gv7vxFa7xY/wWEqFNLKeL00FuTRCD6xM4ktQk9zkquteExLFavod9q4GWgYYJcJdYZquIFfFEyo/aM2IP9ke0wz82i0UKYjmR6LjJ5boSym9lsg1vkx+jlHzpwmqH0sLcgXSSdPVgtuvPxRIlhNheWQKu8i3ZGSi21DsVRx4FMnC8PNhf9BPKqlmMtg4hKAFlbZ4vXXM85YPKsiaANnkhk/nCxH8cMfsrzxfHS3qEI2pd0cNj/zGe6/paJGvix2+mIrPcKWeoD6nNOGbGRw== 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=OIDOFn5YY4b//CgBlP/8L4Tn2vgaotRNl0pGzAdRa5w=; b=P1BqhZkXtlgb2prwq/J9EY3SRyrmMbx3tjRpE/WexR2+7eB10Q/P10Hi9X6Z7A39ADTIhmqHb6WiCrAJVy036GHW9mDFrVpENkyWNMcJ2oPPFQVgQJeoB/9ihEk3Z6FqnB5rdAAgK6xzYXGwN0f7qssS+wd1U0K6BqP7hohZ4GQZmKEh8/fFtxO/rSSa8z9DGv3FHGe+OL4aZm7KmROEsKgbqpQQ4CKR8uVWrcODyRbGKlaYZdfObr8r9wndDTyF0M+8KA74INasmKgN5iMQdl2f1oTpxZEkRIXgvyYr+nDf0Te1h4eb4ewZMefoi2zQS47jag8QPsI1mUcjSj7+FA== 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 PH7PR11MB8012.namprd11.prod.outlook.com (2603:10b6:510:24b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 26 Sep 2023 05:50:32 +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; Tue, 26 Sep 2023 05:50:32 +0000 Message-ID: <72d6854a-719f-e941-8b56-eda4e3027c66@intel.com> Date: Tue, 26 Sep 2023 13:52:46 +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 1/6] iommu: Add new iommu op to create domains owned by userspace Content-Language: en-US To: "Tian, Kevin" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jgg@nvidia.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" CC: "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: <20230919092523.39286-1-yi.l.liu@intel.com> <20230919092523.39286-2-yi.l.liu@intel.com> From: Yi Liu In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR04CA0212.apcprd04.prod.outlook.com (2603:1096:4:187::8) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|PH7PR11MB8012:EE_ X-MS-Office365-Filtering-Correlation-Id: bf9737a0-021c-4c44-f377-08dbbe547ee2 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: mPIFL+nJGW27425gulNXyzPBFVZnBqZHr9QS1QgFbEjUF6G/kUmA2a7RIvG+iKwgxnfgwfxIabiuWmyeYUbIkB1UgN1RjCVomT8tfg9NZCkb6Y1iL4T9HpBDeJXL2war0e+s/D62zl7BUP6g1gr/iw7qXnJF9ZbxW3qk3vBC0SSarPbVl+78lfQXZEfwZKkrONd00fyVW/APsjekDd7yphh4mjvknkl4c1hF/E4n145pIMpwdVFM4mD7rp5RAemmlgaAOF50UyEfFyaNw6X7LFzmOI9A8YGFhWLV+UNh9CrGy+r4z9BVtjPUfv6Rj/YHt/fcKoNeYqd9OcfPo6yWw1TMJ+3xHEcgWKQVWpSlcF/EROO9bc/aIKLSudAlteo64cBT3xlYPcY6CemSFEsH9uq2Vz6g/rfUPIrB29i64DdWpr+aS/0+Qo+tsrT324piXgRC9cTgbvLg4nRWhAB2h01Ys3quEMHghm18fLcacRPbGbaaODFrwdXc6R7dxSkVhray+BmTRQncTZczOlXBM17wtMQcG2unanDZf5iVG+cklyI9vEwA+7/9EezaUSkdxwFmv8RB48a6mxbHm2eNsWyPErZydNmnvIOli59H0AE85S2I3w3IHh0MKOjZFdLcu7345kmZQYp2V+9JyJPh1Q== 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)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(186009)(451199024)(1800799009)(83380400001)(26005)(2616005)(86362001)(82960400001)(31696002)(38100700002)(6486002)(36756003)(8936002)(4326008)(8676002)(2906002)(66946007)(54906003)(66476007)(66556008)(478600001)(316002)(7416002)(31686004)(41300700001)(5660300002)(6512007)(110136005)(6506007)(6666004)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V1pQdGJUTW1KMk1xc2JZWDI2V1VITFZ3SmdaQnBHZFpvWEtja2JmRFQ5RHc3?= =?utf-8?B?dmhqL0grY3MzTERDNHdtK0hLNmUzalVLazZKSXdhMjhqMzJTOXNGd2ZGYTU2?= =?utf-8?B?bzliWklUMUhEaUcxQ1ovMlZ5T2lodWNRcjhzVHNTQnZKbFBYbkNHS0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GRubjV2NkdNT1ZBZWdSTEhYZlBmTENwdkJM?= =?utf-8?B?MGVtZy84N3gxaWoxQVZIak05eVVMemJaSnFtV05KYkFPM0FOOVMyazRPUjUw?= =?utf-8?B?TFptZkdRUThzL0RtN0Z1Y01TUElJbjRXbHM5MDlXRlU4aE40Z0RXbnR1TXdW?= =?utf-8?Q?oNPl7lZKjORUtU/eiPJ9uAwUf?= X-MS-Exchange-CrossTenant-Network-Message-Id: bf9737a0-021c-4c44-f377-08dbbe547ee2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 05:50:32.1694 (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: vh/prv1h+gNMFbLr+neg+j04EQsEaFiMQ9wsRVn7WRR5pcd2wwEDYHkb1nlPzGs1qdRBgwy/Dn1NArtTcmE3tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8012 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 22:51:01 -0700 (PDT) On 2023/9/26 13:28, Tian, Kevin wrote: >> From: Liu, Yi L >> Sent: Tuesday, September 19, 2023 5:25 PM >> >> @@ -235,6 +235,13 @@ struct iommu_iotlb_gather { >> * use. The information type is one of enum iommu_hw_info_type >> defined >> * in include/uapi/linux/iommufd.h. >> * @domain_alloc: allocate iommu domain > > Given now we have two @alloc ops it'd be clearer to also update the > comment here so the explanation for @domain_alloc_user() is easier > to be understood, e.g.: > > @domain_alloc: allocate and return an iommu domain if success. Otherwise > NULL is returned. The domain is not fully initialized until > the caller iommu_domain_alloc() returns. > >> + * @domain_alloc_user: Allocate an iommu domain corresponding to the >> input >> + * parameters like flags defined as enum >> iommufd_ioas_map_flags >> + * in include/uapi/linux/iommufd.h. Different from the > > "to the input parameters as defined in include/uapi/linux/iommufd.h". > >> + * domain_alloc op, it requires iommu driver to fully >> + * initialize a new domain including the generic iommu_domain > > "Unlike @domain_alloc, it is called only by iommufd and must fully initialize > the new domain before return". > > *domain* here already refers to the generic iommu_domain struct. > above comment well received. -- Regards, Yi Liu