Skip to content

Commit 74286dd

Browse files
darcarigregkh
authored andcommitted
platform/x86/intel: power-domains: Use topology_logical_package_id() for package ID
[ Upstream commit aa28991 ] Currently, tpmi_get_logical_id() calls topology_physical_package_id() to set the pkg_id of the info structure. Since some VM hosts assign non contiguous package IDs, topology_physical_package_id() can return a larger value than topology_max_packages(). This will result in an invalid reference into tpmi_power_domain_mask[] as that is allocatead based on topology_max_packages() as the maximum package ID. Fixes: 17ca278 ("platform/x86/intel: TPMI domain id and CPU mapping") Signed-off-by: David Arcari <darcari@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250829113859.1772827-1-darcari@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cbb4ff4 commit 74286dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/intel/tpmi_power_domains.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int tpmi_get_logical_id(unsigned int cpu, struct tpmi_cpu_info *info)
178178

179179
info->punit_thread_id = FIELD_GET(LP_ID_MASK, data);
180180
info->punit_core_id = FIELD_GET(MODULE_ID_MASK, data);
181-
info->pkg_id = topology_physical_package_id(cpu);
181+
info->pkg_id = topology_logical_package_id(cpu);
182182
info->linux_cpu = cpu;
183183

184184
return 0;

0 commit comments

Comments
 (0)