diff options
Diffstat (limited to 'target-i386/exec.h')
-rw-r--r-- | target-i386/exec.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target-i386/exec.h b/target-i386/exec.h index 90b82f3975..035881ec6c 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -397,3 +397,14 @@ static inline int cpu_halted(CPUState *env) { return EXCP_HALTED; } +/* load efer and update the corresponding hflags. XXX: do consistency + checks with cpuid bits ? */ +static inline void cpu_load_efer(CPUState *env, uint64_t val) +{ + env->efer = val; + env->hflags &= ~(HF_LMA_MASK | HF_SVME_MASK); + if (env->efer & MSR_EFER_LMA) + env->hflags |= HF_LMA_MASK; + if (env->efer & MSR_EFER_SVME) + env->hflags |= HF_SVME_MASK; +} |