feat(rmm): modify ipa_is_empty()
This patch makes changes in ipa_is_empty()
function to use realm_ipa_to_pa().
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: Ia37f74212fa6b808011013fdb4791e7e6e626e6a
diff --git a/runtime/core/exit.c b/runtime/core/exit.c
index 763aab2..af465ff 100644
--- a/runtime/core/exit.c
+++ b/runtime/core/exit.c
@@ -89,31 +89,18 @@
*/
static bool ipa_is_empty(unsigned long ipa, struct rec *rec)
{
- unsigned long s2tte, *ll_table;
- struct rtt_walk wi;
- bool ret;
+ struct s2_walk_result s2_walk;
+ enum s2_walk_status walk_status;
assert(GRANULE_ALIGNED(ipa));
- if (!addr_in_rec_par(rec, ipa)) {
- return false;
+ walk_status = realm_ipa_to_pa(rec, ipa, &s2_walk);
+
+ if ((walk_status != WALK_INVALID_PARAMS) &&
+ (s2_walk.ripas == RIPAS_EMPTY)) {
+ return true;
}
- granule_lock(rec->realm_info.g_rtt, GRANULE_STATE_RTT);
-
- rtt_walk_lock_unlock(rec->realm_info.g_rtt,
- rec->realm_info.s2_starting_level,
- rec->realm_info.ipa_bits,
- ipa, RTT_PAGE_LEVEL, &wi);
-
- ll_table = granule_map(wi.g_llt, SLOT_RTT);
- s2tte = s2tte_read(&ll_table[wi.index]);
-
- ret = s2tte_is_unassigned_empty(s2tte) ||
- s2tte_is_assigned_empty(s2tte, wi.last_level);
-
- buffer_unmap(ll_table);
- granule_unlock(wi.g_llt);
- return ret;
+ return false;
}
static bool fsc_is_external_abort(unsigned long fsc)