2015-06-16 54 views
0

Cpuid說我在我的系統上有rdrand,但是rdrand指令會顯示sigill。我在VmWare工作站11中使用linux mint,我搜索了rdrand的工作站支持,他們說它自從第9版起就啓用了。主機的處理是i5-2550k,它應該支持rdrand。我能以某種方式解決這個問題嗎這裏是gdb列表:Rdrand instrucrtion SIGILL

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() 

回答

4

您已閱讀錯誤的ECX寄存器。 RDRAND位未設置。位30是從左側第二位:

10011111101110100010001000000011 
^ 
Bit 30      ^Bit 0 

CPUID information returned in ECX

上述圖像從在Intel 64和IA-32體系結構軟件開發人員手冊中給出的CPUID指令描述採取。

另外你的i5-2550K CPU是Sandy Bridge處理器。直到下一代英特爾處理器Ivy Bridge才推出RDRAND。

相關問題