VMware Communities
Bubba_Hotepp
Contributor
Contributor

Is it possible to "mask" the CPUID in Workstation?

Basically what I want to do is to be able to "mask" the CPUID in a VM for testing purposes.  For example be able to make the software think it's running on an Intel CPU on an AMD host machine.  I've tried to edit the .vmx file with ecx,edx etc. values and during the XP install process on the first screen it locks up when it says "starting windows" in the grey bar.  Anyone have any idea how to accomplish this?

27 Replies
Bernd_Nowak
Hot Shot
Hot Shot

From my knowledge, which is limited, you can't hide intel cpu and let it appear as AMD cpu or vice versa. The reason is that the CPU is not emulated.

You can however try to mask some features of a newer CPU to look like an older CPU. This was used for ESX server farms where different generations of CPUs had been used and you wanted to use vMotion between different CPUs from the same vendor (AMD/Intel). Today you can use EVC for this but for sure the farm is then limited to the 'oldest' cpu if you wish to use vMotion across different CPU generations.

So in short I would tend to say no. 

0 Kudos
admin
Immortal
Immortal

Yes, it is possible to mask the CPUID values in a VM (except for user mode code when using binary translation).  However, masking only changes what CPUID reports; it doesn't change the way the processor behaves.  Thus, masking may cause unexpected guest behavior.

The general format for CPUID masking is:

cpuid.<leaf>.<register> = xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx

The right hand side is a binary representation of the desired value, most significant bit first.  Aside from '0' and '1,' two other important symbols are 'h,' which means to pass through the bit from the host CPUID and '-,' which means not to override the normal handling for this bit.

Specifying a different CPU vendor is not recommended.

Bubba_Hotepp
Contributor
Contributor

I won't be running this permanently.  Basically this VM will just be used in the short term for testing for "CPU Dispatcher" bias in certain programs.  So "complete compatibility" (i.e. optimization flags etc) isn't a huge concern ATM.  Here's what I tried.  I opened up the .vmx file (was I wrong to use word to edit it?)  and added the values specified at this site after the "CPUID" line that specifies cores -

http://www.agner.org/optimize/blog/read.php?i=49#73

Can't seem to get it to work though so obviously I'm doing something wrong :smileylaugh:

0 Kudos
admin
Immortal
Immortal

Please upload your configuration file.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

With no edits -

0 Kudos
admin
Immortal
Immortal

I was hoping to see your edits. 🙂

In any event, the first thing to do is to pretend to be an AMD CPU.  These settings should accomplish that:

cpuid.0.ebx = "0110:1000:0111:0100:0111:0101:0100:0001"
cpuid.0.ecx = "0100:0100:0100:1101:0100:0001:0110:0011"
cpuid.0.edx = "0110:1001:0111:0100:0110:1110:0110:0101"

Then you want to claim the family, model, and stepping of an actual AMD CPU.  This setting should do that (claiming to be an early 64-bit Opteron):


cpuid.1.eax="----:0000:0000:0000:----:1111:0100:0110"

Even with these settings, some guests may still be unhappy.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

I have an FX CPU that I want to show up as Intel in the VM.  This is with the lines I inserted.

0 Kudos
admin
Immortal
Immortal

Each option should be on its own line.  You might want to use notepad instead of Word.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

Sorry, I meant I'm using wordpad to edit it.  Did I put the lines in the wrong spot?  Is the CPUID line that's already there conflicting with what I'm adding?

0 Kudos
admin
Immortal
Immortal

The problem is that all of the options are strung together on the same line.  You need a line break between each one.  Try notepad.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

Okay, I'm not understanding what you're saying.  I have eax, abx etc with each having their own line.

Edit - Oooohh....I see.  In notepad it's all strung together.  When I open it in wordpad it looks correct.  Got it.   let me give that a try.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

How does that look now?

0 Kudos
admin
Immortal
Immortal

That looks good.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

It boots up the VM but doesn't change the CPUID (checked with CPU-Z)

0 Kudos
admin
Immortal
Immortal

If you are running user level code under binary translation, the CPUID information cannot be masked.

(Well, it can, but only if you disable acceleration.)

0 Kudos
Bubba_Hotepp
Contributor
Contributor

So you're saying there's no way to make software (such as benchmarks) to "see" a different CPUID using VMWare.

0 Kudos
admin
Immortal
Immortal

You can either use hardware-assisted virtualization (on supported processors) or disable acceleration for binary translation.  This option is available on the processors tab of your VM settings.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

Gotcha....let me try that.

0 Kudos
Bubba_Hotepp
Contributor
Contributor

It locks up after getting to windows loader.

0 Kudos