NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/50332: AVX instructions don't work but OSXSAVE flag is set

>Number:         50332
>Category:       kern
>Synopsis:       AVX instructions don't work but OSXSAVE flag is set
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 12 20:15:00 +0000 2015
>Originator:     TG
>Release:        7.0
NetBSD 7.0 NetBSD 7.0 (XEN3_DOM0.201509250726Z) amd64

Apparently, NetBSD sets the OSXSAVE flag without supporting AVX instructions, at least under Xen 4.5.1.  I cannot test this on bare metal, since all my NetBSD machines run Xen.

For what it is worth, the problem happens in both the Dom0 and DomU.
cat >foo.c <<EOF
#include <stdio.h>
int main() {
  unsigned int eax, ebx, edx, ecx;
  __asm__ ("cpuid" : "=a" (eax), "=b" (ebx), "=d" (edx), "=c" (ecx) : "0" (1));
  if ((ecx >> 27) & 1) {
    printf("OS claims AVX is supported\n");
    printf("Testing an AVX instruction..."); fflush(stdout);
    __asm__ volatile (".byte 0xc5,0xeb,0x10,0xd9");
    printf("it seems to have worked\n");
  return 0;
gcc foo.c && a.out
OS claims AVX is supported
Testing an AVX instruction...Illegal instruction


Home | Main Index | Thread Index | Old Index