diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-04 13:35:58 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-04 13:35:58 +0000 |
commit | 5efc27bbb695017a7386cb9acef247b9dd29f2b6 (patch) | |
tree | ae548e9fefe807ce7583bec2dea3429f9895e357 /target-i386/exec.h | |
parent | f2289cb6924afc97b2a75d21bfc9217024d11741 (diff) | |
download | qemu-5efc27bbb695017a7386cb9acef247b9dd29f2b6.zip |
EFER loading fixes, including SVME bit
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4659 c046a42c-6fe2-441c-8c8c-71466251a162
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; +} |