From patchwork Tue Jan 7 17:10:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 13929439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 209CDE77198 for ; Tue, 7 Jan 2025 17:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6vY7vxx+Vn8PB9+jCIIbHTRj05Uptls2AQ6Dl8+kiok=; b=PQMK4FroG0RMNQeD+omcj72pF+ Txun3kFRgw+b2SAzxeMnHVWyiOFI+r80hu4/MrZLUa3jiDQTn4C2b5dl9NC706iHe69yF+yNlAlmv JK3kZuavZjXb+pU4VkSR4oXSmy4o73+IVVvPa8JqPyf59z/oCl3vV0a/vRC9t78Dl8QbP0SWg9t3b a+7xlZk/iainJ9X5UTMCcsZ3kKdUbWkH1sYqJdhtPEe5LdoDp3PN4ehlx5FyW+SRlNhbv7OOgEKmO vy7/wpFkJUtLn4L+QPDMwuUI8LifeJRfJRqd8KJsUrR3e5y3RJX4dpB/rmxYYzxqsKwfWLl3TO3fX V4bPaB4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVDL7-00000005qkm-42Y4; Tue, 07 Jan 2025 17:26:01 +0000 Received: from mail-mw2nam10on20621.outbound.protection.outlook.com ([2a01:111:f403:2412::621] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVD6Y-00000005mBl-2I19 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2025 17:11:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D53cqb2HjO0IuVY+TzjyYRewTWZUQeYEIwbDRkBGgZSHIQDAGa6E01Reu0oQov3MRUW/mNG8YW2xoL8XLgnm9LbDS/dPtY8MA2+NhAynrVA5WIqEqMS02RZyPYWSGsAYHjBK5umX7ifSugLiF0V2ywOVoiMn9LFuGiRjNy5QLzy3O/hOP78h8gy0vwETuSYKYFtgvCsBpqzIHZ5Q7XhyvAdBv/mL1YbLCfYOFdvLTTI2a+PvyPOnkmhSQcKHSnPt15IcJnov7eyrel/6vFmMWnf+VKbKP45vCLzhoEzB1oBTEJp+OD2QsFk+MpqEtDXLkck18FRWI94SZMW+OVWNww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6vY7vxx+Vn8PB9+jCIIbHTRj05Uptls2AQ6Dl8+kiok=; b=mZUM0Q3JP4n+O3matepahHgGcHMv2pGsNqt74QZEBWrIUYJ+yVfncv48N8Bi9+rqCOiRVRMsqx03HnH0BjCRFbKgu74hNDKw6+bfNi8MGZcdo3+iLVzhBe8nXfbwU1tGBvEb7Rb2AHgxk8H1yw4rl1mKjnpBcNxSa0kQWUTwiRdHigB1lcEDJox/ufZFjCsNBkOyphs8M5pfCMGjj1d5eloAn1a6CeojgMsW+5Riden6OiSST+t8b32yX444Wrh7vKpEQDVwillwvLfMXr86tZZzj4ciynN1NortEnor5++d0HVibr9WngZN1Wv+5fVB5N84E0Z799Lc0BdmqIiyVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.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=6vY7vxx+Vn8PB9+jCIIbHTRj05Uptls2AQ6Dl8+kiok=; b=QxpVDa5cX4MxVeG5MG1A1E1DJcSeB5ERORShUSWqHrZgPnQcr2PU2lXzV1BiPpoYkPqx1icvrmN4f2x7hwIr4Ja81HxffAJ6bR9liW8g//z7ZsGXiKu/ciJb3igmGYwUjFmSULvyT0T5WGTADWJiWpHhor+9hnnMpNmzXLYMBppozsoj21pHo8HthEsFsWM0HzhpF+FLzXtR+Oa6T95UIybVJuW3wxB3PNVww2HHo4usb7EBRJRkrOZ6s/ioY6fEeq7knknktea0EKK1n3CDmS+oh/q81cc8CnY8eSG5OBFpBFBkJC7sEQbk92ALTkivaud7K9XceobVcvBPSISf+Q== Received: from BL1PR13CA0008.namprd13.prod.outlook.com (2603:10b6:208:256::13) by PH8PR12MB6697.namprd12.prod.outlook.com (2603:10b6:510:1cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Tue, 7 Jan 2025 17:10:45 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:208:256:cafe::a6) by BL1PR13CA0008.outlook.office365.com (2603:10b6:208:256::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.10 via Frontend Transport; Tue, 7 Jan 2025 17:10:45 +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 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.0 via Frontend Transport; Tue, 7 Jan 2025 17:10:45 +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; Tue, 7 Jan 2025 09:10:28 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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; Tue, 7 Jan 2025 09:10:28 -0800 Received: from Asurada-Nvidia.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 7 Jan 2025 09:10:25 -0800 From: Nicolin Chen To: , , , CC: , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 01/14] iommufd: Keep OBJ/IOCTL lists in an alphabetical order Date: Tue, 7 Jan 2025 09:10:04 -0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|PH8PR12MB6697:EE_ X-MS-Office365-Filtering-Correlation-Id: a62e0670-fce5-4232-4e22-08dd2f3e3985 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: Wqc0Znuy4VBhZnt2DzkTuI0zVnFC8EuKTWWart0rbYhYmZuSy1hOMnK7mC14QTwEGB8IC09h512/AVcFOdt0xFl+vW+Kf+sHfC9WXEpUqdV0jb0Wj9S+p9OooYo17FloYQr9hcKZ/3UGPI/q4XyhVWlkTzuQ7dzxKe/89F8BN7T0b9G0r1XCixBY7YEi5eGdGEx9RS9NWkZJwJtFEUNWu/YFUexnkixtGKG75aWfvAGIQEyyeK4Z+ul5XO2HHi/j1qNzL9ESzPwuSJGQz1oLbDp2JjDfzhKZKbfZtjaXxpnww5fTgu4jBe87BXQMQHSWIJqy26IKxaXUOhBpdLCssszor/BOMcCd8pQQfwcwXZgEe4jlleN3gECvienxJXVnOsW19RQbscU5G/1dmhVdjUgkq2uRlU11Z9wnZD4EtUNrg79iaLqFXVh9vQ6MP3jr/72WG/H5taR4syWS/hrkDQwAAapVTsA/JaQ1+GXYgA41HAiMIAE6U4J9CRqQa+gSZXCgfT0qnTu3gLuyryJ2ULrC7ugfu/1jvj0m9YS3eFCPBe5GUVc1T70vRuBfy+UpyLCxhjQUZ7I5Uxi8qgpze1RUzbTVNmAGr7gi3JC3XaBvD2DIf3OQYuTdko4SDQofcbM/QgBKxaLgOBSyHfU6m5RmGCWsW7/FzBSqf+ObT6ZCUMuWe6hX9XeDaLtD18phHMXGp01A1LQkTEpq6hIutnUzV05wa7DYne13DaMjCY2aYoQ+GF5Gt4F9dtRRQeH78DkqKDk6l/c7L+IFblL2ROWd+bK02CQsCQjzzfQ5+pfRkDNOMOYjIz8KzkjHbprLGRZRijC4D3BWc9rRhgVMK5DdudKjyTzaeD/jmfFhb/h340AeVKI3/SPKXL0yoThPrMnTsndZ133rL8Zw2wltpfpcxmd1KSYZl8eGEyhSGpNdlNXwhEvPrP6/RGuOb3QcQWx+NOo9HG9PMih3SqrRqMZr1taRuCz1Qn5KOAWKRTzEw3WMgbSLatCNsA0osxjK1Rmn4X0GTfVbswK1yyFhV8QcWShKEIS5QkeDHOhH5PH7vESDUxcBC2lS7HCitXTSiunudXc0ZVBCuKH8ethnlnG/cNTAF3B7WXSKPUvV8eyQI8K7a6gU8jIscvpktZKLy4Zu/VBJqIXlPYvyMAN+fSKZMONhSq+7kaEQl3uwUk2haG5DTHlQvNYoNBHRVN1yMq9pFzZwH5JVK9Grs74pRNOwc1gY3ymccNjpKNRtuWwmt2n/X9Kucxe28i3rOycQfnboc+0/EhH8//vVNXdNZpDqaS/e5HgogMJUPQ6I8mTQ/6YolIqoNEbGD0+8D/oQX5bvZhlxsVO4hgNUC5LBHYupPxeXcQwmnQwpwxxrVxywpyaWO0sv5MSjbjKv3/3t05FKGeHZI7HlWQwj2NP5qcKc8WHRWCB5fC4FWqWqESJTj3j8ApNQXVC3t+ENWWRULpecODG2DZvtsmOTHWJZZw== 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:(13230040)(376014)(7416014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 17:10:45.3962 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a62e0670-fce5-4232-4e22-08dd2f3e3985 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: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6697 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250107_091058_616203_690028C0 X-CRM114-Status: GOOD ( 11.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Reorder the existing OBJ/IOCTL lists. Also run clang-format for the same coding style at line wrappings. No functional change. Reviewed-by: Lu Baolu Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/main.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/iommufd/main.c b/drivers/iommu/iommufd/main.c index 97c5e3567d33..a11e9cfd790f 100644 --- a/drivers/iommu/iommufd/main.c +++ b/drivers/iommu/iommufd/main.c @@ -307,9 +307,9 @@ union ucmd_buffer { struct iommu_ioas_map map; struct iommu_ioas_unmap unmap; struct iommu_option option; + struct iommu_vdevice_alloc vdev; struct iommu_vfio_ioas vfio_ioas; struct iommu_viommu_alloc viommu; - struct iommu_vdevice_alloc vdev; #ifdef CONFIG_IOMMUFD_TEST struct iommu_test_cmd test; #endif @@ -333,8 +333,8 @@ struct iommufd_ioctl_op { } static const struct iommufd_ioctl_op iommufd_ioctl_ops[] = { IOCTL_OP(IOMMU_DESTROY, iommufd_destroy, struct iommu_destroy, id), - IOCTL_OP(IOMMU_FAULT_QUEUE_ALLOC, iommufd_fault_alloc, struct iommu_fault_alloc, - out_fault_fd), + IOCTL_OP(IOMMU_FAULT_QUEUE_ALLOC, iommufd_fault_alloc, + struct iommu_fault_alloc, out_fault_fd), IOCTL_OP(IOMMU_GET_HW_INFO, iommufd_get_hw_info, struct iommu_hw_info, __reserved), IOCTL_OP(IOMMU_HWPT_ALLOC, iommufd_hwpt_alloc, struct iommu_hwpt_alloc, @@ -355,20 +355,18 @@ static const struct iommufd_ioctl_op iommufd_ioctl_ops[] = { src_iova), IOCTL_OP(IOMMU_IOAS_IOVA_RANGES, iommufd_ioas_iova_ranges, struct iommu_ioas_iova_ranges, out_iova_alignment), - IOCTL_OP(IOMMU_IOAS_MAP, iommufd_ioas_map, struct iommu_ioas_map, - iova), + IOCTL_OP(IOMMU_IOAS_MAP, iommufd_ioas_map, struct iommu_ioas_map, iova), IOCTL_OP(IOMMU_IOAS_MAP_FILE, iommufd_ioas_map_file, struct iommu_ioas_map_file, iova), IOCTL_OP(IOMMU_IOAS_UNMAP, iommufd_ioas_unmap, struct iommu_ioas_unmap, length), - IOCTL_OP(IOMMU_OPTION, iommufd_option, struct iommu_option, - val64), + IOCTL_OP(IOMMU_OPTION, iommufd_option, struct iommu_option, val64), + IOCTL_OP(IOMMU_VDEVICE_ALLOC, iommufd_vdevice_alloc_ioctl, + struct iommu_vdevice_alloc, virt_id), IOCTL_OP(IOMMU_VFIO_IOAS, iommufd_vfio_ioas, struct iommu_vfio_ioas, __reserved), IOCTL_OP(IOMMU_VIOMMU_ALLOC, iommufd_viommu_alloc_ioctl, struct iommu_viommu_alloc, out_viommu_id), - IOCTL_OP(IOMMU_VDEVICE_ALLOC, iommufd_vdevice_alloc_ioctl, - struct iommu_vdevice_alloc, virt_id), #ifdef CONFIG_IOMMUFD_TEST IOCTL_OP(IOMMU_TEST_CMD, iommufd_test, struct iommu_test_cmd, last), #endif @@ -490,8 +488,8 @@ static const struct iommufd_object_ops iommufd_object_ops[] = { [IOMMUFD_OBJ_DEVICE] = { .destroy = iommufd_device_destroy, }, - [IOMMUFD_OBJ_IOAS] = { - .destroy = iommufd_ioas_destroy, + [IOMMUFD_OBJ_FAULT] = { + .destroy = iommufd_fault_destroy, }, [IOMMUFD_OBJ_HWPT_PAGING] = { .destroy = iommufd_hwpt_paging_destroy, @@ -501,15 +499,15 @@ static const struct iommufd_object_ops iommufd_object_ops[] = { .destroy = iommufd_hwpt_nested_destroy, .abort = iommufd_hwpt_nested_abort, }, - [IOMMUFD_OBJ_FAULT] = { - .destroy = iommufd_fault_destroy, - }, - [IOMMUFD_OBJ_VIOMMU] = { - .destroy = iommufd_viommu_destroy, + [IOMMUFD_OBJ_IOAS] = { + .destroy = iommufd_ioas_destroy, }, [IOMMUFD_OBJ_VDEVICE] = { .destroy = iommufd_vdevice_destroy, }, + [IOMMUFD_OBJ_VIOMMU] = { + .destroy = iommufd_viommu_destroy, + }, #ifdef CONFIG_IOMMUFD_TEST [IOMMUFD_OBJ_SELFTEST] = { .destroy = iommufd_selftest_destroy,