Merge "fix(rme): do not trap access to MPAM system registers in Realm mode" into integration

This commit is contained in:
Soby Mathew 2025-03-27 06:25:30 +01:00 committed by TrustedFirmware Code Review
commit 8661845026
2 changed files with 15 additions and 0 deletions

View file

@ -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)

View file

@ -19,6 +19,7 @@
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/el3_runtime/cpu_data.h>
#include <lib/el3_runtime/pubsub.h>
#include <lib/extensions/mpam.h>
#include <lib/extensions/pmuv3.h>
#include <lib/extensions/sys_reg_trace.h>
#include <lib/gpt_rme/gpt_rme.h>
@ -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]);
}
}
/*******************************************************************************