Page MenuHomeFreeBSD

D61521.1794708956.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61521.1794708956.diff

diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -423,22 +423,29 @@
return;
}
- /* We only support three levels for now. */
+ /*
+ * Each level reports the shift that addresses the next level up, so
+ * the shift of the last level enumerated is the package's. Leaf 1Fh
+ * may enumerate module, tile, die and die group levels above the core
+ * level; they are not represented in the topology, but they must not
+ * be mistaken for the package boundary.
+ */
for (i = 0; ; i++) {
cpuid_count(leaf, i, p);
bits = p[0] & 0x1f;
type = (p[2] >> 8) & 0xff;
- if (type == 0)
+ /* A level without logical processors also ends the list. */
+ if (type == 0 || (p[1] & 0xffff) == 0)
break;
+ pkg_id_shift = bits;
if (type == CPUID_TYPE_SMT)
core_id_shift = bits;
- else if (type == CPUID_TYPE_CORE)
- pkg_id_shift = bits;
- else if (bootverbose)
- printf("Topology level type %d shift: %d\n", type, bits);
+ else if (type != CPUID_TYPE_CORE && bootverbose)
+ printf("Topology level type %d shift: %d\n", type,
+ bits);
}
if (pkg_id_shift < core_id_shift) {

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 2:15 AM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41731927
Default Alt Text
D61521.1794708956.diff (1 KB)

Event Timeline