Skip to content

Commit aa28991

Browse files
darcariij-intel
authored andcommitted
platform/x86/intel: power-domains: Use topology_logical_package_id() for package ID
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 <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent b0908e0 commit aa28991

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)