diff options
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r-- | target-i386/helper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 11ca8649b5..47b982b437 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -750,7 +750,8 @@ do_check_protect_pse36: /* the page can be put in the TLB */ prot = PAGE_READ; if (!(ptep & PG_NX_MASK) && - !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK))) { + (mmu_idx == MMU_USER_IDX || + !((env->cr[4] & CR4_SMEP_MASK) && (ptep & PG_USER_MASK)))) { prot |= PAGE_EXEC; } if (pte & PG_DIRTY_MASK) { |