MattPietrek wrote:
I'm trying to get a solid grasp on the exact meaning of the hostCPUID, userCPUID and guestCPUID entries in the vmware.log file.
I well versed in CPU masking and I know how to modify masks with cpuid.<number>.<register>= "XXXXXXX".
I assume that the "host" in hostCPUID is the actual raw CPUID bits reported to ESXi by the host's cpu.
What's less clear is exactly what the "guest" and "user" values represent. Based on the name, guestCPUID looks like the feature bits exposed to the VM. However, I can't see how the guestCPUID is arrived at, given the hostCPUID and my own cpuid.<num>.<register> masking. Perhaps there's some other implicit mask factored in as well?
And finally "userCPUID' is totally baffling to me. Perhaps something to do with CPUID features in some non ring-0 mode?
Any clarification would be very helpful. Many hours of Google searches aren't turning up obvious answers.
Thanks,
Matt
You're basically correct. GuestCPUID represents the feature bits exposed to the VM. In addition to your masking, there are masks applied based on the capabilities supported by the virtual hardware.
UserCPUID is what will be visible to the guest ring-3 code running natively when using binary translation. With binary translation, typically only ring-0 (or IOPL-3) code is subject to binary translation. Most ring-3 code runs natively (in a mode we refer to as "direct execution.") Prior to the introduction of CPUID faulting, there was no way to intercept guest execution of the CPUID instruction when the guest was running under direct execution. Some CPUs support a limited ability to override the results of some CPUID leaves (on a register by register basis) even without intercepting the CPUID instruction. Hence, userCPUID is based on hostCPUID, but the registers that can be overriden have guestCPUID values.
These fields are rewritten at each power-on, so there is little point in changing them manually.