Skip to content

Commit

Permalink
Merge "fix(rmm): inject sea for access outside realm ipa space" into …
Browse files Browse the repository at this point in the history
…integration
  • Loading branch information
soby-mathew authored and TrustedFirmware Code Review committed Feb 22, 2024
2 parents 7ccb68f + 228d028 commit 36096a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions runtime/core/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ static bool handle_data_abort(struct rec *rec, struct rmi_rec_exit *rec_exit,
* The memory access that crosses a page boundary may cause two aborts
* with `hpfar_el2` values referring to two consecutive pages.
*
* Insert the SEA and return to the Realm if the granule's RIPAS is EMPTY.
* Insert the SEA and return to the Realm if IPA is outside realm IPA space or
* the granule's RIPAS is EMPTY.
*/
if (ipa_is_empty(fipa, rec)) {
if ((fipa >= rec_ipa_size(rec)) || ipa_is_empty(fipa, rec)) {
inject_sync_idabort(ESR_EL2_ABORT_FSC_SEA);
return true;
}
Expand Down Expand Up @@ -260,10 +261,12 @@ static bool handle_instruction_abort(struct rec *rec, struct rmi_rec_exit *rec_e

/*
* Insert the SEA and return to the Realm if:
* - IPA is outside realm IPA space
* - The instruction abort is at an Unprotected IPA, or
* - The granule's RIPAS is EMPTY
*/
if (!access_in_rec_par(rec, fipa) || ipa_is_empty(fipa, rec)) {
if ((fipa >= rec_ipa_size(rec)) ||
!access_in_rec_par(rec, fipa) || ipa_is_empty(fipa, rec)) {
inject_sync_idabort(ESR_EL2_ABORT_FSC_SEA);
return true;
}
Expand Down

0 comments on commit 36096a4

Please sign in to comment.