feat(lib/granule): Clean and invalidate granules to PoE
A granule in GPT_REALM can transition between DELEGATED and other states
several times, and be accessed in different MEC contexts. When
transitioning back to DELEGATED, flush the caches to the point of
encryption in order to avoid MECID mismatches.
TF-A's clean+invalidate to PoPA when delegating/undelegating already
deals with transitions that change the granule's GPT entry. So we could
optimize this by marking the granule dirty when transitioning back to
DELEGATED, then doing the flush only if the granule is reused without
going through an undelegate operation.
Change-Id: I12e9f93f49462e55025b0d5dd16dc78f8a3b3637
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
4 files changed