@@ -357,7 +357,7 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns
357
357
* (AMD topology extension)
358
358
*/
359
359
if (cpuid_type != intel && has_topoext (features )) {
360
- unsigned apic_id , node_id , nodes_per_proc , unit_id , cores_per_unit ;
360
+ unsigned apic_id , node_id , nodes_per_proc ;
361
361
362
362
eax = 0x8000001e ;
363
363
cpuid_or_from_dump (& eax , & ebx , & ecx , & edx , src_cpuiddump );
@@ -377,13 +377,21 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns
377
377
hwloc_debug ("warning: undefined nodes_per_proc value %d, assuming it means %d\n" , nodes_per_proc , nodes_per_proc );
378
378
}
379
379
380
- infos -> unitid = unit_id = ebx & 0xff ;
381
- cores_per_unit = ((ebx >> 8 ) & 0xff ) + 1 ;
382
- hwloc_debug ("topoext %08x, %d nodes, node %d, %d cores in unit %d\n" , apic_id , nodes_per_proc , node_id , cores_per_unit , unit_id );
383
- /* coreid and unitid are package-wide (core 0-15 and unit 0-7 on 16-core 2-NUMAnode processor).
384
- * The Linux kernel reduces theses to NUMA-node-wide (by applying %core_per_node and %unit_per node respectively).
385
- * It's not clear if we should do this as well.
386
- */
380
+ if (infos -> cpufamilynumber <= 0x16 ) { /* topoext appeared in 0x15 and compute-units were only used in 0x15 and 0x16 */
381
+ unsigned unit_id , cores_per_unit ;
382
+ infos -> unitid = unit_id = ebx & 0xff ;
383
+ cores_per_unit = ((ebx >> 8 ) & 0xff ) + 1 ;
384
+ hwloc_debug ("topoext %08x, %d nodes, node %d, %d cores in unit %d\n" , apic_id , nodes_per_proc , node_id , cores_per_unit , unit_id );
385
+ /* coreid and unitid are package-wide (core 0-15 and unit 0-7 on 16-core 2-NUMAnode processor).
386
+ * The Linux kernel reduces theses to NUMA-node-wide (by applying %core_per_node and %unit_per node respectively).
387
+ * It's not clear if we should do this as well.
388
+ */
389
+ } else {
390
+ unsigned core_id , threads_per_core ;
391
+ infos -> coreid = core_id = ebx & 0xff ;
392
+ threads_per_core = ((ebx >> 8 ) & 0xff ) + 1 ;
393
+ hwloc_debug ("topoext %08x, %d nodes, node %d, %d threads in core %d\n" , apic_id , nodes_per_proc , node_id , threads_per_core , core_id );
394
+ }
387
395
388
396
for (cachenum = 0 ; ; cachenum ++ ) {
389
397
eax = 0x8000001d ;
0 commit comments