Skip to content

Commit 301b088

Browse files
author
Roman Dubtsov
committed
cpu: xbyak: yet another work around zeroed-out cpuid 0xb leaf
1 parent ff3ffab commit 301b088

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cpu/xbyak/xbyak_util.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ class Cpu {
177177
numCores_[level - 1] = extractBit(data[1], 0, 15);
178178
}
179179
}
180+
/*
181+
Everybody lies, so we need some sane values to fall back on
182+
*/
183+
numCores_[SmtLevel - 1] = std::max(1u, numCores_[SmtLevel - 1]);
184+
numCores_[CoreLevel - 1] = std::max(numCores_[SmtLevel - 1], numCores_[CoreLevel - 1]);
180185
} else {
181186
/*
182187
Failed to deremine num of cores without x2APIC support.

0 commit comments

Comments
 (0)