Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1820419lqo; Sun, 12 May 2024 21:41:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXETkCY8vG/myZxsrN3xiy82O8r2vx3JEqZDlexB9wvv1LAFsQHNfCwM117ef6yznWvb/8HpFWo6k4wG/kb39TJXngshxVTjCrlLfrdFQ== X-Google-Smtp-Source: AGHT+IHP2Mhfsnysx8p5JUEjz14RT8htSIvQTco2R45lC0JVYjQvTcjWatA67eYhDL4GRAMtmDU3 X-Received: by 2002:a25:26ca:0:b0:de5:52ef:c94d with SMTP id 3f1490d57ef6-dee4f0c89b8mr8534445276.0.1715575310494; Sun, 12 May 2024 21:41:50 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2ef074si90194526d6.474.2024.05.12.21.41.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 21:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=eLKSFZvi; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-177144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CFC6D1C20DB2 for ; Mon, 13 May 2024 04:41:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4054146002; Mon, 13 May 2024 04:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="eLKSFZvi" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2052.outbound.protection.outlook.com [40.107.93.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FEEF4C81; Mon, 13 May 2024 04:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.52 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715575301; cv=fail; b=c81t8hhwx31akLPt34sQ/F4yki0CNk3tMPUuEtVYP1Ows4bHK25rr38QMFuBZP+kE+u1nAP4f97q8zT0OkIlc5UMXDVOJ62CPXJjYqBUi0ojLNqDIR38rqsoRDNsfdXZM5C8BZjejr90wgEK/boDFHfbEcexjAFUtKb1FCRSHBI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715575301; c=relaxed/simple; bh=g0YPbXI/ven5yTYtDhlAorCYFSdl3hYGQJYdJwKhMNU=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t0LayuBoVg7KPFiugQpXXFSb+R1xwvU9qc8wwjchTcv6J7BEojztPDDCwitqOdbG7vMhTq1r/WzR+H0hC31nmfPoTsykPugFEqvwO8lDiTwPvt4bz8biXQxKXHZSfq0/JCIpmP6UcZifz2WBRDtbvppKvXxGmpFJX/KPrAjMmsY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=eLKSFZvi; arc=fail smtp.client-ip=40.107.93.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VPZ/D47yXezXa1GpHJ03kulTBWgii7P9YehgUIkYuLgtdeKnNuSEOg+PFhsY3hr9lfWdqjO87xSU4mfJBzHk7VSjNwvK8i9B9tq4grfh1MCPdqGL5xHpb+St7IGnZrXOQSp1bKhMx5FqJFXi8eyQIFN71cu2QuvM5hX0p+u7n4rlibDxzGQ7Tabd2xnTU1W4ry4cVBPDbEREHbQiUnbGbzAenRUgoWymYWbAhkBffO7MgpkUKTZcEiQZ1McV2YdQTNpFK4420C8pJI4/68qxaOyWjUUEVHSY3HQNcKaPm0WxO890o0/nAuq270rCHfqn7KLvVTzyrBdhaVP+rlIwLg== 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=9BiAkJDe4FT7gkzs2WEROXalACr1RS5l+mknpigm4gE=; b=ntu77oXzOrSRa7J9fqoYsz5KSHhKbp6lC/PqllMesT8EDpITqNanB7h//EsE/gdMyczqCVBSvAceh2c5jdwoz02q3FycrONgG8GsOMYhZiu+mhbzHc90000GyJ+SSK4yCJaFidCDOV+WD/dpsWroOIBTXpCy6cvT30ziMIJ81l6Fl9F9iN0IaluOCXnGB5Scz493Ap13Y3mhzGRnAt8QFQsipDqAUKnhQZbyreig6Z44ILo6iUh8dqXVzYwaMQa749Jo1goalici9p2Haw+1gytnYbOELB4UnRuWQh38ac7oCaDVrivzcciQE4FzXjRrL3b/OxDV3ahzIEjC58wZ0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=amd.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=9BiAkJDe4FT7gkzs2WEROXalACr1RS5l+mknpigm4gE=; b=eLKSFZviyqlCqN+skz/WIoACkkzxB+e8La0RQafF14CzunAOXICjINgxMcR/q9sojC4LQ0dmCmWFu//3gocU7HNN4VHjOR4g3u5E6TGFty1X52M3kmoIZ+dV0IrcAvXmwPK9StQlFZloP6zMSQfvWZZSchcQhKhmighGD8519Ztp0SkCbMQ9tB+0/ygxQZfz0FDtvM1UjXzUVeU2J6bnY6EGxxyn/kBAozlyvQBsijRBMtGB3CPEkwMlCdq6+CGLyTzX79u3IcgotJDcNnq1cJ7H+RZPqiSV6cs1G8Lydh3DhlXsqTT1LUydK3GM0JO9WTCYfaD7TNvA5jTBjol0TA== Received: from SJ0PR03CA0108.namprd03.prod.outlook.com (2603:10b6:a03:333::23) by MW4PR12MB6873.namprd12.prod.outlook.com (2603:10b6:303:20c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Mon, 13 May 2024 04:41:37 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:333:cafe::ca) by SJ0PR03CA0108.outlook.office365.com (2603:10b6:a03:333::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.54 via Frontend Transport; Mon, 13 May 2024 04:41:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.21 via Frontend Transport; Mon, 13 May 2024 04:41:37 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 12 May 2024 21:41:28 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 12 May 2024 21:41:27 -0700 Received: from nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 12 May 2024 21:41:22 -0700 Date: Sun, 12 May 2024 21:41:19 -0700 From: Nicolin Chen To: Jason Gunthorpe CC: , , , , , , , , , , , , , , , Subject: Re: [PATCH RFCv1 12/14] iommufd: Add IOMMUFD_OBJ_VQUEUE and IOMMUFD_CMD_VQUEUE_ALLOC Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|MW4PR12MB6873:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a2b4760-8b87-41ad-e00f-08dc7306f97f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|1800799015|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jBFqUFoatkBznTin2qJwkVR7tUDCKQdOKBaUyMzEjgCl6FsO9kwnB5Q8n3Sp?= =?us-ascii?Q?B3YRaOMvfsiBmBx/PXhDN4ud5C0BqzHMIeNb8GBlyhDAEW8YjOPbmOhIQayJ?= =?us-ascii?Q?AU6nP8NMCnOyQ4HHLvNJzxmrg2a8khooxyGOsts6SpHL/LfANiw17liEC6yJ?= =?us-ascii?Q?0mxcCY5IZkDkwz9ayIH1qnK9e6sB+eo5OEi7Kfgq+19x4t8ke5j3O46tbE/s?= =?us-ascii?Q?5ZgkSnosMgS7hCJyaVHIJOxdXJX/3N6IoRH1A5FbuFBJY3k6o2DDsyyt6IO5?= =?us-ascii?Q?kOMh3J2Anxt00gXFZQn2MTa+bowzRGaxqd/CMFdCZ2PLEHvMPqMRPcafVBav?= =?us-ascii?Q?P/k7nUzihY66+zJ6dPSwhVZhZFFs9P69rgvdu+CAAdwgkOKM+xbj0YXLwuOg?= =?us-ascii?Q?pfazUpEnJ1nHorJcp9AXB0IgsnUXJBrTyCc2s+hhJf4TIow/k7zKUsaXqDhv?= =?us-ascii?Q?ONF6UAfkG33VTvYux9fZnrqf6xZ2+zYLe8jUJjqL3h0SdQ0iGN2aKXGtRAZ4?= =?us-ascii?Q?+cHT3Nd8b9TZ+yK7WgPwzmP4BPh1O17rkfCtzKAjwuUJVJTdnS/HyI1SPAKV?= =?us-ascii?Q?IWqOvXHTga8oJUch9+9gPnt15kyJI5sYJ5DOJbqhTqtUlVvJJESVX+wgNnJd?= =?us-ascii?Q?KujbURERXg6L1UrnCJdcuFoTyV4xs3WXbN/SgcpIvl8G4QbmWurTyEYC9wpj?= =?us-ascii?Q?HR99iq2Pdxfc1ka9U3IZncJ9Laq5u2lPaXhdOLs+PtErZ9x0v/a7NVzbwRCz?= =?us-ascii?Q?15h4a16N4LEiT+/VPruajEPZCX3TICp3MlmvUaWUcjx0Q9mv/b6ambvS2OhT?= =?us-ascii?Q?4/d5uy0K6DZUmDhYS9cHrXlIAwKF6VWjFFqkZzeAOls9dPxSB7UfuKwhgyHn?= =?us-ascii?Q?AFf9cwS+Oeh33tn82TPH0c/mOstXKUtg1RivcSFnd9bz3ALjXIZ9OUm2Z4eh?= =?us-ascii?Q?x2ym/k9A1KQ02qZgOGy1qmyRyU1j667IBUPy6y0f4OOwMisbPub/XLFkBv2Z?= =?us-ascii?Q?o/RiYdJV0eySyljN/ny2bQNg3DNARKfUeW1OwEEVyHDW0intVNuGURUzXJ3r?= =?us-ascii?Q?zyX9K4woXy6KTJZtDQIxxb2R/tNpFrhq1PE0XbhOEx+vcqOGL4117vEhdQS5?= =?us-ascii?Q?GMYkNZDPloUeNabFM+afUh2uUhd2DT+gH/k0ycjPn2xf/B3LDxO1T5a6Gbvv?= =?us-ascii?Q?TK3DQrfd3fIdOPK2fKXGRdsI56lpaeR+HI5kqq7cTx9aAduRGobIl3cwqu5Q?= =?us-ascii?Q?FUU7RiOq/FDa98N/KaKRUcb2qJ82eYwr7OsA6X0WsZQTYUZzbRmjjJmMUJdZ?= =?us-ascii?Q?yC7Gq6Z31xRf4/VoUt8tSgbBBQCsKYetDZeJlCDTNUx4fZCerQsy1/3c7ys4?= =?us-ascii?Q?UxGk1yMntzeloBYJUmv1Ed+EN2jo?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(36860700004)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2024 04:41:37.0641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a2b4760-8b87-41ad-e00f-08dc7306f97f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6873 On Sun, May 12, 2024 at 12:02:21PM -0300, Jason Gunthorpe wrote: > On Fri, Apr 12, 2024 at 08:47:09PM -0700, Nicolin Chen wrote: > > > +/** > > + * struct iommu_vqueue_alloc - ioctl(IOMMU_VQUEUE_ALLOC) > > + * @size: sizeof(struct iommu_vqueue_alloc) > > + * @flags: Must be 0 > > + * @viommu_id: viommu ID to associate the virtual queue with > > + * @out_vqueue_id: The ID of the new virtual queue > > + * @data_type: One of enum iommu_vqueue_data_type > > + * @data_len: Length of the type specific data > > + * @data_uptr: User pointer to the type specific data > > + * > > + * Allocate an virtual queue object for driver-specific HW-accelerated queue > > + */ > > + > > +struct iommu_vqueue_alloc { > > + __u32 size; > > + __u32 flags; > > + __u32 viommu_id; > > + __u32 out_vqueue_id; > > + __u32 data_type; > > + __u32 data_len; > > + __aligned_u64 data_uptr; > > Some of the iommus will want an IPA here not a user pointer. I think > it is fine API wise, we'd just add a flag to indicate data_uptr is an > IPA. Ack. Nicolin