mirror of
				https://github.com/yuzu-emu/unicorn.git
				synced 2025-11-04 08:55:06 +00:00 
			
		
		
		
	target/arm: Ignore HCR_EL2.ATA when {E2H,TGE} != 11
Unlike many other bits in HCR_EL2, the description for this bit does not contain the phrase "if ... this field behaves as 0 for all purposes other than", so do not squash the bit in arm_hcr_el2_eff. Instead, replicate the E2H+TGE test in the two places that require it. Backports 4301acd7d7d455792ea873ced75c0b5d653618b1
This commit is contained in:
		
							parent
							
								
									4f00eacb11
								
							
						
					
					
						commit
						f7e831a7e4
					
				| 
						 | 
				
			
			@ -6575,11 +6575,12 @@ static CPAccessResult access_mte(CPUARMState *env, const ARMCPRegInfo *ri,
 | 
			
		|||
{
 | 
			
		||||
    int el = arm_current_el(env);
 | 
			
		||||
 | 
			
		||||
    if (el < 2 &&
 | 
			
		||||
        arm_feature(env, ARM_FEATURE_EL2) &&
 | 
			
		||||
        !(arm_hcr_el2_eff(env) & HCR_ATA)) {
 | 
			
		||||
    if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) {
 | 
			
		||||
        uint64_t hcr = arm_hcr_el2_eff(env);
 | 
			
		||||
        if (!(hcr & HCR_ATA) && (!(hcr & HCR_E2H) || !(hcr & HCR_TGE))) {
 | 
			
		||||
            return CP_ACCESS_TRAP_EL2;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (el < 3 &&
 | 
			
		||||
        arm_feature(env, ARM_FEATURE_EL3) &&
 | 
			
		||||
        !(env->cp15.scr_el3 & SCR_ATA)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1254,11 +1254,12 @@ static inline bool allocation_tag_access_enabled(CPUARMState *env, int el,
 | 
			
		|||
        && !(env->cp15.scr_el3 & SCR_ATA)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    if (el < 2
 | 
			
		||||
        && arm_feature(env, ARM_FEATURE_EL2)
 | 
			
		||||
        && !(arm_hcr_el2_eff(env) & HCR_ATA)) {
 | 
			
		||||
    if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) {
 | 
			
		||||
        uint64_t hcr = arm_hcr_el2_eff(env);
 | 
			
		||||
        if (!(hcr & HCR_ATA) && (!(hcr & HCR_E2H) || !(hcr & HCR_TGE))) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    sctlr &= (el == 0 ? SCTLR_ATA0 : SCTLR_ATA);
 | 
			
		||||
    return sctlr != 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue