mirror of
https://github.com/qemu/qemu.git
synced 2024-12-04 01:03:38 +08:00
target/i386: do not accept RDSEED if CPUID bit absent
Suggested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
691925e5a3
commit
f9e0dbae78
@ -3925,12 +3925,20 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
||||
break;
|
||||
|
||||
case 7: /* RDSEED */
|
||||
if (mod != 3 ||
|
||||
(s->prefix & (PREFIX_LOCK | PREFIX_REPZ | PREFIX_REPNZ)) ||
|
||||
!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_RDSEED)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
goto do_rdrand;
|
||||
|
||||
case 6: /* RDRAND */
|
||||
if (mod != 3 ||
|
||||
(s->prefix & (PREFIX_LOCK | PREFIX_REPZ | PREFIX_REPNZ)) ||
|
||||
!(s->cpuid_ext_features & CPUID_EXT_RDRAND)) {
|
||||
goto illegal_op;
|
||||
}
|
||||
do_rdrand:
|
||||
translator_io_start(&s->base);
|
||||
gen_helper_rdrand(s->T0, cpu_env);
|
||||
rm = (modrm & 7) | REX_B(s);
|
||||
|
Loading…
Reference in New Issue
Block a user