Repository navigation
Encode AMD family 16 and later correctly in the ProcessorID - #3792
Conversation
createProcessorID builds the x86 processor signature (CPUID leaf 1 EAX) from the displayed family, model and stepping when no platform source supplies one. A family above 15 is defined as a base family of 15 plus an extended family, but the encoder split the family's own bits between the two fields: family 23 (AMD Zen) became base 7 / extended 1, giving 00100712 instead of 00800F12. Every AMD processor from family 16 (K10) on was affected; Intel's families 6 and 15 were already correct. This is the inverse of the decoding bug fixed in oshi#3789. The encoded value is used on Linux when neither dmidecode nor cpuid is available, on Solaris, and on Windows when WMI returns no ProcessorId. Tests encode Zen and Zen 4 against known signatures, and round-trip six real Intel and AMD signatures through cpuidToFamilyModelStepping and back.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No identified issue needs resolution before merging. The processor ID correction is ready for normal checks. Pre-merge checks |
|
AbstractCentralProcessor.createProcessorIDrebuilds the x86 processor signature (CPUID leaf 1 EAX) from the displayed family, model and stepping when no platform source supplies one.Bug
A family above 15 is defined as a base family of 15 (bits 11:8) plus an extended family (bits 27:20). The encoder instead split the family's own bits between the two fields, so family 23 (AMD Zen) became base 7 / extended 1:
00100712instead of00800F12. Every AMD processor from family 16 (K10) on got a wrongProcessorID. Intel families 6 and 15 were already correct.This is the inverse of the decoding bug fixed in #3789.
Where the encoded value is used
dmidecode(root) norcpuidis available, which is common for unprivileged usersProcessorIdTests
23/1/2→00800F12) and Zen 4 (25/97/2→00A60F12) against known signatures.cpuidToFamilyModelSteppingand back unchanged.Not verified on AMD hardware: I have no AMD machine to hand, and CI's Linux runners usually take the ID from
dmidecode.Summary by CodeRabbit