}
Fault
-ArmStaticInst::checkSveTrap(ThreadContext *tc, CPSR cpsr) const
+ArmStaticInst::checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
{
const ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsr.el;
+ if ((el == EL0 && cpacr.zen != 0x3) ||
+ (el == EL1 && !(cpacr.zen & 0x1)))
+ return sveAccessTrap(EL1);
if (ArmSystem::haveVirtualization(tc) && el <= EL2) {
- CPTR cptrEnCheck = tc->readMiscReg(MISCREG_CPTR_EL2);
- if (cptrEnCheck.tz)
+ CPTR cptr_en_check = tc->readMiscReg(MISCREG_CPTR_EL2);
+ if (cptr_en_check.tz)
return sveAccessTrap(EL2);
}
if (ArmSystem::haveSecurity(tc)) {
- CPTR cptrEnCheck = tc->readMiscReg(MISCREG_CPTR_EL3);
- if (!cptrEnCheck.ez)
+ CPTR cptr_en_check = tc->readMiscReg(MISCREG_CPTR_EL3);
+ if (!cptr_en_check.ez)
return sveAccessTrap(EL3);
}
return NoFault;
}
-Fault
-ArmStaticInst::checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
-{
- const ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsr.el;
- if ((el == EL0 && cpacr.zen != 0x3) ||
- (el == EL1 && !(cpacr.zen & 0x1)))
- return sveAccessTrap(EL1);
-
- return checkSveTrap(tc, cpsr);
-}
-
-
static uint8_t
getRestoredITBits(ThreadContext *tc, CPSR spsr)
{
*/
Fault sveAccessTrap(ExceptionLevel el) const;
- /**
- * Check an SVE access against CPTR_EL2 and CPTR_EL3.
- */
- Fault checkSveTrap(ThreadContext *tc, CPSR cpsr) const;
-
/**
* Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
*/