From patchwork Tue May 9 04:51:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 91370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2632766vqo; Mon, 8 May 2023 22:17:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/yGth8ZB5bPTXslHZcwyVQ+dpaA9srOQowOJDYux+m4OQcZioHkdj0i9jGUpQvCfrqIpz X-Received: by 2002:a05:6a20:a129:b0:101:38f0:1a90 with SMTP id q41-20020a056a20a12900b0010138f01a90mr1584778pzk.1.1683609449472; Mon, 08 May 2023 22:17:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683609449; cv=pass; d=google.com; s=arc-20160816; b=oTymmPLavPVWbxxlNc/lHi5j43yEZwQ9JODHeGNe4QilvybYuBbyUsoOlHnrjTWTsg WPXCehcpPZ1eeUSPvs6+y1/c2Sxh5Anz7BQF6Mx/wFBG0vLU+aB3Jr0Fb59QmiNsiME7 EGkjl/bwg0V3S9O2CAn5xa2vn2GI9ug6sAZRyEdD+CAquCpkNK3A6skde+I9Tr+KxOJ9 TmhageDWc1bT0vqGKxIk5ydAatYbDbeW0KviJokEqwb7scLpy5BC0sVFQMdOOz3PCZ0s w/HsgnO9f2sxsgVvnS00iwuVphlcgp5dAJCUclZNxUAAfv5AG/6s92LywNd6wEfi0WDr 1BDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qqeG6xI/4LdEZnRI5ulmNiNG6l3Vbq04jAj6Uq86cFg=; b=MQ83qdE6UhSJVqH6jDj2GT4ez9VlGSQgIU08E4nUPUA4OIrZ9T5/GdNolVVq+h9RYH h046rW5EkG5m0Svquf0A960SsZhzevVb22hYIN3nVdjk7KN9bME05Rpgqtpsx2xCSdZV aT8mj1+Tqi3SVDTQOtwoo+RG6lXSmKKUCqyuZgFEX2wqe0D3E2McVwNcd0L749lLJX07 TyHTwyolzzIm4F3MJSgbdvOIzV4OEqLp6yOoaiKlGThodJK1VScQO8TDzmdUYG3OVtpp sEB3yqZS19xyH1VqHUoZ+9b514ynsQtKFmeGbW+EnNpmS1OdTixTDC2Rx4Oi85sTkmHN 8UEw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lCjRO5lF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d30-20020a63735e000000b0051394ccd19csi752587pgn.55.2023.05.08.22.17.16; Mon, 08 May 2023 22:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lCjRO5lF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233960AbjEIEw2 (ORCPT + 99 others); Tue, 9 May 2023 00:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjEIEwO (ORCPT ); Tue, 9 May 2023 00:52:14 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2058.outbound.protection.outlook.com [40.107.101.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE23730FB for ; Mon, 8 May 2023 21:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RU6Mzs1XGyRPhHlHic2XsPdm5+H1rMuUHlQdcDEV0ziUU4Qq67F5PYLLPziJL1SI3Qwz940QB+gWH+I9lAFO7zTjhyBETQq1tJJ8GS4G/RfOdn+DlT4F8aNaZ2xoaHBGrk3/BBQ+kG7YqCo5rojAMAuAOnoaL8W1vpljEuaGmERINHv8du8FjzVpqruPsFNevvaB2/w9HX61WiHiBJi/aYjEKbxZQFfuBZkrq6V9QW97VWgdyKqopyihz/J40jJ6fpQph08i1Ztlx8pSVLHZ7RaPzM1ToFfBjk16eV98r69YOgWt7HbBxibyMuydahg6VLW7/pT1rFl+dhyBWlr+kA== 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=qqeG6xI/4LdEZnRI5ulmNiNG6l3Vbq04jAj6Uq86cFg=; b=HqRDLwh5MGPhTjDPltHKLfhgzKBTez5ZmIVcG8u62jXL34pCVFk1LajOrGfBUmA69YehDgjQBLVHwLkWQGhgh4x8Ip/QQUc5F5DyTNMG+eYpqLUC5QUHx7EGt8wXPqJmduX3E5nFFuo/iqqriYZWA/ay1icvChVOcYgV6lrUwvxenN6fTVMwP/c3juLMzgR1E6rNN/zFR04tDf59Px1C9n7YiKKWtZ9PqwE0pnjKJHZHdlWR+lqm3982HjbVzqq56oVgqXm4YnFVyF3RH0dEJ9ujlNQZ/HrlbEBckG6FmnTTNfOpqU/gpAazWJ0OhmgWkNa0NGK4xaQw2O9dQ0fXBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.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 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=qqeG6xI/4LdEZnRI5ulmNiNG6l3Vbq04jAj6Uq86cFg=; b=lCjRO5lF5nhbcgHqG9NSYKErPV/6VasC9jKaO0c1LVja2ASqsflYECNjr+SuGHn03+RILdwAG+JPMxCrjfclyzLbCwdDO9zwM+1l3+DvFmD1uYpV6+WhQs7Z8TSQMmAmq7LrQJJmLm09m3ANv84cY8KRZ+/lAqDoOZS0BvwK45/gGZmpE9VjIEMgXJ32cM8DUKxUx2KTlNshBWt4rjieQMA3zx4Ow3m9hgtKE01dUzmxyFK8NmjVXYVJmabZYWCUk1/jfoKz6Wglq//zkhBKz9vSG/XjLg4mbeL8bjO9cccUTwjhBzivh4+Wfc8zppxumrGX2kFLet4NXf6wCntHyA== Received: from DS7PR03CA0063.namprd03.prod.outlook.com (2603:10b6:5:3bb::8) by BY5PR12MB4131.namprd12.prod.outlook.com (2603:10b6:a03:212::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 04:52:10 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3bb:cafe::5b) by DS7PR03CA0063.outlook.office365.com (2603:10b6:5:3bb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32 via Frontend Transport; Tue, 9 May 2023 04:52:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 04:52:09 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 8 May 2023 21:51:57 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.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.986.37; Mon, 8 May 2023 21:51:57 -0700 Received: from Asurada-Nvidia.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Mon, 8 May 2023 21:51:56 -0700 From: Nicolin Chen To: , CC: , , , , , , , , , , Subject: [PATCH RFC v4 2/4] iommufd: Add IOMMUFD_CMD_DEVICE_SET_DATA and IOMMUFD_CMD_DEVICE_UNSET_DATA Date: Mon, 8 May 2023 21:51:48 -0700 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT045:EE_|BY5PR12MB4131:EE_ X-MS-Office365-Filtering-Correlation-Id: f2681aa8-ab64-4eff-c843-08db5049259e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 119IYNbx6xjZ1wrJ5b9eDDNKQlzzoDPiHhiN3uRjvKvuiQv6Xjg8RGA/MtHFl+uk8r2Dam507Kaws7pYuffPP4bEg9UzvmhUXAuwFobD8dh6l/pTgCwyLppLQFMr3s3H7kjLHgubx6PVKt8LIO91ZQ74sG+XQa08tfyr7w8mSAa5BzDiR+nTSpG3hOFFnnhaHf3IGK+D6BOq2fuq/CgyowgpTbE/9S5RJGDXIxp2eghvtUOSgqcx9do7itCCJSJjiMm0ohPujzLB0l+3nv647e+2DxH35/ek2Bx+YmkTYe1HN8/+AtyzCmn6C44bxPO46p2tpjkrTPrcaclc5QIl2XfJRMn6CP1rpVEt5YndF6oIjHjh4kJagjFOMtpXFxar34hNJFqx1ivPGVzuAEes9qLiXSlijn00Q/UbvKhJmekDJ3P5iINGeDuDGcxXrT0ddK/dNz1NKsmJPpC1xn0TUTRG76EecibhzY4rmh3m+NFTbSHq37C3Gp4l9S6nmlATrrIewqUo04tWutVXCxTU/68Lkn5xl9FqMHlz5ueBLSmX0K4hRi3PO6lXx7bw/c08dWCmUFouQbB/h+nQYZW8AiNjEh7Ooy13U4Bs3Xz7cOf/X0QtYzWGSIR17OPwOJPPxDI8xB6o9cJENwbbJq9Lu7zljcmz5vV7QFCpV3F6kpHthzqECctjHwcvhMf+mNcA1VAIPIuIhLf01RmTv+JUiA== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(86362001)(36756003)(110136005)(54906003)(316002)(4326008)(70206006)(70586007)(478600001)(7696005)(6666004)(40480700001)(82310400005)(8936002)(5660300002)(8676002)(7416002)(2906002)(41300700001)(82740400003)(7636003)(356005)(186003)(2616005)(26005)(36860700001)(47076005)(336012)(426003)(83380400001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 04:52:09.5648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2681aa8-ab64-4eff-c843-08db5049259e 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.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4131 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765392461749882489?= X-GMAIL-MSGID: =?utf-8?q?1765392461749882489?= Add a new pair of ioctls to allow user space to set and unset its iommu- specific device data for a passthrough device that's behind the iommu. On platforms with SMMUv3, this new uAPIs will be used to forward a user space virtual Stream ID of a passthrough device to link to its physical Stream ID and log into a lookup table, in order for the host kernel to later run sanity on ATC invalidation requests from the user space, with ATC_INV commands that have SID fields (virtual Stream IDs). Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/device.c | 81 +++++++++++++++++++++++++ drivers/iommu/iommufd/iommufd_private.h | 3 + drivers/iommu/iommufd/main.c | 4 ++ include/uapi/linux/iommufd.h | 32 ++++++++++ 4 files changed, 120 insertions(+) diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index 790e94baf11c..e40f576fdf0e 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -136,6 +136,8 @@ void iommufd_device_destroy(struct iommufd_object *obj) struct iommufd_device *idev = container_of(obj, struct iommufd_device, obj); + if (idev->has_user_data) + dev_iommu_ops(idev->dev)->unset_dev_user_data(idev->dev); iommu_device_release_dma_owner(idev->dev); iommufd_put_group(idev->igroup); if (!iommufd_selftest_is_mock_dev(idev->dev)) @@ -726,6 +728,85 @@ void iommufd_device_detach(struct iommufd_device *idev) } EXPORT_SYMBOL_NS_GPL(iommufd_device_detach, IOMMUFD); +int iommufd_device_set_data(struct iommufd_ucmd *ucmd) +{ + struct iommu_device_set_data *cmd = ucmd->cmd; + struct iommufd_device *idev; + const struct iommu_ops *ops; + void *data = NULL; + int rc; + + if (!cmd->data_uptr || !cmd->data_len) + return -EINVAL; + + idev = iommufd_get_device(ucmd, cmd->dev_id); + if (IS_ERR(idev)) + return PTR_ERR(idev); + + mutex_lock(&idev->igroup->lock); + if (idev->has_user_data) { + rc = -EEXIST; + goto out_unlock; + } + + ops = dev_iommu_ops(idev->dev); + if (!ops->dev_user_data_len || + !ops->set_dev_user_data || + !ops->unset_dev_user_data) { + rc = -EOPNOTSUPP; + goto out_unlock; + } + + data = kzalloc(ops->dev_user_data_len, GFP_KERNEL); + if (!data) { + rc = -ENOMEM; + goto out_unlock; + } + + if (copy_struct_from_user(data, ops->dev_user_data_len, + u64_to_user_ptr(cmd->data_uptr), + cmd->data_len)) { + rc = -EFAULT; + goto out_free_data; + } + + rc = ops->set_dev_user_data(idev->dev, data); + if (rc) + goto out_free_data; + + idev->has_user_data = true; +out_free_data: + kfree(data); +out_unlock: + mutex_unlock(&idev->igroup->lock); + iommufd_put_object(&idev->obj); + return rc; +} + +int iommufd_device_unset_data(struct iommufd_ucmd *ucmd) +{ + struct iommu_device_unset_data *cmd = ucmd->cmd; + struct iommufd_device *idev; + int rc = 0; + + idev = iommufd_get_device(ucmd, cmd->dev_id); + if (IS_ERR(idev)) + return PTR_ERR(idev); + + mutex_lock(&idev->igroup->lock); + if (!idev->has_user_data) { + rc = -ENOENT; + goto out_unlock; + } + + dev_iommu_ops(idev->dev)->unset_dev_user_data(idev->dev); + idev->has_user_data = false; +out_unlock: + mutex_unlock(&idev->igroup->lock); + iommufd_put_object(&idev->obj); + return rc; +} + void iommufd_access_destroy_object(struct iommufd_object *obj) { struct iommufd_access *access = diff --git a/drivers/iommu/iommufd/iommufd_private.h b/drivers/iommu/iommufd/iommufd_private.h index 35d1294b2f06..98eaef9c41d3 100644 --- a/drivers/iommu/iommufd/iommufd_private.h +++ b/drivers/iommu/iommufd/iommufd_private.h @@ -309,6 +309,7 @@ struct iommufd_device { /* always the physical device */ struct device *dev; bool enforce_cache_coherency; + bool has_user_data; }; static inline struct iommufd_device * @@ -321,6 +322,8 @@ iommufd_get_device(struct iommufd_ucmd *ucmd, u32 id) void iommufd_device_destroy(struct iommufd_object *obj); int iommufd_device_get_hw_info(struct iommufd_ucmd *ucmd); +int iommufd_device_set_data(struct iommufd_ucmd *ucmd); +int iommufd_device_unset_data(struct iommufd_ucmd *ucmd); struct iommufd_access { struct iommufd_object obj; diff --git a/drivers/iommu/iommufd/main.c b/drivers/iommu/iommufd/main.c index 6392f94af179..30f91ea1c5a5 100644 --- a/drivers/iommu/iommufd/main.c +++ b/drivers/iommu/iommufd/main.c @@ -324,6 +324,10 @@ static const struct iommufd_ioctl_op iommufd_ioctl_ops[] = { val64), IOCTL_OP(IOMMU_VFIO_IOAS, iommufd_vfio_ioas, struct iommu_vfio_ioas, __reserved), + IOCTL_OP(IOMMU_DEVICE_SET_DATA, iommufd_device_set_data, + struct iommu_device_set_data, data_len), + IOCTL_OP(IOMMU_DEVICE_UNSET_DATA, iommufd_device_unset_data, + struct iommu_device_unset_data, dev_id), #ifdef CONFIG_IOMMUFD_TEST IOCTL_OP(IOMMU_TEST_CMD, iommufd_test, struct iommu_test_cmd, last), #endif diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h index bc9b08baeb1e..8b4268107c66 100644 --- a/include/uapi/linux/iommufd.h +++ b/include/uapi/linux/iommufd.h @@ -48,6 +48,8 @@ enum { IOMMUFD_CMD_HWPT_ALLOC, IOMMUFD_CMD_DEVICE_GET_HW_INFO, IOMMUFD_CMD_HWPT_INVALIDATE, + IOMMUFD_CMD_DEVICE_SET_DATA, + IOMMUFD_CMD_DEVICE_UNSET_DATA, }; /** @@ -478,4 +480,34 @@ struct iommu_hwpt_invalidate { __aligned_u64 data_uptr; }; #define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE) + +/** + * struct iommu_device_set_data - ioctl(IOMMU_DEVICE_SET_DATA) + * @size: sizeof(struct iommu_device_set_data) + * @dev_id: The device to set an iommu specific device data + * @data_uptr: User pointer of the device user data + * @data_len: Length of the device user data + * + * The device data must be unset using ioctl(IOMMU_DEVICE_UNSET_DATA), before + * another ioctl(IOMMU_DEVICE_SET_DATA) call or before the device itself gets + * unbind'd from the iommufd context. + */ +struct iommu_device_set_data { + __u32 size; + __u32 dev_id; + __aligned_u64 data_uptr; + __u32 data_len; +}; +#define IOMMU_DEVICE_SET_DATA _IO(IOMMUFD_TYPE, IOMMUFD_CMD_DEVICE_SET_DATA) + +/** + * struct iommu_device_unset_data - ioctl(IOMMU_DEVICE_UNSET_DATA) + * @size: sizeof(struct iommu_device_unset_data) + * @dev_id: The device to unset its device user data + */ +struct iommu_device_unset_data { + __u32 size; + __u32 dev_id; +}; +#define IOMMU_DEVICE_UNSET_DATA _IO(IOMMUFD_TYPE, IOMMUFD_CMD_DEVICE_UNSET_DATA) #endif