Skip to content

Commit 1cb8952

Browse files
committed
Default x86 CPU model to UC_CPU_X86_HASWELL
Rationale: Previouly, Unicorn uses several hacks to pretend it supports floating point instructions while not properly setting up something like CPU features. Therefore, once related registers like CR4 is reset, the hacks stop working and UC_ERR_INSN_INVALID is thrown. Setting the default model to a CPu that has basical floating point support should have the minimal break changes.
1 parent 4d173ea commit 1cb8952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qemu/target/i386/cpu.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5085,9 +5085,9 @@ X86CPU *cpu_x86_init(struct uc_struct *uc)
50855085

50865086
if (uc->cpu_model == INT_MAX) {
50875087
#ifdef TARGET_X86_64
5088-
uc->cpu_model = UC_CPU_X86_QEMU64; // qemu64
5088+
uc->cpu_model = UC_CPU_X86_HASWELL; // qemu64
50895089
#else
5090-
uc->cpu_model = UC_CPU_X86_QEMU32; // qemu32
5090+
uc->cpu_model = UC_CPU_X86_HASWELL; // qemu32
50915091
#endif
50925092
} else if (uc->cpu_model >= ARRAY_SIZE(builtin_x86_defs)) {
50935093
free(cpu);

0 commit comments

Comments
 (0)