From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4A8D32F25E4; Sat, 30 May 2026 16:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780158443; cv=none; b=EJ0G1q21gYx7DKGZUliOIsAuZ/CY7xoIekNWQsqHHlwnurU62gzhe8K5dsMQFO8ffwwFiCHfYTMT8tw14MRAivbuM8isIKCTRAEDcfhzmu+bdsAxFNEpClVk0gWAIdMciw9kWhqnpPbK4JFJMl9MdiA50u0bT2a012eNK4u8gKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780158443; c=relaxed/simple; bh=w7e37lkAiUyNyXWtK5PXo7YlqtWd2hWRGKIpLCUXmSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eADGDlLR22Aid9x+OjDF3IRGBw+mAarr6xR/5V5BqSszxdL1IIF8RhuIGr83HoSGiHBw9deJVMd1ikkV1F497Id1YlGqejYTfh4Nta4fwTisLUmiEYvAeaLLMc8KO0rneUs+xpEDGupq8u+KTc3GGLNLcRAeU3w0e6i7C7sMgTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NFLkTrUo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NFLkTrUo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 247F81F00893; Sat, 30 May 2026 16:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780158442; bh=rSNIKBCSSljLLfrEh4OFM4cLxiy3JGvQC4dOeTXNsJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NFLkTrUo2diXb/z5wO2y/IBOa3iPyznzt8RcETyRQEFrtQcxHA/yPITUp7jvLn0xH rshU0aM1ygfzHd/r+Av1LDLiYX5a+aISko7vt3pBE/ikbCN9PYBD+GPR6yxNOeObqm 5/H2AB7ip3fcV/vuJj8LUeZtzdJtwJbtI8+75JKY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Steve Wahl , Zide Chen , "Peter Zijlstra (Intel)" , Dapeng Mi , Sasha Levin Subject: [PATCH 6.1 051/969] perf/x86/intel/uncore: Skip discovery table for offline dies Date: Sat, 30 May 2026 17:52:55 +0200 Message-ID: <20260530160301.807495957@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zide Chen [ Upstream commit 7b568e9eba2fad89a696f22f0413d44cf4a1f892 ] This warning can be triggered if NUMA is disabled and the system boots with fewer CPUs than the number of CPUs in die 0. WARNING: CPU: 9 PID: 7257 at uncore.c:1157 uncore_pci_pmu_register+0x136/0x160 [intel_uncore] Currently, the discovery table continues to be parsed even if all CPUs in the associated die are offline. This can lead to an array overflow at "pmu->boxes[die] = box" in uncore_pci_pmu_register(), which may trigger the warning above or cause other issues. Fixes: edae1f06c2cd ("perf/x86/intel/uncore: Parse uncore discovery tables") Reported-by: Steve Wahl Signed-off-by: Zide Chen Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dapeng Mi Tested-by: Steve Wahl Link: https://patch.msgid.link/20260313174050.171704-3-zide.chen@intel.com Signed-off-by: Sasha Levin --- arch/x86/events/intel/uncore_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_discovery.c b/arch/x86/events/intel/uncore_discovery.c index 7d454141433c8..a78899a27dcb4 100644 --- a/arch/x86/events/intel/uncore_discovery.c +++ b/arch/x86/events/intel/uncore_discovery.c @@ -311,7 +311,7 @@ bool intel_uncore_has_discovery_tables(void) (val & UNCORE_DISCOVERY_DVSEC2_BIR_MASK) * UNCORE_DISCOVERY_BIR_STEP; die = get_device_die_id(dev); - if (die < 0) + if ((die < 0) || (die >= uncore_max_dies())) continue; parse_discovery_table(dev, die, bar_offset, &parsed); -- 2.53.0