diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-28 11:49:20 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-05 16:10:34 +0200 |
commit | f57584dc874f0ba92403b4ade631c232564fb027 (patch) | |
tree | 6e0a005dec9c993c0d7f535046fbb38a3cc7b533 /target-i386/cpu.h | |
parent | 8a201bd47e4724c5783033aedbdd126a5df7a251 (diff) | |
download | qemu-f57584dc874f0ba92403b4ade631c232564fb027.zip qemu-f57584dc874f0ba92403b4ade631c232564fb027.tar.gz qemu-f57584dc874f0ba92403b4ade631c232564fb027.tar.bz2 |
target-i386: simplify SMAP handling in MMU_KSMAP_IDX
Do not use this MMU index at all if CR4.SMAP is false, and drop
the SMAP check from x86_cpu_handle_mmu_fault.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-i386/cpu.h')
-rw-r--r-- | target-i386/cpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h index b80df66..f2d5b19 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1162,7 +1162,7 @@ static inline CPUX86State *cpu_init(const char *cpu_model) static inline int cpu_mmu_index(CPUX86State *env) { return (env->hflags & HF_CPL_MASK) == 3 ? MMU_USER_IDX : - ((env->hflags & HF_SMAP_MASK) && (env->eflags & AC_MASK)) + (!(env->hflags & HF_SMAP_MASK) || (env->eflags & AC_MASK)) ? MMU_KNOSMAP_IDX : MMU_KSMAP_IDX; } |