From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31BFF46A63 for ; Thu, 26 Jun 2025 14:09:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B2D5400D6; Thu, 26 Jun 2025 14:09:11 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2067.outbound.protection.outlook.com [40.107.236.67]) by mails.dpdk.org (Postfix) with ESMTP id 04496400D6 for ; Thu, 26 Jun 2025 14:09:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L5+giR3cOBzWefW2DLCd8wPRlqUpOYk+Yw0hSC3r9R920hhO5sYUSr8oOEqZ2cgE92v0IocJgg0cMTmooNdWEZoFJdrkdZe1o5Ub+19IKTSZx4M/oVI4yYe+D3iSOEbyEk1xsbxRm/S0rGu4JowzX5dPydHuUTcb8SZpLXqb4zxsiFGzT9EPaXs5ew9NcvXEREKM8WwAghOVGICO5EFXZQ6KAzu8JC8roIRqUM5sbDRcWviYGQgUhZNj/eFBdAfY0doSoOdAl1vnBiVjq9IFdKO/xLjfPBUgdy9DDuC80EKHbFnULUuE9BJdFw7WNClJIYj6MV0mBxJRNvsdgtmsrg== 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=U1RYCbxlqf2PlFuAUPUchwwoefxTiUVhbRzorbp+Mdc=; b=uPMl857DSs+oi8L6iFw+Y+TW1gXoBMaz++mO6PMzziR5IJHh5U4FN7mzImKc6Q23+gbZ1QGZt8MyEmRLKtQHKJ3Zq1P6ZkNi9W3HhPUkOljtGErU24ExPTUaPQ/daUJs14AG5YnnAqGdffnEflYChkBhLh5gML5bAbJoK5MpKNDTHcfhbLh2XM53efqWeAwdgQjFZN360Wo8f1CwIT5wnGog47Tm30L258ExRcFp81BI+g0Iipm744j+EFKv63jiyxb1bu3YfCYM1olxYMCiPHU3Y1JtYlDo6Bp5lWqnz28zml1ah33kLQ3MeluFxnZaC4FdooRNYaCqNlq8Tyhlow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (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=U1RYCbxlqf2PlFuAUPUchwwoefxTiUVhbRzorbp+Mdc=; b=Vr+HNigOK26agfdwUaYHCI6ZTMFfo2FhEuA7c2sJ/nfpTQOTW8HmHi78/5VwJ+nSKRPiQfC6dRWigZpXw6prt/iz9mNjf00UBzUso8eqDAvPMO50CrGVOg1oMnQXB2hVAR0wbSMGm+6iOEpBknLHMBSq5qjHfBx/Wkd+E1I/b/5j4kVXwIhIyqvKvbFLplBiKkGO0M674XELwo/BAZl1SxceqjYyjwt0QWgWcKnc/Kkm4cyLTFP/h/stu87fGTqHygoYNxA8HsgMZV2r5u/iNaLH41VEiY/sFXovOe8nFDCJqj64luCvlA6Dg5Pi+XpOftAVOw/NqenZRgqS5mNMGg== Received: from BYAPR02CA0048.namprd02.prod.outlook.com (2603:10b6:a03:54::25) by PH8PR12MB7303.namprd12.prod.outlook.com (2603:10b6:510:220::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.16; Thu, 26 Jun 2025 12:09:05 +0000 Received: from SJ5PEPF000001D5.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::7b) by BYAPR02CA0048.outlook.office365.com (2603:10b6:a03:54::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8880.17 via Frontend Transport; Thu, 26 Jun 2025 12:09:05 +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 SJ5PEPF000001D5.mail.protection.outlook.com (10.167.242.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.14 via Frontend Transport; Thu, 26 Jun 2025 12:09:05 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Thu, 26 Jun 2025 05:08:51 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 26 Jun 2025 05:08:50 -0700 From: Xueming Li To: Bruce Richardson CC: Xueming Li , Kevin Laatz , dpdk stable Subject: patch 'power/intel_uncore: fix crash closing uninitialized driver' has been queued to stable release 23.11.5 Date: Thu, 26 Jun 2025 20:01:38 +0800 Message-ID: <20250626120145.27369-79-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250626120145.27369-1-xuemingl@nvidia.com> References: <20250626120145.27369-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D5:EE_|PH8PR12MB7303:EE_ X-MS-Office365-Filtering-Correlation-Id: b88bbe79-7dc4-4cc3-84f8-08ddb4aa3f52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WfgGhAX6RbugknW04cHADN2dFJXc9nsek0//2LACJycGxzw9k/LTgm0GcuRn?= =?us-ascii?Q?giDHd0rFZufcz9MlK4f2IAcigqCS80u5dbaS/Scn08YxLX3/q4R2YEl4vrIq?= =?us-ascii?Q?cqXNl39rRK0pHnjM1BK4qIANP6UkcFy0ElaXIAD0vDrKFGhV5LmrNFwnS/qQ?= =?us-ascii?Q?Mfy2k8X9UbmFalQWtjwwKRmO8I/QaMOSzeWYWzGX8b+a1HkxP4QlTEoSZxNe?= =?us-ascii?Q?h+bqqw5L1g5CCx37FNtONA0u4tMNg7osrA72Tpt6KnDHY53SCY7KVL7EBYID?= =?us-ascii?Q?JiYs9JrUga0W2uuAaWXFW0KxKXYj9pjXW/cQjol8Q2zRmfylZMN0SQINE+HC?= =?us-ascii?Q?x5K3aZM6iLhxCo8rAI5j+Guf0LO6KARVHNKsSC/7sBvHDnC+egBfNVzgpXoV?= =?us-ascii?Q?0mHdh4/fFSLkoxBWapNT0uHOYcNtTihkA8OfApElzpIeVSgI1/qzT8195uFR?= =?us-ascii?Q?zDVf/NB9CvA3TV+GBVbdYSTwJilHKR5eiqJ3j5c90gJYxQE7MwEhdEeNqKDK?= =?us-ascii?Q?DMGh/mxgcFmeBjW7lXUW9xicI/smXcXOCaKhWhSZR6B3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29YX84NUC2vxgoqjnYb+aWepD5AfOVFGI2K?= =?us-ascii?Q?PZ8jxfXy204S0n2nqWks2/taTv+VhtRAEWYhb1ZZjvIi1j1WIBkB2cGGbw?= =?us-ascii?Q?=3D=3D?= 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)(36860700013)(376014)(82310400026)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2025 12:09:05.5801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b88bbe79-7dc4-4cc3-84f8-08ddb4aa3f52 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: SJ5PEPF000001D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7303 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/28/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=16af361233f7d8a9bcf818a8e7062a94cc656381 Thanks. Xueming Li --- >From 16af361233f7d8a9bcf818a8e7062a94cc656381 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 15 May 2025 17:58:53 +0100 Subject: [PATCH] power/intel_uncore: fix crash closing uninitialized driver Cc: Xueming Li [ upstream commit 74c4b081825123350578f18dc838ec0bf69ba03b ] When the power_intel_uncore_autotest unit test is run as an unprivileged user which cannot init the power library, it crashes the unit test binary due to calling "rte_power_uncore_exit" after the first test case (initialization) fails. This crash is due to trying to write to NULL file handles. Fix the crash by checking each file handle is non-null before writing to it and closing it. Fixes: 60b8a661a957 ("power: add Intel uncore frequency control") Signed-off-by: Bruce Richardson Acked-by: Kevin Laatz --- lib/power/power_intel_uncore.c | 35 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/power/power_intel_uncore.c b/lib/power/power_intel_uncore.c index be174dce44..2a6977e332 100644 --- a/lib/power/power_intel_uncore.c +++ b/lib/power/power_intel_uncore.c @@ -307,27 +307,28 @@ power_intel_uncore_exit(unsigned int pkg, unsigned int die) ui = &uncore_info[pkg][die]; - if (fprintf(ui->f_cur_min, "%u", ui->org_min_freq) < 0) { - RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " - "pkg %02u die %02u\n", ui->pkg, ui->die); - return -1; + if (ui->f_cur_min != NULL) { + if (fprintf(ui->f_cur_min, "%u", ui->org_min_freq) < 0) { + RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " + "pkg %02u die %02u\n", ui->pkg, ui->die); + return -1; + } + fflush(ui->f_cur_min); + fclose(ui->f_cur_min); + ui->f_cur_min = NULL; } - if (fprintf(ui->f_cur_max, "%u", ui->org_max_freq) < 0) { - RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " - "pkg %02u die %02u\n", ui->pkg, ui->die); - return -1; + if (ui->f_cur_max != NULL) { + if (fprintf(ui->f_cur_max, "%u", ui->org_max_freq) < 0) { + RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " + "pkg %02u die %02u\n", ui->pkg, ui->die); + return -1; + } + fflush(ui->f_cur_max); + fclose(ui->f_cur_max); + ui->f_cur_max = NULL; } - fflush(ui->f_cur_min); - fflush(ui->f_cur_max); - - /* Close FD of setting freq */ - fclose(ui->f_cur_min); - fclose(ui->f_cur_max); - ui->f_cur_min = NULL; - ui->f_cur_max = NULL; - return 0; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-26 19:59:20.659116207 +0800 +++ 0078-power-intel_uncore-fix-crash-closing-uninitialized-d.patch 2025-06-26 19:59:17.506418039 +0800 @@ -1 +1 @@ -From 74c4b081825123350578f18dc838ec0bf69ba03b Mon Sep 17 00:00:00 2001 +From 16af361233f7d8a9bcf818a8e7062a94cc656381 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 74c4b081825123350578f18dc838ec0bf69ba03b ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ - drivers/power/intel_uncore/intel_uncore.c | 35 ++++++++++++----------- + lib/power/power_intel_uncore.c | 35 +++++++++++++++++----------------- @@ -24,4 +26,4 @@ -diff --git a/drivers/power/intel_uncore/intel_uncore.c b/drivers/power/intel_uncore/intel_uncore.c -index 804ad5d755..6759ea1445 100644 ---- a/drivers/power/intel_uncore/intel_uncore.c -+++ b/drivers/power/intel_uncore/intel_uncore.c +diff --git a/lib/power/power_intel_uncore.c b/lib/power/power_intel_uncore.c +index be174dce44..2a6977e332 100644 +--- a/lib/power/power_intel_uncore.c ++++ b/lib/power/power_intel_uncore.c @@ -33,2 +35,2 @@ -- POWER_LOG(ERR, "Fail to write original uncore frequency for " -- "pkg %02u die %02u", ui->pkg, ui->die); +- RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " +- "pkg %02u die %02u\n", ui->pkg, ui->die); @@ -38,2 +40,2 @@ -+ POWER_LOG(ERR, "Fail to write original uncore frequency for pkg %02u die %02u", -+ ui->pkg, ui->die); ++ RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " ++ "pkg %02u die %02u\n", ui->pkg, ui->die); @@ -48,2 +50,2 @@ -- POWER_LOG(ERR, "Fail to write original uncore frequency for " -- "pkg %02u die %02u", ui->pkg, ui->die); +- RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " +- "pkg %02u die %02u\n", ui->pkg, ui->die); @@ -53,2 +55,2 @@ -+ POWER_LOG(ERR, "Fail to write original uncore frequency for pkg %02u die %02u", -+ ui->pkg, ui->die); ++ RTE_LOG(ERR, POWER, "Fail to write original uncore frequency for " ++ "pkg %02u die %02u\n", ui->pkg, ui->die);