The RMM specification 1.0-eac2 updates the RSI_IPA_STATE_SET
interface to add a new parameter RsiRipasChangeFlags.

The RsiRipasChangeFlags fieldset is 64 bits and the bit 0
describes the RsiRipasChangeDestroyed type which is used
to indicate if a RIPAS change from DESTROYED should be
permitted or not.

Therefore, update the RsiSetIpaState() to add a new
parameter for specifying the RsiRipasChangeFlags.

Also update the usage of RsiSetIpaState() in ArmCcaInitPeiLib
and in RealmApertureManagementProtocolDxe.

Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
---
 ArmVirtPkg/Include/Library/ArmCcaRsiLib.h                                      
    | 4 +++-
 ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c                         
    | 3 ++-
 ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c                                 
    | 7 +++++--
 
ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c
 | 6 ++++--
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h 
b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h
index 
154a5717f259502952a36312f6c3b3d6b75f15cb..5c2f996d3b4376e831a901f2919780acffec3313
 100644
--- a/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h
+++ b/ArmVirtPkg/Include/Library/ArmCcaRsiLib.h
@@ -205,6 +205,7 @@ RsiGetIpaState (
   @param [in]   Address     Address to the start of the memory range.
   @param [in]   Size        Length of the memory range.
   @param [in]   State       The RIPAS state to be configured.
+  @param [in]   Flags       The RIPAS change flags.
 
   @retval RETURN_SUCCESS            Success.
   @retval RETURN_INVALID_PARAMETER  A parameter is invalid.
@@ -214,7 +215,8 @@ EFIAPI
 RsiSetIpaState (
   IN  UINT64  *Address,
   IN  UINT64  Size,
-  IN  RIPAS   State
+  IN  RIPAS   State,
+  IN  UINT64  Flags
   );
 
 /**
diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c 
b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c
index 
2b2801cc5426994efc15c970fd6b0adf43bd7d36..e59a990da42526e280c1951b404e318df6a7bfca
 100644
--- a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c
+++ b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c
@@ -50,7 +50,8 @@ ArmCcaConfigureSystemMemory (
   Status =  RsiSetIpaState (
               (UINT64 *)PcdGet64 (PcdSystemMemoryBase),
               PcdGet64 (PcdSystemMemorySize),
-              RipasRam
+              RipasRam,
+              RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED
               );
   if (RETURN_ERROR (Status)) {
     // Panic
diff --git a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c 
b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c
index 
0280d8e42882ddfb02d0a40c47a6fba7855ba84f..0535254a3991bfe7a19b904e83b9482f801da20c
 100644
--- a/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c
+++ b/ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.c
@@ -11,7 +11,7 @@
     - REM          - Realm Extensible Measurement
 
   @par Reference(s):
-   - Realm Management Monitor (RMM) Specification, version 1.0-eac1
+   - Realm Management Monitor (RMM) Specification, version 1.0-eac2
      (https://developer.arm.com/documentation/den0137/)
 
 **/
@@ -318,6 +318,7 @@ RsiGetIpaState (
   @param [in]   Address     Address to the start of the memory range.
   @param [in]   Size        Length of the memory range.
   @param [in]   State       The RIPAS state to be configured.
+  @param [in]   Flags       The RIPAS change flags.
 
   @retval RETURN_SUCCESS            Success.
   @retval RETURN_INVALID_PARAMETER  A parameter is invalid.
@@ -327,7 +328,8 @@ EFIAPI
 RsiSetIpaState (
   IN  UINT64  *Address,
   IN  UINT64  Size,
-  IN  RIPAS   State
+  IN  RIPAS   State,
+  IN  UINT64  Flags
   )
 {
   RETURN_STATUS  Status;
@@ -353,6 +355,7 @@ RsiSetIpaState (
     SmcCmd.Arg1 = (UINTN)BaseAddress;
     SmcCmd.Arg2 = (UINTN)EndAddress;
     SmcCmd.Arg3 = (UINTN)State;
+    SmcCmd.Arg4 = Flags;
 
     ArmCallSmc (&SmcCmd);
     Status = RsiCmdStatusToEfiStatus (SmcCmd.Arg0);
diff --git 
a/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c
 
b/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c
index 
991054d47b10b45ed5c211827e795d88f8942c02..9212f0f6d2522a59bf289d2699d0972a074b8f9d
 100644
--- 
a/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c
+++ 
b/ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.c
@@ -236,7 +236,8 @@ RampOpenAperture (
   Status = RsiSetIpaState (
              (UINT64 *)Memory,
              (Pages * EFI_PAGE_SIZE),
-             RipasEmpty
+             RipasEmpty,
+             RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED
              );
   if (RETURN_ERROR (Status)) {
     DEBUG ((
@@ -335,7 +336,8 @@ RampCloseAperture (
   Status = RsiSetIpaState (
              (UINT64 *)ApertInfo->BaseAddress,
              (ApertInfo->Pages * EFI_PAGE_SIZE),
-             RipasRam
+             RipasRam,
+             RIPAS_CHANGE_FLAGS_RSI_NO_CHANGE_DESTROYED
              );
   if (RETURN_ERROR (Status)) {
     DEBUG ((
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117696): https://edk2.groups.io/g/devel/message/117696
Mute This Topic: https://groups.io/mt/105483436/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to