Skip to content

Invalid opcode vzeroupper

Host environment

  • Operating system: Windows 11
  • OS/kernel version: (For POSIX hosts, use uname -a)
  • Architecture: x86_64 (AMD Ryzen™ 9 5950X)
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: QEMU emulator version 6.2.0 (v6.2.0-11889-g5b72bf03f5-dirty)
  • QEMU command line:
qemu-system-x86_64.exe \
  -display gtk,show-cursor=on,grab-on-hover=on,gl=off,zoom-to-fit=off \
  --accel whpx \
  -smp 10 \
  -m 10G \
  -k en \
  -drive file=${IMAGE},if=virtio \
  -device virtio-vga \
  -device virtio-net,netdev=vmnic -netdev user,id=vmnic \
  -usbdevice tablet 

Emulated/Virtualized environment

  • Operating system: Fedora 36
  • OS/kernel version: Linux fedora 5.17.3-300.fc36.x86_64 #1 SMP PREEMPT Wed Apr 13 23:08:09 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Architecture: x86

Description of problem

Got many invalid opcode error with Fedora 36 See fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=2076410

Crash stack and disassemble.

Downloading separate debug info for /lib64/liblzma.so.5...
Downloading separate debug info for /home/penghuang/Sources/system-supplied DSO at 0x7fff30f55000...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007f89783cbe4a in sha512_block_data_order_avx2 () from /lib64/libgnutls.so.30
[Current thread is 1 (Thread 0x7f8972ada640 (LWP 5083))]
(gdb) bt
#0  0x00007f89783cbe4a in sha512_block_data_order_avx2 () from /lib64/libgnutls.so.30
#1  0x00007f89783bf042 in x86_sha512_update (ctx=0x7f8972ad9090, length=128, data=0x7f8972ad8f90 '\\' <repeats 128 times>, "@\255")
    at sha-x86-ssse3.c:215
#2  0x00007f897810879b in nettle_hmac_set_key (outer=<optimized out>, inner=0x7f8972ad9168, state=<optimized out>, 
    hash=0x7f897848b6c0 <x86_sha384>, key_length=0, key=0x7f89783ff943 "") at /usr/src/debug/nettle-3.7.3-3.fc36.x86_64/hmac.c:83
#3  0x00007f89783bce3a in wrap_x86_hmac_fast (algo=<optimized out>, nonce=<optimized out>, nonce_size=<optimized out>, key=0x7f89783ff943, 
    key_size=0, text=0x7f8972ad9430, text_size=48, digest=0x55a79d80b948) at hmac-x86-ssse3.c:294
#4  0x00007f89782d4b57 in _gnutls_mac_fast (algorithm=GNUTLS_MAC_SHA384, key=0x7f89783ff943, keylen=0, text=0x7f8972ad9430, textlen=48, 
    digest=0x55a79d80b948) at hash_int.c:167
#5  0x00007f89782f524d in gnutls_hmac_fast (algorithm=GNUTLS_MAC_SHA384, key=key@entry=0x7f89783ff943, keylen=keylen@entry=0, 
    ptext=0x7f8972ad9430, ptext_len=ptext_len@entry=48, digest=digest@entry=0x55a79d80b948) at crypto-api.c:640
#6  0x00007f897830d2ff in _tls13_init_secret2 (prf=0x7f897848f888 <hash_algorithms+168>, psk=<optimized out>, psk@entry=0x0, psk_size=48, 
    psk_size@entry=0, out=out@entry=0x55a79d80b948) at secrets.c:59
#7  0x00007f897830d3d0 in _tls13_init_secret (session=session@entry=0x55a79d80a1c0, psk=psk@entry=0x0, psk_size=psk_size@entry=0) at secrets.c:35
#8  0x00007f89782c66c0 in read_server_hello (datalen=<optimized out>, data=<optimized out>, session=0x55a79d80a1c0) at handshake.c:2097
#9  _gnutls_recv_handshake (session=session@entry=0x55a79d80a1c0, type=type@entry=GNUTLS_HANDSHAKE_SERVER_HELLO, optional=optional@entry=0, 
    buf=buf@entry=0x0) at handshake.c:1656
#10 0x00007f89782c8dbb in handshake_client (session=0x55a79d80a1c0) at handshake.c:3072
#11 gnutls_handshake (session=0x55a79d80a1c0) at handshake.c:2871
#12 0x00007f89784a694f in g_tls_connection_gnutls_handshake_thread_handshake (tls=0x55a79d80c250, timeout=<optimized out>, 
    cancellable=<optimized out>, error=0x7f8972ad9b10) at ../tls/gnutls/gtlsconnection-gnutls.c:968
#13 0x00007f89784a8942 in handshake_thread (task=0x7f8968007ec0, object=object@entry=0x55a79d80c250, task_data=task_data@entry=0x55a79d766e60, 
    cancellable=cancellable@entry=0x55a79d748760) at ../tls/base/gtlsconnection-base.c:1564
#14 0x00007f89784a8c02 in async_handshake_thread (task=<optimized out>, object=0x55a79d80c250, task_data=0x55a79d766e60, 
    cancellable=0x55a79d748760) at ../tls/base/gtlsconnection-base.c:1848
#15 0x00007f89882dbaf3 in g_task_thread_pool_thread (thread_data=0x7f8968007ec0, pool_data=<optimized out>) at ../gio/gtask.c:1441
#16 0x00007f8988111b72 in g_thread_pool_thread_proxy (data=<optimized out>) at ../glib/gthreadpool.c:354
#17 0x00007f898810f172 in g_thread_proxy (data=0x55a79d7e1360) at ../glib/gthread.c:827
#18 0x00007f8987efdcc7 in start_thread (arg=<optimized out>) at pthread_create.c:442
#19 0x00007f8987f82e00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)
(gdb) disassemble 
Dump of assembler code for function sha512_block_data_order_avx2:
   0x00007f89783cbe00 <+0>:    mov    %rsp,%rax
   0x00007f89783cbe03 <+3>:    push   %rbx
   0x00007f89783cbe04 <+4>:    push   %rbp
   0x00007f89783cbe05 <+5>:    push   %r12
   0x00007f89783cbe07 <+7>:    push   %r13
   0x00007f89783cbe09 <+9>:    push   %r14
   0x00007f89783cbe0b <+11>:    push   %r15
   0x00007f89783cbe0d <+13>:    sub    $0x520,%rsp
   0x00007f89783cbe14 <+20>:    shl    $0x4,%rdx
   0x00007f89783cbe18 <+24>:    and    $0xfffffffffffff800,%rsp
   0x00007f89783cbe1f <+31>:    lea    (%rsi,%rdx,8),%rdx
   0x00007f89783cbe23 <+35>:    add    $0x480,%rsp
   0x00007f89783cbe2a <+42>:    mov    %rdi,0x80(%rsp)
   0x00007f89783cbe32 <+50>:    mov    %rsi,0x88(%rsp)
   0x00007f89783cbe3a <+58>:    mov    %rdx,0x90(%rsp)
   0x00007f89783cbe42 <+66>:    mov    %rax,0x98(%rsp)
=> 0x00007f89783cbe4a <+74>:    vzeroupper 
   0x00007f89783cbe4d <+77>:    sub    $0xffffffffffffff80,%rsi
   0x00007f89783cbe51 <+81>:    mov    (%rdi),%rax
   0x00007f89783cbe54 <+84>:    mov    %rsi,%r12
   0x00007f89783cbe57 <+87>:    mov    0x8(%rdi),%rbx
   0x00007f89783cbe5b <+91>:    cmp    %rdx,%rsi
   0x00007f89783cbe5e <+94>:    mov    0x10(%rdi),%rcx
   0x00007f89783cbe62 <+98>:    cmove  %rsp,%r12
   0x00007f89783cbe66 <+102>:    mov    0x18(%rdi),%rdx
   0x00007f89783cbe6a <+106>:    mov    0x20(%rdi),%r8
   0x00007f89783cbe6e <+110>:    mov    0x28(%rdi),%r9
   0x00007f89783cbe72 <+114>:    mov    0x30(%rdi),%r10
   0x00007f89783cbe76 <+118>:    mov    0x38(%rdi),%r11
   0x00007f89783cbe7a <+122>:    jmp    0x7f89783cbe80 <sha512_block_data_order_avx2+128>
   0x00007f89783cbe7c <+124>:    nopl   0x0(%rax)
Edited by Peng Huang
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information