diff --git a/Makefile b/Makefile index eca70bd13..aae345241 100644 --- a/Makefile +++ b/Makefile @@ -581,6 +581,10 @@ ifeq (${ENABLE_RME},1) CTX_INCLUDE_AARCH32_REGS := 0 CTX_INCLUDE_PAUTH_REGS := 1 + ifneq ($(ENABLE_FEAT_MPAM), 0) + CTX_INCLUDE_MPAM_REGS := 1 + endif + # RME enables CSV2_2 extension by default. ENABLE_FEAT_CSV2_2 = 1 endif #(FEAT_RME) diff --git a/services/std_svc/rmmd/rmmd_main.c b/services/std_svc/rmmd/rmmd_main.c index e94b04814..1bcf99138 100644 --- a/services/std_svc/rmmd/rmmd_main.c +++ b/services/std_svc/rmmd/rmmd_main.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -169,6 +170,16 @@ static void manage_extensions_realm_per_world(void) if (is_feat_sme_supported()) { sme_enable_per_world(&per_world_context[CPU_CONTEXT_REALM]); } + + /* + * If FEAT_MPAM is supported and enabled, then disable trapping access + * to the MPAM registers for Realm world. Instead, RMM will configure + * the access to be trapped by itself so it can inject undefined aborts + * back to the Realm. + */ + if (is_feat_mpam_supported()) { + mpam_enable_per_world(&per_world_context[CPU_CONTEXT_REALM]); + } } /*******************************************************************************