Cpuid 说我的系统上有 rdrand,但是 rdrand 指令会抛出 sigill。我在 VmWare 工作站 11 中使用 linux mint,我搜索了 rdrand 的工作站支持,他们说它从第 9 版开始启用。主机进程是i5-2550k,应该支持rdrand。我能以某种方式解决这个问题吗?这是 gdb 清单:
Breakpoint 1, 0x08048060 in _start ()
(gdb) x/5i $eip
=> 0x8048060 <_start>: mov $0x1,%eax
0x8048065 <_start+5>: cpuid
0x8048067 <_start+7>: rdrand %eax
0x804806a <_start+10>: mov $0x1,%eax
0x804806f <_start+15>: int $0x80
(gdb) si 2
0x08048067 in _start ()
(gdb) p/t $ecx
$1 = 10011111101110100010001000000011 ; bit 30 is set -- rdrand enabled.
(gdb) p/t $ebx
$2 = 10000100000000000
(gdb) p/t $eax
$3 = 100000011010100111
(gdb) si
Program received signal SIGILL, Illegal instruction.
0x08048067 in _start ()
Breakpoint 1, 0x08048060 in _start ()
(gdb) x/5i $eip
=> 0x8048060 <_start>: mov $0x1,%eax
0x8048065 <_start+5>: cpuid
0x8048067 <_start+7>: rdrand %eax
0x804806a <_start+10>: mov $0x1,%eax
0x804806f <_start+15>: int $0x80
(gdb) si 2
0x08048067 in _start ()
(gdb) p/t $ecx
$1 = 10011111101110100010001000000011
(gdb) p/t $ebx
$2 = 10000100000000000
(gdb) p/t $eax
$3 = 100000011010100111
(gdb) si
Program received signal SIGILL, Illegal instruction.
0x08048067 in _start ()