I am developing a bare metal program. The platform is x86, 32 bit, protected mode, I am at ring 0. I would like to enable AVX by using xsetgv instruction. 18th bit of CR4 is 1, if I use xgetgv then nothing wrong happens, but the xsetgv crashes (the virtualbox reports fatal error). The problematic code is the following:
mov ecx, 0
mov eax, 0x7
mov edx, 0
xsetbv
What is the problem?
grep avx /proc/cpuinfo
or something. – Peter Cordes