Question

I am working on CPU detection and general environment detection code for my hobby OS. Is there ever a case where CPUID needs to be called multiple times? That is if the system has multiple cores, does the OS need to call CPUID on each core? Same for NUMA.

Both the AMD and Intel CPUID manuals are unclear on this. There is an article on the osdev wiki that mentions calling CPUID called Detecting CPU Topology, but to my reading was not clear as to when and how many times CPUID needs to be called.

Was it helpful?

Solution

Since it's been almost a week and nobody has been able to answer this (probably because of the holidays), I'll attempt to answer this anyway.

I think the answer is yes. You may need to call CPUID on each core. One reason for this is that not all (even x86) systems today are homogeneous.

For example, I've read on an overclocking forum (I can't find the link) that it's possible to mix two different processor models on some dual-socket server boards. The person had a dual-socket 1366 system with two different speed processors. (and different model #s)

So in this case, calling CPUID will depend on which processor the thread was on - therefore you'll need to call it once each processor to get all the information.

In the manuals of one of my server-motherboards, it also states that you are allowed to mix processors of different models (with certain restrictions). And certainly, it's possible to mix two different steppings of the same processor model.


This reason alone (heterogeneous topology), is already reason to need to call CPUID on each core.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top