How can I force VirtualBox GuestOS CPUID to match HostOS?

2

I'm attempting to test some cross-platform software on a Windows VM running in VirtualBox, but when I run the program it crashes with the error code: 0xC00000ID: Illegal Operation.

When I view the disassembly at that point, I can see that it's a VMOVUPS instruction (part of the AVX instruction set). It runs through fine on my Linux HostOS, which I'd expect since I'm running on a machine with AVX support. The interesting thing is that the CPUID result on the host doesn't match the result on the guest.

Host:

IN:  eax=0x00000001 
OUT: eax=0x000206a7 ebx=0x05100800 ecx=0x1fbae3ff edx=0xbfebfbff

Guest:

IN:  eax=0x00000001 
OUT: eax=0x000206a7 ebx=0x00000800 ecx=0x00000209 edx=0x078bfbff

I've attempted to set the CPU features with the following commands but this hasn't changed the values at all.

vboxmanage modifyvm Windows --cpuidset 00000001 000206a7 00100800 1fbae3ff bfebfbff

Is there some reason why VirtualBox might be missing these CPU features (AVX, SSE4, etc) which should be there?

P.S. In case it's relevant, the VM image was generated some time ago, probably on a machine without AVX support, but I'd still expect the modifyvm command or even a cold boot to fix it.


Update: It looks like my Virtualbox version (4.0.3) wasn't passing along AVX instructions to the CPU. Updating to v5.0.8 fixed my problem but people using AVX2 might not be so lucky for the time being.

assembly
visual-studio-2015
x86
virtualbox
avx
asked on Stack Overflow Nov 4, 2015 by Matt O • edited Sep 11, 2019 by Michael Petch

1 Answer

2

VirtualBox earlier than 5.0 beta-3 did not support the AVX instruction set and were not passed through to the CPU. This is according to this Oracle VirtualBox bug report. Downloading and installing a version >= 5.0 beta-3 should do the trick.

answered on Stack Overflow Nov 4, 2015 by Michael Petch • edited Nov 4, 2015 by Matt O

User contributions licensed under CC BY-SA 3.0