target-i386: Allow execute from user mode when SMEP is enabled.
Previously, execute would be disabled for all pages with SMEP enabled, regardless of what mode the access took place in. Signed-off-by: Ricky Zhou <ricky@rzhou.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
		
							parent
							
								
									146ae00192
								
							
						
					
					
						commit
						b4bda1ae57
					
				| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue