[vbox-dev] Ring 3 cpuid

Knut St. Osmundsen bird at innotek.de
Wed Jul 11 20:17:46 GMT 2007


Micha Moffie wrote:
> Running a small app calling cpuid (inside a guest) - it looks like i see
> the host cpuid.
> Is that correct?

That is correct for ring-3 (user mode) code. The x86 architecture 
provides no way of intercepting the cpuid instruction and the features 
we mask off for ring-0 (kernel mode) code (like PAE, AMD64, frequency 
control, etc) will show up there. In ring-0 we rely on CSAM & PATM to 
find and patch the cpuid instructions since it is vital that the kernel 
get the right idea about the hardware. While for ring-3 code scanning 
the code would be way to costly, and we trade in some correctness for 
speed (like most of the other VM solution).

The cpuid instruction is of course address by VT-x / AMD-V and will not 
be an issue if you have such hardware and tell VirtualBox to make use of it.

Kind Regards,
  knut




More information about the vbox-dev mailing list