if (completed)
return;
+ // This boolean variable specifies if the system is running in aarch32 at
+ // EL3 (aarch32EL3 = true). It is false if EL3 is not implemented, or it
+ // is running in aarch64 (aarch32EL3 = false)
+ bool aarch32EL3 = haveSecurity && !highestELIs64;
+
/**
* Some registers alias with others, and therefore need to be translated.
* When two mapping registers are given, they are the 32b lower and
.banked();
InitReg(MISCREG_PRRR_MAIR0_NS)
.mutex()
+ .privSecure(!aarch32EL3)
.bankedChild();
InitReg(MISCREG_PRRR_MAIR0_S)
.mutex()
.banked();
InitReg(MISCREG_NMRR_MAIR1_NS)
.mutex()
+ .privSecure(!aarch32EL3)
.bankedChild();
InitReg(MISCREG_NMRR_MAIR1_S)
.mutex()
.banked();
InitReg(MISCREG_CSSELR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_CSSELR_S)
.bankedChild()
.banked();
InitReg(MISCREG_SCTLR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_SCTLR_S)
.bankedChild()
.banked();
InitReg(MISCREG_ACTLR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_ACTLR_S)
.bankedChild()
.banked();
InitReg(MISCREG_TTBR0_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_TTBR0_S)
.bankedChild()
.banked();
InitReg(MISCREG_TTBR1_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_TTBR1_S)
.bankedChild()
.banked();
InitReg(MISCREG_TTBCR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_TTBCR_S)
.bankedChild()
.banked();
InitReg(MISCREG_DACR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_DACR_S)
.bankedChild()
.banked();
InitReg(MISCREG_DFSR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_DFSR_S)
.bankedChild()
.banked();
InitReg(MISCREG_IFSR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_IFSR_S)
.bankedChild()
.unimplemented()
.warnNotFail()
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_ADFSR_S)
.unimplemented()
.unimplemented()
.warnNotFail()
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_AIFSR_S)
.unimplemented()
.banked();
InitReg(MISCREG_DFAR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_DFAR_S)
.bankedChild()
.banked();
InitReg(MISCREG_IFAR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_IFAR_S)
.bankedChild()
.banked();
InitReg(MISCREG_PAR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_PAR_S)
.bankedChild()
.banked();
InitReg(MISCREG_PRRR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_PRRR_S)
.bankedChild()
.banked();
InitReg(MISCREG_MAIR0_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_MAIR0_S)
.bankedChild()
.banked();
InitReg(MISCREG_NMRR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_NMRR_S)
.bankedChild()
.banked();
InitReg(MISCREG_MAIR1_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_MAIR1_S)
.bankedChild()
.banked();
InitReg(MISCREG_AMAIR0_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_AMAIR0_S)
.bankedChild()
.banked();
InitReg(MISCREG_AMAIR1_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_AMAIR1_S)
.bankedChild()
.banked();
InitReg(MISCREG_VBAR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_VBAR_S)
.bankedChild()
.banked();
InitReg(MISCREG_CONTEXTIDR_NS)
.bankedChild()
+ .privSecure(!aarch32EL3)
.nonSecure().exceptUserMode();
InitReg(MISCREG_CONTEXTIDR_S)
.bankedChild()
.banked();
InitReg(MISCREG_TPIDRURW_NS)
.bankedChild()
- .allPrivileges().monSecure(0).privSecure(0);
+ .allPrivileges()
+ .privSecure(!aarch32EL3)
+ .monSecure(0);
InitReg(MISCREG_TPIDRURW_S)
.bankedChild()
.secure();
.banked();
InitReg(MISCREG_TPIDRURO_NS)
.bankedChild()
- .allPrivileges().secure(0).userNonSecureWrite(0).userSecureRead(1);
+ .allPrivileges()
+ .userNonSecureWrite(0).userSecureRead(1)
+ .privSecure(!aarch32EL3)
+ .monSecure(0);
InitReg(MISCREG_TPIDRURO_S)
.bankedChild()
.secure().userSecureWrite(0);
.banked();
InitReg(MISCREG_TPIDRPRW_NS)
.bankedChild()
- .nonSecure().exceptUserMode();
+ .nonSecure().exceptUserMode()
+ .privSecure(!aarch32EL3);
InitReg(MISCREG_TPIDRPRW_S)
.bankedChild()
.secure().exceptUserMode();
.banked();
InitReg(MISCREG_CNTP_TVAL_NS)
.bankedChild()
- .allPrivileges().monSecure(0).privSecure(0);
+ .allPrivileges()
+ .privSecure(!aarch32EL3)
+ .monSecure(0);
InitReg(MISCREG_CNTP_TVAL_S)
.unimplemented()
.bankedChild()
.banked();
InitReg(MISCREG_CNTP_CTL_NS)
.bankedChild()
- .allPrivileges().monSecure(0).privSecure(0);
+ .allPrivileges()
+ .privSecure(!aarch32EL3)
+ .monSecure(0);
InitReg(MISCREG_CNTP_CTL_S)
.unimplemented()
.bankedChild()
.banked();
InitReg(MISCREG_CNTP_CVAL_NS)
.bankedChild()
- .allPrivileges().monSecure(0).privSecure(0);
+ .allPrivileges()
+ .privSecure(!aarch32EL3)
+ .monSecure(0);
InitReg(MISCREG_CNTP_CVAL_S)
.unimplemented()
.bankedChild()