From patchwork Tue Dec 17 16:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhi Hou X-Patchwork-Id: 13912210 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 188CEE7717F for ; Tue, 17 Dec 2024 16:55:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 784E910E72F; Tue, 17 Dec 2024 16:55:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="avB3tEYP"; dkim-atps=neutral Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA67510E283 for ; Tue, 17 Dec 2024 16:55:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PElnOUJc7fA3D0JWA+IdpZgc55XWdCjjXWSnjsgCmic34O2yshcsAfH0+Mf0gS6iyuZRym8M9D5eGiYQz90zgV0CvfjwBNmkMSQBMktpwwZGks/MhT55iooohYMzWDdrrrC1ALTCmkr5oK6UsasKZBzeEjKNmtPZum4bfeoiWYOAanOvQsl3bdP2d4VvET8lAIcmcyVfWzBTeLa4rbgxKzIU5FxCFvv8mVTTgQMgx9DrR00iA+7EUOwRfMgh11pvDCq4NkpjV4Phm9jvsqDMtSdv43K+h5xNcZUPxntvwRDIwlfymXf+vlJ2j6Ke60JRe/l+u+ExYFUboJ/m5F4K8w== 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=5VrqIn8sGIpZs2MteK2ACxFjELnBUlDRUvOk8O0vZs4=; b=F7H9xLwiPp/xFxgQzYn2EcsnOycf8seb2AHsLEGSfDRVIjadrORiB7kn21xPyZLU1NAj9eiQ1FZlx2pX36LXdbMdQLyuXPGOH6rzsBSQDTftKKWYg9MivqgSJX5RpsrBF3EuekkbCyC6TT3gqqmYxx/iy4fmFFqQddXVKfBmrRDSu70ft4OI3FOs57oN4q5PRz75LQFr/OWUMxYJbEgj4VpU3cUB/L7dA8+BzdOVfPY9TdveFKNpAwqoG3tc3MKw2i8SkAQ4VNvNWC31skn0TpxV68wZngZF5Vd6et7ABg0AEUCA77R66IVHQJ+7EW6QgdtFubQ9cn3JjV7muOe0Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5VrqIn8sGIpZs2MteK2ACxFjELnBUlDRUvOk8O0vZs4=; b=avB3tEYPkAhbRQCfRaTgUtKdnEqNdiljU1yswCa5mTOalHqd4+WTzROY7s8AdStcypWcq6aWRsZc8APgsHhXFIN731CYVYLohDVLg5d7zi4VacCBQtuOU/4+mDbBDHuEUnoW+XWF41nYORElrVUvqSCLY9Yd3aIvfcd3Sxc7UEw= Received: from BN0PR08CA0019.namprd08.prod.outlook.com (2603:10b6:408:142::12) by DS7PR12MB9043.namprd12.prod.outlook.com (2603:10b6:8:db::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 16:55:12 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:408:142:cafe::42) by BN0PR08CA0019.outlook.office365.com (2603:10b6:408:142::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.21 via Frontend Transport; Tue, 17 Dec 2024 16:55:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8293.6 via Frontend Transport; Tue, 17 Dec 2024 16:55:11 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 17 Dec 2024 10:55:10 -0600 Received: from xsjlizhih51.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 17 Dec 2024 10:55:09 -0600 From: Lizhi Hou To: , , CC: Lizhi Hou , , , , , , Subject: [PATCH V1 1/2] accel/amdxdna: Add zero check for pad in ioctl input structures Date: Tue, 17 Dec 2024 08:54:45 -0800 Message-ID: <20241217165446.2607585-1-lizhi.hou@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: lizhi.hou@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|DS7PR12MB9043:EE_ X-MS-Office365-Filtering-Correlation-Id: 631930d5-6fc8-461a-107e-08dd1ebb9244 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: UOzAcDgVce3ShoS5CE6rxUxK1zRZgFXHi0JHJY614OnbsuNbdrc6KMvTS2ZrXo0T0shhWPywVBpVwFwIr/tmSfvsEu5Ieb0VFh0ZJPOsVTRqAEbaty/HFvczftdlWV1sJV2lHBshiBB+EFdEf2aP5Y172X7A8w1B9XOxH++M/9iiitx8RGs8s9VgUlUudn3c9kiL6NJ+Bc0uVXH0NnyjuETxb2x4JJBQsW1bPuGq5usWTvLVoFU5asnCTtcZ9yinoqCcKz3WWtK82VI+Xx2crxM5hMqxQU+2BXpDRo0MgpuSNxgXyHS/yoXm43GAaQCIqW6llhMnuOGo84Zx/Wu0Y6p1mfHDeLxgooz6A9Fdury0dDkmOR1KPRaIXfeKy3WG2pDn6WYJmn4bvca+WvRediW7noZDyOx8GalwdY3ZXF0H5/BHFcjUG6sZe+8pbOZ6a62FSGn+GwQTwPZyjOxgC8+4UZ0r/Us7wjHgFS7OyyQUok+26nQ1rdwinprbpNdocDf8wZLpM+pzDohxjmIkNTZUMXn2TdaUciCXWyauIVynBPwn41MljA+bIo8q0EuCmFa3NVDPQTfYKfoo5mO7/kDwXUfjn7TsdQTxQBpDFTZ0n+gkLxrf6tCHauHecONZdEZxTC2sPfwh2dXvT56kZiBVLL18cOQYkasCPWExy+ZMKcIxMKKLxVfK8zfPp0Ee1Gta1U3iQilTu6WBJXvmZctY0T9So69eMU6d9iNpAeynk2stDvJYQFLWgh56GqumzaUvqZIqEyxkMJ1Sy/RWNhowvEqhXTpGNg4SdbsgF3ywy79clAc5Ers8p3wWUh90hLPibO3g9lFxbJirIhtGQa8IbKiDjUciymbjmaJ7QUkzT3FNd2oib7+E+uWF8SMGCtFsTCuitpmtDUEBFyi8KSRv++jnw0u0I9mSS+zjmI16WdokhGeJrg22ImXf/uBZ+/RpB0dYM/+UVrgdyHgciurAYRzTx2Fo9L6Y1PI5R14hAeb/OSsJ5WScwzdbk7OteLvnnlErjLRkHC4ER7il4rm5JWUD28C+i/IAr6s6aKvd3X7tjW3KfE7i/lxk3Eo9rneKjVaaP2I0F6YWv49cVW4atl4Oj+h+VxejoXtmvlwiCUU6MeRPdVUk5URnPr2JbexfeZcR2QXufFESjfGrnZG8TQrjfg3BqhyBN7emK65ORZITty8uNQTKpkIAQdbSoQ7/+py7n7pQtk/mbBGEa9mkcYMeG0BWAt1kRytjZJxRNxZYN89HmjNnrIyeKmJv3LbvXCSZ1oPucA1LNimX7HGkA+qdh31GTC9ElGtGcAlNXWDar3KSMV90L34gecqDBIx87MVZfhprlCaSuUAZZarHPhZB94iaGLwpvgipwS9Ahgkn6t8ZCQEBWB/nt9J9hi9S/FdbuvEyuFcJs3l69RqRCMdnLj+FMBRFBHpRmZeMyiW0gh3iD0y0ScT3dk9se3Jw8TQSQTqLScUstgqIMQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 16:55:11.7349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 631930d5-6fc8-461a-107e-08dd1ebb9244 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.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: DS7PR12MB9043 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For input ioctl structures, it is better to check if the pad is zero. Thus, the pad bytes might be usable in the future. Suggested-by: Jeffrey Hugo Signed-off-by: Lizhi Hou Reviewed-by: Mario Limonciello --- drivers/accel/amdxdna/aie2_ctx.c | 3 +++ drivers/accel/amdxdna/aie2_message.c | 3 +++ drivers/accel/amdxdna/amdxdna_ctx.c | 6 ++++++ drivers/accel/amdxdna/amdxdna_gem.c | 2 +- include/uapi/drm/amdxdna_accel.h | 10 +++++----- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index cdeead75c6f5..9facf45818f9 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -690,6 +690,9 @@ static int aie2_hwctx_cu_config(struct amdxdna_hwctx *hwctx, void *buf, u32 size int ret; XDNA_DBG(xdna, "Config %d CU to %s", config->num_cus, hwctx->name); + if (XDNA_MBZ_DBG(xdna, config->pad, sizeof(config->pad))) + return -EINVAL; + if (hwctx->status != HWCTX_STAT_INIT) { XDNA_ERR(xdna, "Not support re-config CU"); return -EINVAL; diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c index b2ca78cfd0a7..9e2c9a44f76a 100644 --- a/drivers/accel/amdxdna/aie2_message.c +++ b/drivers/accel/amdxdna/aie2_message.c @@ -395,6 +395,9 @@ int aie2_config_cu(struct amdxdna_hwctx *hwctx) for (i = 0; i < hwctx->cus->num_cus; i++) { struct amdxdna_cu_config *cu = &hwctx->cus->cu_configs[i]; + if (XDNA_MBZ_DBG(xdna, cu->pad, sizeof(cu->pad))) + return -EINVAL; + gobj = drm_gem_object_lookup(hwctx->client->filp, cu->cu_bo); if (!gobj) { XDNA_ERR(xdna, "Lookup GEM object failed"); diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c index 324f35c43f6c..d11b1c83d9c3 100644 --- a/drivers/accel/amdxdna/amdxdna_ctx.c +++ b/drivers/accel/amdxdna/amdxdna_ctx.c @@ -243,6 +243,9 @@ int amdxdna_drm_destroy_hwctx_ioctl(struct drm_device *dev, void *data, struct d struct amdxdna_hwctx *hwctx; int ret = 0, idx; + if (XDNA_MBZ_DBG(xdna, &args->pad, sizeof(args->pad))) + return -EINVAL; + if (!drm_dev_enter(dev, &idx)) return -ENODEV; @@ -277,6 +280,9 @@ int amdxdna_drm_config_hwctx_ioctl(struct drm_device *dev, void *data, struct dr void *buf; u64 val; + if (XDNA_MBZ_DBG(xdna, &args->pad, sizeof(args->pad))) + return -EINVAL; + if (!xdna->dev_info->ops->hwctx_config) return -EOPNOTSUPP; diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c index 4dfeca306d98..606433d73236 100644 --- a/drivers/accel/amdxdna/amdxdna_gem.c +++ b/drivers/accel/amdxdna/amdxdna_gem.c @@ -552,7 +552,7 @@ int amdxdna_drm_get_bo_info_ioctl(struct drm_device *dev, void *data, struct drm struct drm_gem_object *gobj; int ret = 0; - if (args->ext || args->ext_flags) + if (args->ext || args->ext_flags || args->pad) return -EINVAL; gobj = drm_gem_object_lookup(filp, args->handle); diff --git a/include/uapi/drm/amdxdna_accel.h b/include/uapi/drm/amdxdna_accel.h index e4edb52bc27b..92eff83fac1f 100644 --- a/include/uapi/drm/amdxdna_accel.h +++ b/include/uapi/drm/amdxdna_accel.h @@ -87,7 +87,7 @@ struct amdxdna_drm_create_hwctx { /** * struct amdxdna_drm_destroy_hwctx - Destroy hardware context. * @handle: Hardware context handle. - * @pad: Structure padding. + * @pad: MBZ. */ struct amdxdna_drm_destroy_hwctx { __u32 handle; @@ -98,7 +98,7 @@ struct amdxdna_drm_destroy_hwctx { * struct amdxdna_cu_config - configuration for one CU * @cu_bo: CU configuration buffer bo handle. * @cu_func: Function of a CU. - * @pad: Structure padding. + * @pad: MBZ. */ struct amdxdna_cu_config { __u32 cu_bo; @@ -109,7 +109,7 @@ struct amdxdna_cu_config { /** * struct amdxdna_hwctx_param_config_cu - configuration for CUs in hardware context * @num_cus: Number of CUs to configure. - * @pad: Structure padding. + * @pad: MBZ. * @cu_configs: Array of CU configurations of struct amdxdna_cu_config. */ struct amdxdna_hwctx_param_config_cu { @@ -133,7 +133,7 @@ enum amdxdna_drm_config_hwctx_param { * @param_val: A structure specified by the param_type struct member. * @param_val_size: Size of the parameter buffer pointed to by the param_val. * If param_val is not a pointer, driver can ignore this. - * @pad: Structure padding. + * @pad: MBZ. * * Note: if the param_val is a pointer pointing to a buffer, the maximum size * of the buffer is 4KiB(PAGE_SIZE). @@ -175,7 +175,7 @@ struct amdxdna_drm_create_bo { * @ext: MBZ. * @ext_flags: MBZ. * @handle: DRM buffer object handle. - * @pad: Structure padding. + * @pad: MBZ. * @map_offset: Returned DRM fake offset for mmap(). * @vaddr: Returned user VA of buffer. 0 in case user needs mmap(). * @xdna_addr: Returned XDNA device virtual address. From patchwork Tue Dec 17 16:54:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhi Hou X-Patchwork-Id: 13912211 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 02F4EE7717F for ; Tue, 17 Dec 2024 16:55:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 809A910E54E; Tue, 17 Dec 2024 16:55:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="SILm+u3b"; dkim-atps=neutral Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f403:2417::62d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D08210E59F for ; Tue, 17 Dec 2024 16:55:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wqCTqD89NSksiO1m24ftQGcH1aNbDbn/CHMnhnN8L1SC0OQgCpzwVpUTbmEeXpMuTWf2saEWUJqTGkfnhay2sdC5I5K9xI5VEUFxmmAao7t6DIjYjHzSOINq5Cbo9aEoqRLoNEaEKj5eAeSOl1zoIZDff5lEhYNYVlPATluYoqw7HYrNnm0ldzth86iEG1kkyqdJTUduQNGVO0ObUVvI9I6kKemsNmVZVjRJQcVDxZgWApe0ErmfQy8VpLqiHlHLkep2NXNrTjy3V3cvF615MLJeePJW8UJrbAC2PQqfRioPkRxdYpHbfUbbSJbMbm2ciCOK24hyJbhaseRZYQFpng== 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=qUL+u/FwXBcT+hUXbI0apcTDpqrpGHSh0/gIJvaNK/8=; b=ftUcsRELIIGCZWanWce67VML9o0PIfPFqJsfRKyg/c2ce+xXV7IqgsCasqoQU6UvA8CMOD+0fsKH+khy1W1DBEfFu+0RWIg/kkKSPTY2Vy06UOD+NAM50U4vTBkcRmt/lG4OdogXS6ROXGO/SKB2/wLi/Pkq/M+AK+JsLNjM8dyDJg9TK/Y/gpblLrlvSHCQRbGg/a2A4VUnOKVNQB3798wyDPiFFt/6OgNl9Dwl4XqO36N+d6rCa+U5PoQpK0HnRrRUl5AwXGJh1e9iDXd3hK3SV0zzacoOQhTMlaM0y0V7s58hDKOA3ULLUM2tqGgnIpfwBrv77PPo1nwc5hj09A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUL+u/FwXBcT+hUXbI0apcTDpqrpGHSh0/gIJvaNK/8=; b=SILm+u3bvYYMPmGnf/j+SprWJy9Lx7FQ7+zEVUdX760fc3ygrDSN3zD8DNhKhxqU9yZAgDcmvio0k2a/atLjG+hU48Xz/v0gXaXxdu6M501wakcp/UY8GDThNi4jm4B8YjSRKbRC8N/0f051oETyarseIZvP8P8AGMs//QtQors= Received: from BY3PR04CA0023.namprd04.prod.outlook.com (2603:10b6:a03:217::28) by BY1PR12MB8445.namprd12.prod.outlook.com (2603:10b6:a03:523::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Tue, 17 Dec 2024 16:55:12 +0000 Received: from CY4PEPF0000EE37.namprd05.prod.outlook.com (2603:10b6:a03:217:cafe::db) by BY3PR04CA0023.outlook.office365.com (2603:10b6:a03:217::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.22 via Frontend Transport; Tue, 17 Dec 2024 16:55:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EE37.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8251.15 via Frontend Transport; Tue, 17 Dec 2024 16:55:12 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 17 Dec 2024 10:55:11 -0600 Received: from xsjlizhih51.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 17 Dec 2024 10:55:10 -0600 From: Lizhi Hou To: , , CC: Lizhi Hou , , , , , , Subject: [PATCH V1 2/2] accel/amdxdna: Remove DRM_AMDXDNA_HWCTX_CONFIG_NUM Date: Tue, 17 Dec 2024 08:54:46 -0800 Message-ID: <20241217165446.2607585-2-lizhi.hou@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241217165446.2607585-1-lizhi.hou@amd.com> References: <20241217165446.2607585-1-lizhi.hou@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: lizhi.hou@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE37:EE_|BY1PR12MB8445:EE_ X-MS-Office365-Filtering-Correlation-Id: 160804ea-d0f1-4cec-d0ff-08dd1ebb92ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: fRxvIdwgshQX76NBJhJn2ODwRigi1huAFJECzBXMNKWgZlgdUABvo7kw9Rh87BqNsg+rmX1qNpUq+jRu9WzqlUYlRheEHjm0GzPQL4BxbZ7gBhe+xZZjW7+SymS5s3aAWHX0y0Ij5mCBXrOy6j/80rfP8IkUgl47+ksTNFMi1ibT0RK6rrkAZVdUB0LpElvOvz9kS1NIzQAojkqs/gd1haHFDHctMy7bjNkdFJyh05/XkCFeAEK+ACPwdGL+XSczeE4jN3ryrU+wycyoTamo7kZse+MmSUG4vGw68B4OgQ5WdG6JictxhBBsDkd7CgL2ykik+EC0SwWf7m1EBFetvKFzKoUrj6cJG86fNqEu91dQBhdalhk+8oD9PN6dVgmSuhOTanT8PYKvHt/C5aqVy/NNvX0gA2H9uvP4K6cF8FiFNHoPmDJAnyv9wJ0Tz8i2v75O+8NBWwxqMMHTU2Szl91u6y8e7rGJ7LCjfR96YOmSNrieiamUaByD7Hk0/HtEI1NHqOgECpsH+OSSURTyolkdkWGAM1CBNB+aey+30OSnXHq9pdQfUwYOX4AW4AmkVftvESnK8Ywl1amSBVKfpDxMyHYY1drTdUcFWsJAqip+FHhQPAapvwZuGE2GvAZNUr/2mtMApXKBRG7ckJWIpD7G5zdWCgzYYnocjGBEO2ZUmOmqfauK4NKiRCJOF0fWfceDE6k+BPVt4U8rhPnUgJvBJ7o1OvEaOs9Wm3tWWB5/jz4ni4TpF2gQAcCuKeGuZFb5FVUmysd87jD5Y1q0NFdsbgJHar8dT5y/zc/PSpQlLun22CXM8O/FLGqkh0Mu1PTncyUcLX44iz9QtA39NLMeJRca/mGyuk3nicW9/7FoG7pWdcoe3FF4lmapUzWxI+jgDC681XlzHOdwNGM13RB8pqg7+JzLNeBm9jk/IMGx+VtPk/hJ5pdnZAsh8YtFF1CNGkQPIqUZRoVQt7KwX/Cfx5vPUHj9GV/5yUy3ba8vdJzDUDKWY7V9HOESql04sgooPsWkj5NBnJCHl0zHrpdpHedtQmPdL3vZ1+T6cjdr6+QVcOl3gR8KeCtFuCtfQRBfaVWDD+gwKunoK0A0tu0BapDF+2kZ+35Lzih6Sd0hn+BIRMkZICP5nJuGp/YtcwCmV/Z48Xu57ZmLEitaT0n3soIrCL8BFmcezHcsDHOjgpmmqcjsdVqBhrZaz9GwE8xn4jcyNrSiV+xdvGZAbYvFSxegurMCwQZ827JYSOpgzelBOrLGfgpwSpUfISFk6VJtiXWpp7OnYlF/lT6+wt7gvYgTzRfB9skkVNSmp17S5Wht04YIFU+6/EIJD2wqaa7JMmYrk/6Sqrz+ov83fvxlaCCB1D140Zfy2xVFNZn92uTP0miTrFe8lMx3yPW/TaR5UH4tAJsHjVWLh/i/IKDuFpwiTrkpye+sRXPsQHvse7jY6Wm44mXVSPgXLDF3/LEaIkU/7QW/QvZoekO5EqbdAgOsHRC215Up1EHH4CM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 16:55:12.6127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 160804ea-d0f1-4cec-d0ff-08dd1ebb92ce X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE37.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB8445 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Defining a number of enum elements in uapi header is meaningless. It will not be used as expected and can potentially lead to incompatible issue between user space application and driver. Signed-off-by: Lizhi Hou Reviewed-by: Mario Limonciello --- include/uapi/drm/amdxdna_accel.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/uapi/drm/amdxdna_accel.h b/include/uapi/drm/amdxdna_accel.h index 92eff83fac1f..a706ead39082 100644 --- a/include/uapi/drm/amdxdna_accel.h +++ b/include/uapi/drm/amdxdna_accel.h @@ -122,7 +122,6 @@ enum amdxdna_drm_config_hwctx_param { DRM_AMDXDNA_HWCTX_CONFIG_CU, DRM_AMDXDNA_HWCTX_ASSIGN_DBG_BUF, DRM_AMDXDNA_HWCTX_REMOVE_DBG_BUF, - DRM_AMDXDNA_HWCTX_CONFIG_NUM }; /**