Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3260622rdg; Tue, 17 Oct 2023 09:05:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6J0reXSfr7Ik3/g2RqgAEN8Cw9TlZ14EH81owoXwwJq5IWRhRLtgHFcWwaw2PpGmhh0MP X-Received: by 2002:a05:6a21:71ca:b0:16b:8b16:bfad with SMTP id ay10-20020a056a2171ca00b0016b8b16bfadmr2700135pzc.32.1697558732400; Tue, 17 Oct 2023 09:05:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697558732; cv=pass; d=google.com; s=arc-20160816; b=l6yiBF7XcOTs0PGTiBGFdVMxOZiZpmYf1f/t3vYtSA1B4w95zY9KLJRcZY0Xi+jrdN XQ0BD0l6czq3Jo0tjQMT4BXTNfGSsVkzsjRIBv9CHS9VNjr+L0HKuH6HZAvhAC5hi4ZT t2LJil9FZn+qNPefn8axqp5+F7NzW9LREmrxuaH8jVsDNXYNTPSJwykCiVa8FZNSHLMt BltC5OMOKx4ITQjDYa7ruPoO6M1o+45X6scYrlTrSTQz+n3OBV88GpuocX2CXoPHzBVY Ltyrps0hfRlArhqyBzbnzkMqyxVKmrEqRp+PmTa+9DS96ZZq8N/O4hqD+oDScxUhWqqT bcnA== 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=Q+MxW805I6s+rvqMchVDFnwcNZSQ3TJML2JfQ0eeaU4=; fh=dxBsd+AO9o8ZyC4g8ZHMLrGprnL0MWNn6TqDJvUq4+8=; b=UC1A/ukgWJStOR0+sUA8XfuuCVF9r2IvcFBgh/ixtkgnqjFhR3GkYemODAO8xwJqBx Y3WPVIcxIKzyrP717JgtKX+nGg+WuaVYM7l7qpzQNCETC/FPuQIxTPeGPu5IXv4tqFCP lq2s3QD4/3uYOY6vKpTzqBwsrFrcu9yRtlRzosY4zPrxFMM81gICxAD4cfItVdODT67T 57yDcwqU9qZ8dD8/gRaTZ8z2pVgqhjAQ/DAzdxq6mSPVhBLRcE+HGLcNMFH3c60jLlW9 wibIpHaOcqvhuIXUciyrtvz+8Efusvd7nKhV5eroM4mQFbC8GMR6WdOC0gs+rWmKc+LR aFEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=fPgo7BpS; 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 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i191-20020a6387c8000000b005859b2d8d7asi89174pge.4.2023.10.17.09.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 09:05:32 -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=@Nvidia.com header.s=selector2 header.b=fPgo7BpS; 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 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id CD2EA803207A; Tue, 17 Oct 2023 09:05:21 -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 S1344080AbjJQQFI (ORCPT + 99 others); Tue, 17 Oct 2023 12:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343611AbjJQQFH (ORCPT ); Tue, 17 Oct 2023 12:05:07 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925B3ED; Tue, 17 Oct 2023 09:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AHYtw9HaEVVmSt2T4Agkg527SJtg8x4NbRuXBBvFjAkvfjA8TgQtOf0r/HSsBFFk/csv462preCAi8w3oY8xAnK8kTJ4McnEjMAkAdwVUzZJomo9v02h3qg83dw3bGznYaKADw39aAK3Aulr/I7VtDMtmb/nawrem3Xx5cQcOHaW47igrO+Cq8Ou4qJdxmq99KX5O4ypF60nrsuTX03D8/p9ujlQyD55hEWBj+x7j0s15Hm91vS7Q8ofmqTmpD04nCF4nPbm7/30fHnaqwuORX5jjcB70lFZYJ4ZsRW8Jr+LbOp0pnAfmrInCRhVvKXNMzgwsr0wgSbnktoeVmLQMA== 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=Q+MxW805I6s+rvqMchVDFnwcNZSQ3TJML2JfQ0eeaU4=; b=W0R44K5JiuuM1y7iyrL+xh9vFqvONZuvStNkiwkEfXWFtYEJsjgCHy4uUA7RJi5hH7M9IEBgpGErEIn+jpIdCAVsYbRFdKxOBSQTzN3hNv6+UaeAWsnxapUcwxncPfx9b4B+bI9Zszvort7rElgrAF+U5OZTWry0h5iQxAz4DBT8USq7O+9r+U8DGhcC3sVym+UxN2pf1qz9JuiYSoEQJitGSJwjKxz4cVMX8/FLWNRxtt+kz++zPfqNtP4lF2Vh8XZvS91kD5M6EqTfpVz+LkQqgdPkhqFzHHSeYKTAxdh1zkZ3LxRjFRNWpnkiQtwq9npQdwkzs+nylydRGL5HOw== 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=Q+MxW805I6s+rvqMchVDFnwcNZSQ3TJML2JfQ0eeaU4=; b=fPgo7BpSlW1Rfq0pIvzMA58ysAAkljWFMh5qb4j8CfB8PdegalVFBNrtBSkZ1HOTjUXJDEHLgpMgfXd0ABbid2kutxXKuotOglSve8ymA7okElFGqxUPyvG0dAyFXVidX0QNhMcU6zsHwZPqi+w7r8dyBBsuNa4rarbnyrcvJLjINcrR5Soy6xa04ZWqK2XM+NP3sG1UJ4PptSkNAKwN4TgDNv8+nZUGsoXn8Oh6byBTQ1j6gqZR90FTNiHRPJgKXVde9VtRRuT+6JfTKI+QVmX24K5haUBX7JW5VoY2rPI5l0wDzT9qZLi6AIS3cIUpHxJZfLlDDWfkjjvMg3jDVg== 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 CH2PR12MB4905.namprd12.prod.outlook.com (2603:10b6:610:64::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct 2023 16:05:03 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6886.034; Tue, 17 Oct 2023 16:05:03 +0000 Date: Tue, 17 Oct 2023 13:05:02 -0300 From: Jason Gunthorpe To: Nicolin Chen Cc: Yi Liu , "joro@8bytes.org" , "alex.williamson@redhat.com" , "kevin.tian@intel.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" , "cohuck@redhat.com" , "eric.auger@redhat.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" , "zhenzhong.duan@intel.com" , "joao.m.martins@oracle.com" Subject: Re: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace Message-ID: <20231017160502.GJ3952@nvidia.com> References: <20230928071528.26258-1-yi.l.liu@intel.com> <20230928071528.26258-2-yi.l.liu@intel.com> <20231016120454.GS3952@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BLAPR03CA0056.namprd03.prod.outlook.com (2603:10b6:208:32d::31) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|CH2PR12MB4905:EE_ X-MS-Office365-Filtering-Correlation-Id: 260b86d6-05b3-482b-3b24-08dbcf2ad287 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hw9kZOpJrLcGAgOi3053mvofq91tqzRgmWbKsjXF17yh8LJPwCCkDaLFN/7iaL66ejgaOVfgecG2SxPwoRCoNwJ0TPZGAYQqlUocUyy8y9Rkc1VVbq8cX37rG52sTFAYPrS7NjF9qs7Th2MVpsd9WlWmQxK+GR9O6aBG3BNUSfRhjdr9xzh0CZjfnpP4Ev+0V8KlqAF/zHEX1uIXn31inAw3+k94gXBPdJT5pk3b6RJmQ1Ar/s3fNnwLe0GbbwCxNRFeyllwsYcOofHjuKqXQ4aDe+h1tYg0frpp3JEOg7f0W/a3nmGDXnm2NkSGxCcR2ROz4wXGetjHcpDlAPIN4efPOqDDs99MBOgExQTQV6rIj+h3vkukqt8rImcRbNPmRbV5qSWRkBYxqiTPJfL/Ts3jRjh235tS4hQWEcR3l2U8kHKQOYGI4BQm3eMxSCAElCrkHGGr5TX0jVFdUNLF7cx1XRHW1XTScLCaUgjTmfK27qWwMd5u0QeICCaN1wJGMWDyKk3mGn7Ng3plC9uaIP8CDMvdIbmi3sZ2gpM5IVx21Sy4u+3v6tM4IULtAHuC 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)(39860400002)(346002)(376002)(136003)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6486002)(478600001)(6506007)(6512007)(36756003)(33656002)(86362001)(1076003)(38100700002)(26005)(83380400001)(2616005)(316002)(5660300002)(54906003)(37006003)(66476007)(6636002)(66946007)(41300700001)(66556008)(8936002)(8676002)(6862004)(4326008)(2906002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NJEdPFrYxr8OULgTqdzjj8iO9TZte1LCtRgeVkuzQ2aPdCB3qNkL0wUk707W?= =?us-ascii?Q?1xD8dG8gdng0vhbqCcglCPwnh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hnbqwq5U?= =?us-ascii?Q?t8Nd8SQ8aOuwA45nIoUiPrvxzveNxOe3hT4L6wD9KSX6M+DGXc/W46am8sfl?= =?us-ascii?Q?nhNipwLlgPma7+KBumNlGrI62Z2VAoBXPQnb5TQz445B4QkghLhJbFIKEMlO?= =?us-ascii?Q?VSggv4NyCEsBXlrxGmRrHJjmnjnWxP+qkW1xzVpKMGKwyrqeIA5Z5Wdr7Wa5?= =?us-ascii?Q?ffFrAnOo8KO6VGc/zVh3Q6hBOAVTT0dBN5ZfDETqOHNPiAe/025wVbcv8C6Z?= =?us-ascii?Q?Sk9udU8Gc1AKm8fL7YIvOHSVTsy0G3L9Zvlr0JJflEJXM4cWUf1Fzr4j6KTk?= =?us-ascii?Q?qO3sHEVtK+KDID2U19hYbrNaQ+FIH75ZwrCX9zxhUx8MBodai6+Sm+6u0a2/?= =?us-ascii?Q?N/704kOLkghVO4rwCx2wf06a057XKuP80bRulf4ByZfCwPBwCGA9QmT3I7Fu?= =?us-ascii?Q?C1J4IvsvHyBEpCfeHCq9t4B6zqnvbqAr/xKQzBbkqHuxYq9QKcKj5Kl/idDB?= =?us-ascii?Q?hvQP8vjfVp8RnapmzCs4zLQRZOiKlZm6RFwQuibOKbSr702Yvp7i1I7nMFtg?= =?us-ascii?Q?oIstTAhEBUccDI8YaOJPymoyVZanDeSnu+7TfH7RXudTSxatJg2Ge+vomLSQ?= =?us-ascii?Q?mHUHIxsqrniwQS//kSLJNkURK+P5vxPnECIHLeSY?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 260b86d6-05b3-482b-3b24-08dbcf2ad287 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 16:05:03.2298 (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: Z2r+Cern1hlrbnHyIOz6RDWsNOng4VFZA8SsZaEwCYti/TyvHXGKB46IdWQvBgef X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4905 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 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]); Tue, 17 Oct 2023 09:05:21 -0700 (PDT) On Mon, Oct 16, 2023 at 10:46:10AM -0700, Nicolin Chen wrote: > On Mon, Oct 16, 2023 at 09:04:54AM -0300, Jason Gunthorpe wrote: > > On Sun, Oct 15, 2023 at 12:14:01AM -0700, Nicolin Chen wrote: > > > On Thu, Sep 28, 2023 at 12:15:23AM -0700, Yi Liu wrote: > > > > > > > diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h > > > > index b4ba0c0cbab6..4a7c5c8fdbb4 100644 > > > > --- a/include/uapi/linux/iommufd.h > > > > +++ b/include/uapi/linux/iommufd.h > > > > @@ -347,10 +347,20 @@ struct iommu_vfio_ioas { > > > > }; > > > > #define IOMMU_VFIO_IOAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VFIO_IOAS) > > > > > > > > +/** > > > > + * enum iommufd_hwpt_alloc_flags - Flags for HWPT allocation > > > > + * @IOMMU_HWPT_ALLOC_NEST_PARENT: If set, allocate a domain which can serve > > > > + * as the parent domain in the nesting > > > > + * configuration. > > > > > > I just noticed a nit here: we should probably align with other > > > parts of this file by using "HWPT" v.s. "domain"? I.e. > > > > > > + * @IOMMU_HWPT_ALLOC_NEST_PARENT: If set, allocate a HWPT which can serve > > > + * as the parent HWPT in the nesting > > > + * configuration. > > > > Yes > > Should we resend? Or would it be possible for you to update it > in your for-next tree? At this point send a Fixes: patch Jason