MdeModulePkg: consider UNSUPPORTED return as valid in ArmFfaStandaloneMmLib

commit b534cabbda ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
makes ArmFfaStandlaoneMm(Core)Lib map Rx/Tx buffer in its constructor.

This makes a failure of loading StandaloneMm in legacy platform
which doesn't implements Rx/Tx buffer related API since it doesn't need to.

StandaloneMm could be only service provider not cosumer in some platform
where doesn't need to map RxTx buffer.
Therefore, Considier EFI_UNSUPPORTED return in ArmFfaStandaloneMmLib's
constructor.

Fixes: b534cabbda ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
This commit is contained in:
Levi Yun
2025-09-09 01:09:48 +10:00
committed by Ard Biesheuvel
parent d8e875e625
commit d7832b4800
@@ -67,6 +67,19 @@ ArmFfaStandaloneMmLibConstructor (
* buffer again but it uses the mapped one.
*/
Status = EFI_SUCCESS;
} else if (Status == EFI_UNSUPPORTED) {
/*
* StandaloneMm can only act as a service provider,
* and its primary use case is the secure variable service.
* In this case, it does not require Rx/Tx buffers,
* so treating EFI_UNSUPPORTED as a valid return value is acceptable.
*
* Any service that requires Rx/Tx buffers
* MUST first verify their availability by calling
* ArmFfaLibGetRxTxBuffers().
*/
Status = EFI_SUCCESS;
DEBUG ((DEBUG_WARN, "%a: Rx/Tx buffer doesn't support.\n", __func__));
} else if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a failed. Status = %r\n", __func__, Status));
}