Merge pull request #1426 from antonio-nino-diaz-arm/an/spm-sync

SPM: Refactor entry and exit of the SP