diff --git a/qemu/target-i386/unicorn.c b/qemu/target-i386/unicorn.c index a72af6fb..242261fb 100644 --- a/qemu/target-i386/unicorn.c +++ b/qemu/target-i386/unicorn.c @@ -160,6 +160,10 @@ void x86_reg_reset(struct uc_struct *uc) env->hflags &= ~(HF_ADDSEG_MASK); env->efer |= MSR_EFER_LMA | MSR_EFER_LME; // extended mode activated cpu_x86_update_cr0(env, CR0_PE_MASK); // protected mode + /* If we are operating in 64bit mode then add the Long Mode flag + * to the CPUID feature flag + */ + env->features[FEAT_8000_0001_EDX] |= CPUID_EXT2_LM; break; } }