问题描述
CPUID说,我有我的rdrand系统上,但rdrand指令抛出SIGILL。我使用的VMware Workstation 11里Linux Mint的,我用Google搜索工作站支持rdrand,他们说,自从9日的版本,它启用。主持人Proccess是i5-2550k,它应该支持rdrand。我能以某种方式解决这一问题?下面是GDB上市:
断点1,在0x08048060 _start()
(GDB)X / 5I $ EIP= GT; 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 20x08048067在_start()(GDB)P / T $ ECX$ 1 = 10011111101110100010001000000011; 30位设置 - 启用rdrand。(GDB)P / T $ EBX$ 2 = 100001000亿(GDB)P / T $ EAX$ 3 = 100000011010100111(GDB)SI
程序接收到的信号SIGILL,非法指令。0x08048067在_start()断点1,在0x08048060 _start()(GDB)X / 5I $ EIP= GT; 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 20x08048067在_start()(GDB)P / T $ ECX$ 1 = 10011111101110100010001000000011(GDB)P / T $ EBX$ 2 = 100001000亿(GDB)P / T $ EAX$ 3 = 100000011010100111(GDB)SI
程序接收到的信号SIGILL,非法指令。0x08048067在_start()
您已经阅读了ECX登记错了。该RDRAND位未设置。位30是从左侧的第二位:
10011111101110100010001000000011
^
30位^位0
上面的图像从英特尔64和IA-32架构软件开发人员手册中的CPUID指令说明服用。
此外,您的i5-2550K CPU是Sandy Bridge处理器。 RDRAND没有出台,直到下一代英特尔处理器,Ivy Bridge的。
Cpuid says that I have rdrand on my system, but rdrand instruction throws sigill. I'm using linux mint inside VmWare workstation 11, I googled workstation support of rdrand, and they say that it enabled since 9th version. Proccess of host is i5-2550k and it should support rdrand. Can I somehow fix this? Here is gdb listing:
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 ()
You've read the ECX register wrong. The RDRAND bit is not set. Bit 30 is the second bit from the left:
10011111101110100010001000000011
^
Bit 30 ^ Bit 0
The above image is taken from the CPUID instruction description given in the Intel 64 and IA-32 Architectures Software Developer’s Manual.
Also your i5-2550K CPU is a Sandy Bridge processor. RDRAND wasn't introduced until the next generation of Intel processors, Ivy Bridge.
这篇关于Rdrand instrucrtion SIGILL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!