Skip to content

Commit 57328e6

Browse files
committed
x86: remove the explicit apic_number in leaves 0xb/0x0f
It's the number of logical procs in the next level, but the type of that level isn't known in advance anyway (contrary to what some comments were sort of saying, which could confuse future changes). And we don't use that number anyway, just keep it in debugging messages. Signed-off-by: Brice Goglin <[email protected]>
1 parent 9a54af4 commit 57328e6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

hwloc/topology-x86.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static void read_amd_cores_topoext(struct procinfo *infos, unsigned long flags,
528528
/* Intel core/thread or even die/module/tile from CPUID 0x0b or 0x1f leaves (v1 and v2 extended topology enumeration) */
529529
static void read_intel_cores_exttopoenum(struct procinfo *infos, unsigned leaf, struct cpuiddump *src_cpuiddump)
530530
{
531-
unsigned level, apic_nextshift, apic_number, apic_type, apic_id = 0, apic_shift = 0, id;
531+
unsigned level, apic_nextshift, apic_type, apic_id = 0, apic_shift = 0, id;
532532
unsigned threadid __hwloc_attribute_unused = 0; /* shut-up compiler */
533533
unsigned eax, ebx, ecx = 0, edx;
534534
int apic_packageshift = 0;
@@ -553,33 +553,33 @@ static void read_intel_cores_exttopoenum(struct procinfo *infos, unsigned leaf,
553553
if (!eax && !ebx)
554554
break;
555555
apic_nextshift = eax & 0x1f;
556-
apic_number = ebx & 0xffff;
557556
apic_type = (ecx & 0xff00) >> 8;
558557
apic_id = edx;
559558
id = (apic_id >> apic_shift) & ((1 << (apic_packageshift - apic_shift)) - 1);
560-
hwloc_debug("x2APIC %08x %u: nextshift %u num %2u type %u id %2u\n", apic_id, level, apic_nextshift, apic_number, apic_type, id);
559+
hwloc_debug("x2APIC %08x %u: nextshift %u nextnumber %2u type %u id %2u\n",
560+
apic_id,
561+
level,
562+
apic_nextshift,
563+
ebx & 0xffff /* number of threads in next level */,
564+
apic_type,
565+
id);
561566
infos->apicid = apic_id;
562567
infos->otherids[level] = UINT_MAX;
563568
switch (apic_type) {
564569
case 1:
565570
threadid = id;
566-
/* apic_number is the actual number of threads per core */
567571
break;
568572
case 2:
569573
infos->ids[CORE] = id;
570-
/* apic_number is the actual number of threads per die */
571574
break;
572575
case 3:
573576
infos->ids[MODULE] = id;
574-
/* apic_number is the actual number of threads per tile */
575577
break;
576578
case 4:
577579
infos->ids[TILE] = id;
578-
/* apic_number is the actual number of threads per die */
579580
break;
580581
case 5:
581582
infos->ids[DIE] = id;
582-
/* apic_number is the actual number of threads per package */
583583
break;
584584
default:
585585
hwloc_debug("x2APIC %u: unknown type %u\n", level, apic_type);

0 commit comments

Comments
 (0)