soc/intel/xeon_sp/spr: Add comments for get_thread_count

Add comments to clarify the usage of logical core count instead of
physical core count.

TEST=Build and boot on intel/archercity CRB

Change-Id: I2bc94391f060cec9de91183021da03bc5c7438c0
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82097
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Shuo Liu 2024-04-28 18:42:15 +08:00 committed by Lean Sheng Tan
parent f063604c33
commit 13a3c3a144

View File

@ -224,6 +224,12 @@ static int get_thread_count(void)
{ {
unsigned int num_phys = 0, num_virts = 0; unsigned int num_phys = 0, num_virts = 0;
/*
* This call calculates the thread count which is corresponding to num_virts
* (logical cores), while num_phys is corresponding to physical cores (in SMT
* system, one physical core has multiple threads, a.k.a. logical cores).
* Hence num_phys is not actually used.
*/
cpu_read_topology(&num_phys, &num_virts); cpu_read_topology(&num_phys, &num_virts);
printk(BIOS_SPEW, "Detected %u cores and %u threads\n", num_phys, num_virts); printk(BIOS_SPEW, "Detected %u cores and %u threads\n", num_phys, num_virts);
return num_virts * soc_get_num_cpus(); return num_virts * soc_get_num_cpus();