Topstep1
Enthusiast
Enthusiast

ESXi 7.0e with Ryzen 5950x

I would like to add code to a vmx file like this:

cpuid.0.eax = "0000:0000:0000:0000:0000:0000:0000:1011"
cpuid.0.ebx = "0111:0101:0110:1110:0110:0101:0100:0111"
cpuid.0.ecx = "0110:1100:0110:0101:0111:0100:0110:1110"
cpuid.0.edx = "0100:1001:0110:0101:0110:1110:0110:1001"
cpuid.1.eax = "0000:0000:0000:0001:0000:0110:0111:0001"
cpuid.1.ebx = "0000:0010:0000:0001:0000:1000:0000:0000"
cpuid.1.ecx = "1000:0010:1001:1000:0010:0010:0000:0011"
cpuid.1.edx = "0000:0111:1000:1011:1111:1011:1111:1111"

but that would expose the AVX2 feature of my AMD 5950x Processor. I think the code is masking the AMD Processor. Whatever it's doing works, but I need to be able to see (and use) AVX2 inside a custom Guest 

Can anyone provide similar code to try?

 

Kind Regards

 

ps I think this represents an older duel core processor that does not support AVX so I need the same syntax but a more modern Intel processor. I know  i7-7700k works. 

0 Kudos
2 Replies
jrmunday
Commander
Commander

What guest OS are you running and what VM compatibility/ hardware version are you using? I think you need version 11 or above.

I wouldn't expect masking to be used to expose a feature, but rather to hide or standardise features (eg. for EVC compatibility). Do you specifically need this masking or can you remove it to start with all features exposed to the guest OS?

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
0 Kudos
bluefirestorm
Champion
Champion

Virtual hardware version 11 exposes the Intel Haswell instructions (which includes AVX2). Have you tried WITHOUT doing any masking? It is possible the application inside the guest VM checks the family/model/stepping first and finds that it is too old and does not proceed to check for AVX2 and thus assumes it does not have it.

It looks like AVX2 feature is identified on the same CPUID function 7 ecx=0, ebx bit 5) on both Intel and AMD CPUs.
https://en.wikipedia.org/wiki/CPUID#EAX=7,_ECX=0:_Extended_Features

Normally it is to mask it out as it is pointless (and possibly dangerous) to pretend to have a feature/instruction that the CPU does not have.
cpuid.7.ebx = "----:----:----:----:----:----:--1-:----"

If the AMD Ryzen 5950X does have AVX2 rightfully there should be no need to do funny masking (assuming ESXi 7.0 recognises Ryzen 5950X).

What does the vmware.log show for the code name? Does it show up as Zen3 or "K10 - Unknown codename" or some other unknown? If it shows up as unknown and that is probably why despite having a virtual hardware version higher than 11 and the guest does not see AVX2 when there is no masking. I don't see Zen 3 CPUs in the VMware HCL for CPUs though.

It is a bad idea to be masking an AMD CPU as an Intel CPU (or viceversa) as some of the extended feature sets are not identified in the same function/register bits. But if you insist on masking it as Intel, I will give this from an Intel 8700-K Coffee Lake. You may not even need the cpuid.7.ebx above.

cpuid.0.eax = "0000:0000:0000:0000:0000:0000:0001:0110"
cpuid.0.ebx = "0111:0101:0110:1110:0110:0101:0100:0111"
cpuid.0.ecx = "0110:1100:0110:0101:0111:0100:0110:1110"
cpuid.0.edx = "0100:1001:0110:0101:0110:1110:0110:1001"
cpuid.1.eax = "0000:0000:0000:1001:0000:0110:1110:1010"
cpuid.1.ebx = "0000:0000:0001:0000:0000:1000:0000:0000"
cpuid.1.ecx = "0111:1111:1111:1010:1111:1011:1111:1111"
cpuid.1.edx = "1011:1111:1110:1011:1111:1011:1111:1111"

The CPUID.0.ebx, ecx, edx is just the vendor string (GenuineIntel instead of AuthenticAMD). The family/model/stepping is in cpuid.1.eax while the standard features set is in cpuid1.ecx, edx.

If you like to double check,
hostCPUID level 00000000, 0: 0x00000016 0x756e6547 0x6c65746e 0x49656e69
hostCPUID level 00000001, 0: 0x000906ea 0x00100800 0x7ffafbff 0xbfebfbff

0 Kudos