qemu x86 TCG doesn't support AVX insns
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Expired
|
Undecided
|
Unassigned |
Bug Description
I'm trying to execute code that has been built with -march=skylake -mtune=generic -mavx2 under qemu-user x86-64 with -cpu Skylake-Client. However this code just hangs at 100% CPU.
Adding input tracing shows that it is likely hanging when dealing with an AVX instruction:
warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn't support requested feature: CPUID.01H:
warning: TCG doesn't support requested feature: CPUID.01H:
warning: TCG doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.f16c [bit 29]
warning: TCG doesn't support requested feature: CPUID.01H:
warning: TCG doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
warning: TCG doesn't support requested feature: CPUID.07H:
warning: TCG doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
warning: TCG doesn't support requested feature: CPUID.07H:
warning: TCG doesn't support requested feature: CPUID.80000001H
warning: TCG doesn't support requested feature: CPUID.0DH:
IN:
0x4000b4ef3b: c5 fb 5c ca vsubsd %xmm2, %xmm0, %xmm1
0x4000b4ef3f: c4 e1 fb 2c d1 vcvttsd2si %xmm1, %rdx
0x4000b4ef44: 4c 31 e2 xorq %r12, %rdx
0x4000b4ef47: 48 85 d2 testq %rdx, %rdx
0x4000b4ef4a: 79 9e jns 0x4000b4eeea
[ hangs ]
Attaching a gdb produces this stacktrace:
(gdb) bt
#0 canonicalize (status=
at /data/poky-
#1 float64_
at /data/poky-
#2 float64_sub (a=0, b=4890909195324
at /data/poky-
#3 0x000055a20baa1949 in helper_subsd (env=<optimized out>, d=0x55a20ff67ad8, s=<optimized out>)
at /data/poky-
#4 0x000055a20cfcfea8 in static_
#5 0x000055a20ba3f764 in cpu_tb_exec (itb=<optimized out>, cpu=0x55a20cea2180 <static_
at /data/poky-
#6 cpu_loop_exec_tb (tb_exit=<synthetic pointer>, last_tb=<synthetic pointer>, tb=<optimized out>,
cpu=
at /data/poky-
#7 cpu_exec (cpu=cpu@
at /data/poky-
#8 0x000055a20ba6d728 in cpu_loop (env=0x55a20ff6
at /data/poky-
#9 0x000055a20ba049ff in main (argc=<optimized out>, argv=0x7ffc5857
at /data/poky-
summary: |
- qemu-user-x86-64 hangs at vcvttsd2si + qemu x86 TCG doesn't support AVX insns |
<pm215> my guess is we're doing something unhelpful with the AVX insn, and so the guest code which is checking the result and using it as its loop condition for the jns is just looping forever
<rburton> in_asm log just stopped with this as the last line
<rburton> 0x4000b4ef4a: 79 9e jns 0x4000b4eeea