不支持QEMU RDRAND指令

时间:2016-02-12 00:48:49

标签: assembly x86 qemu

我正在尝试在qemu-system-x86_64中运行自定义内核。此内核要求在其引导周期的早期使用rdrand指令,如果CPU不支持,则无法引导。我在the answer to this question中读到rdrand至少需要一个Ivy Bridge处理器。但是,当我使用-cpu SandyBridge参数(它应该告诉它模拟支持rdrand的Sandy Bridge CPU)运行QEMU时,我的内核仍然无法启动。我试过-cpu Broadwell,大概是因为它是一个较新的CPU,但没有任何变化。

以下是正在运行的程序集,用于检查cpuid并执行rdrand

00025c79    xorl    %ebp, %ebp
00025c7b    movl    $0x1, %eax
00025c80    xorl    %ecx, %ecx
00025c82    cpuid
00025c84    testl   $0x40000000, %ecx       ## imm = 0x40000000
00025c8a    jne 0x25c98
00025c8c    movl    $0x2d479, (%esp)        ## 0x2D479 points to an error string
00025c93    calll   _stop                   ## This function call does not return
00025c98    movl    $0x2d4b1, (%esp)        ## 0x2D4B1 points to a debugging message
00025c9f    calll   _printf
00025ca4    movb    $0x0, 0x1b(%esp)
00025ca9    rdrandl %eax
00025cac    setb    0x1b(%esp)
00025cb1    cmpb    $0x0, 0x1b(%esp)
00025cb6    je  0x25ca9

0 个答案:

没有答案
相关问题