First of all, i would like to clarify about "BL2_AT_EL3" macro, the name is bit misleading. The purpose of this macro is for platforms which does not have TF-A BL1, and the execution starts from EL3. The RME enablement has piggy backed on it. Ideally BL2_AT_EL3
should be decoupled from RME, and it should be re-named something more meaningful e.g., BL2_WITHOUT_BL1 or something similar.
The existing name is more suitable for configuration where the platform has BL1 in it and BL2 can run at EL3 instead of S-EL1. This configuration is currently not available in TF-A but having this flexibility is not a bad idea and
it can be platform's choice. But the default configuration still would be BL2 running at S-EL1.
To answer your queries,
1. Is BL2 running at_EL3 is equally secure (or vulnerable !) as BL2 at S-EL1 system?
- There are implications if EL3 registers to be accessed from BL2, this will cause a gap in BL31, and we need to re-initialize EL3 registers to their correct values as BL2 can execute various programs(drivers, DDR Phy) before jumping
back to EL3(BL31).
2. One of the reasons to not run BL2 at EL3 is, it cannot access EL3 registers, if secure services are compromised what's the benefit of guarding EL3?
- There is a theoretical scenario where EL3 can disable secure world (disable secure interrupts/SMCs) and just run NS side.
Thanks
Manish