fix(spmd): avoid restoring ctx during first entry into spmc

In function cm_el2_sysregs_context_restore() the secure context was not
restored when first time entering into SPMC because SCR_EL3.EEL2 was set
just before entering SPMC for first time. With following change, EEL2
bit is set during RESET causing context being restored during first
entry into SPMC.
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/27170

The ICC_SRE_EL2 register is part of EL2 context and gets initialized
properly in SPMC, So restoring this before SPMC init is wrong.

Because setting of EEL2 was deferred, this issue was hidden and it
popped up after EEL2 was set at RESET.

The ideal solution is what is done in master branch, but considering
this is LTS branch, we need to come up with least invasive change to
avoid having conflicts in future when cherry-picking other security
patches from master.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I368088ece60826fd7a6aa423ba584a89d32fccdc
1 file changed