Skip to content

Commit

Permalink
windows: don't use uninitialized memory for selecting group kinds
Browse files Browse the repository at this point in the history
procInfo[i] is garbage, use procInfo to get relation information
when setting group kinds.

Thanks to this fix, I now confirm that Windows 11 is able to report
"Module" objects, at least on Intel MeteorLake CPUs. hwloc exposes
them a "Module" groups which are usually merged into L2 caches.
Ref #480

By the way, remove an obsolete comment nearby

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Sep 6, 2024
1 parent 375b2da commit 1dc4faf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hwloc/topology-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ hwloc_look_windows(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
type = HWLOC_OBJ_DIE;
num = procInfo->Processor.GroupCount;
GroupMask = procInfo->Processor.GroupMask;
/* TODO: have the core filter-out DIE if they *ALL* are identical to packages */
break;
case RelationProcessorModule:
type = HWLOC_OBJ_GROUP;
Expand Down Expand Up @@ -1234,7 +1233,7 @@ hwloc_look_windows(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
}
break;
case HWLOC_OBJ_GROUP:
switch (procInfo[i].Relationship) {
switch (procInfo->Relationship) {
case RelationGroup:
obj->attr->group.kind = HWLOC_GROUP_KIND_WINDOWS_PROCESSOR_GROUP;
break;
Expand Down

0 comments on commit 1dc4faf

Please sign in to comment.