Assembly 罗德兰指示符号

Assembly 罗德兰指示符号,assembly,vmware,intel,cpuid,rdrand,Assembly,Vmware,Intel,Cpuid,Rdrand,Cpuid说我的系统上有rdrand,但rdrand指令抛出sigill。我在VmWare workstation 11中使用LinuxMint,我在谷歌上搜索了rdrand的工作站支持,他们说它从第9版开始启用。主机进程为i5-2550k,应支持rdrand。我能解决这个问题吗?以下是gdb列表: Breakpoint 1, 0x08048060 in _start () (gdb) x/5i $eip => 0x8048060 <_start>: mov $0x1

Cpuid说我的系统上有rdrand,但rdrand指令抛出sigill。我在VmWare workstation 11中使用LinuxMint,我在谷歌上搜索了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 ()
start()中的断点1,0x08048060
(gdb)x/5i$eip
=>0x8048060:mov$0x1,%eax
0x8048065:cpuid
0x8048067:rdrand%eax
0x804806a:mov$0x1,%eax
0x804806f:int$0x80
(gdb)si 2
0x08048067英寸\u开始()
(gdb)p/t$ecx
$1 = 10011111101110100010001000000011 ; 位30已设置--rdrand已启用。
(gdb)p/t$ebx
$2 = 10000100000000000
(gdb)p/t$eax
$3 = 100000011010100111
(gdb)si
程序收到信号信号,指令非法。
0x08048067英寸\u开始()
断点1,0x08048060在_start()中
(gdb)x/5i$eip
=>0x8048060:mov$0x1,%eax
0x8048065:cpuid
0x8048067:rdrand%eax
0x804806a:mov$0x1,%eax
0x804806f:int$0x80
(gdb)si 2
0x08048067英寸\u开始()
(gdb)p/t$ecx
$1 = 10011111101110100010001000000011
(gdb)p/t$ebx
$2 = 10000100000000000
(gdb)p/t$eax
$3 = 100000011010100111
(gdb)si
程序收到信号信号,指令非法。
0x08048067英寸\u开始()

您读错了ECX寄存器。未设置RDRAND位。位30是从左侧开始的第二位:

10011111101110100010001000000011
 ^
 Bit 30                        ^ Bit 0

上图取自《英特尔64和IA-32体系结构软件开发人员手册》中的CPUID指令说明


另外,您的i5-2550K CPU是一个Sandy Bridge处理器。RDRAND直到下一代Intel处理器Ivy Bridge才被引入。

您读错了ECX寄存器。未设置RDRAND位。位30是从左侧开始的第二位:

10011111101110100010001000000011
 ^
 Bit 30                        ^ Bit 0

上图取自《英特尔64和IA-32体系结构软件开发人员手册》中的CPUID指令说明


另外,您的i5-2550K CPU是一个Sandy Bridge处理器。RDRAND是在下一代英特尔处理器Ivy Bridge中引入的。

RDRAND是在Ivy Bridge中引入的。i5-2550K是上一代沙桥的一部分。

r兰德是在常春藤桥中引入的。i5-2550K是上一代沙桥的一部分。

罗斯答案的最后一段已经指出了这一点>。罗斯答案的最后一段已经指出了这一点>。