target-i386: rename KSMAP to KNOSMAP

This is the mode where SMAP is overridden, put "NO" in its name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2014-03-28 11:28:38 +01:00
parent c773828aa9
commit 43773ed369
2 changed files with 7 additions and 7 deletions

View File

@ -1155,15 +1155,15 @@ static inline CPUX86State *cpu_init(const char *cpu_model)
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _kernel
#define MMU_MODE1_SUFFIX _user
#define MMU_MODE2_SUFFIX _ksmap /* Kernel with SMAP override */
#define MMU_MODE2_SUFFIX _knosmap /* SMAP disabled or CPL<3 && AC=1 */
#define MMU_KERNEL_IDX 0
#define MMU_USER_IDX 1
#define MMU_KSMAP_IDX 2
#define MMU_KNOSMAP_IDX 2
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))
? MMU_KSMAP_IDX : MMU_KERNEL_IDX;
? MMU_KNOSMAP_IDX : MMU_KERNEL_IDX;
}
#define CC_DST (env->cc_dst)

View File

@ -654,7 +654,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
goto do_fault_protect;
}
/* fall through */
case MMU_KSMAP_IDX:
case MMU_KNOSMAP_IDX:
if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) &&
(ptep & PG_USER_MASK)) {
goto do_fault_protect;
@ -716,7 +716,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
goto do_fault_protect;
}
/* fall through */
case MMU_KSMAP_IDX:
case MMU_KNOSMAP_IDX:
if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) &&
(ptep & PG_USER_MASK)) {
goto do_fault_protect;
@ -771,7 +771,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
goto do_fault_protect;
}
/* fall through */
case MMU_KSMAP_IDX:
case MMU_KNOSMAP_IDX:
if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) &&
(pde & PG_USER_MASK)) {
goto do_fault_protect;
@ -828,7 +828,7 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
goto do_fault_protect;
}
/* fall through */
case MMU_KSMAP_IDX:
case MMU_KNOSMAP_IDX:
if (is_write1 == 2 && (env->cr[4] & CR4_SMEP_MASK) &&
(ptep & PG_USER_MASK)) {
goto do_fault_protect;