public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/5] Arm 32bit support in StandaloveMm
@ 2021-05-04 15:20 Etienne Carriere
  2021-05-04 15:20 ` [PATCH 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs Etienne Carriere
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Etienne Carriere @ 2021-05-04 15:20 UTC (permalink / raw)
  To: devel
  Cc: Achin Gupta, Ard Biesheuvel, Jiewen Yao, Leif Lindholm,
	Sami Mujawar, Sughosh Ganu, Etienne Carriere

This series targets building StandaloneMM package for 32bit ARM
architectures. The main parts of the changes move AArch64/*
files to paths suitable for both 32bit and 64bit Arm machines.

Because these changes move file paths, some other edk2 related
source trees must be updated. Up to my knowledge, only edk2-platforms
and edk2-codereview must be synchronised. [1] shows the changes
needed in edk2-platforms to synchronise with these changes.

I will post a patch series for edk2-platforms, including [1] and
some other changes to allow building StandaloneMmPkg for 32bit Arm
platforms.

This change is a resend of [2], rebased to latest master.

[1] https://github.com/etienne-lms/edk2-platforms/commit/becbd185167f6a115dbd3895bc6071ab04e44d9b
[2] https://edk2.groups.io/g/devel/message/72834 (with 72835, 72836, 72837 and 72838)

Etienne Carriere (5):
  ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs
  ArmPkg: prepare 32bit ARM build of StandaloneMmPkg
  GenGv: Arm: support images entered in Thumb mode
  StandaloneMmPkg: fix pointer/int casts against 32bit architectures
  StandaloneMmPkg: build for 32bit arm machines

 ArmPkg/ArmPkg.dec                             |  2 +-
 ArmPkg/ArmPkg.dsc                             |  2 +-
 .../MmCommunicationDxe/MmCommunication.c      |  2 +-
 ArmPkg/Include/IndustryStandard/ArmFfaSvc.h   | 12 ++++++
 ArmPkg/Include/IndustryStandard/ArmMmSvc.h    | 15 ++++++++
 .../{AArch64 => }/ArmMmuStandaloneMmLib.c     | 15 ++++----
 .../ArmMmuStandaloneMmLib.inf                 |  6 +--
 BaseTools/Source/C/GenFv/GenFvInternalLib.c   | 38 ++++++++++++++-----
 StandaloneMmPkg/Core/StandaloneMmCore.inf     |  2 +-
 .../{AArch64 => }/EventHandle.c               | 12 +++++-
 .../{AArch64 => }/StandaloneMmCpu.c           | 10 ++---
 .../{AArch64 => }/StandaloneMmCpu.h           |  0
 .../{AArch64 => }/StandaloneMmCpu.inf         |  0
 .../StandaloneMmCoreEntryPoint.h              |  0
 .../{AArch64 => Arm}/CreateHobList.c          | 16 ++++----
 .../{AArch64 => Arm}/SetPermissions.c         |  2 +-
 .../StandaloneMmCoreEntryPoint.c              | 18 ++++-----
 .../StandaloneMmCoreEntryPoint.inf            | 14 +++----
 .../{AArch64 => Arm}/StandaloneMmCoreHobLib.c |  0
 .../StandaloneMmCoreHobLibInternal.c          |  0
 .../StandaloneMmCoreHobLib.inf                |  8 ++--
 ...rnal.c => ArmStandaloneMmMemLibInternal.c} |  9 ++++-
 .../StandaloneMmMemLib/StandaloneMmMemLib.inf |  6 +--
 .../VariableMmDependency.inf                  |  2 +-
 StandaloneMmPkg/StandaloneMmPkg.dsc           |  8 ++--
 25 files changed, 131 insertions(+), 68 deletions(-)
 rename ArmPkg/Library/StandaloneMmMmuLib/{AArch64 => }/ArmMmuStandaloneMmLib.c (92%)
 rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/EventHandle.c (92%)
 rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.c (94%)
 rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.h (100%)
 rename StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.inf (100%)
 rename StandaloneMmPkg/Include/Library/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.h (100%)
 rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/CreateHobList.c (91%)
 rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/SetPermissions.c (96%)
 rename StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.c (94%)
 rename StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLib.c (100%)
 rename StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLibInternal.c (100%)
 rename StandaloneMmPkg/Library/StandaloneMmMemLib/{AArch64/StandaloneMmMemLibInternal.c => ArmStandaloneMmMemLibInternal.c} (86%)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs
@ 2021-03-14 20:06 Etienne Carriere
  2021-03-14 20:06 ` [PATCH 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Etienne Carriere
  0 siblings, 1 reply; 18+ messages in thread
From: Etienne Carriere @ 2021-03-14 20:06 UTC (permalink / raw)
  To: devel; +Cc: Etienne Carriere

Defines ARM_SVC_ID_FFA_* and ARM_SVC_ID_SP_* identifiers for 32bit
function IDs as per FF-A specification [1]. Defines also generic ARM
SVC identifier macros to wrap 32bit or 64bit identifiers upon target
built architecture. This will allow to factorize 64bit and 32bit in
packages implementation.

[1] https://developer.arm.com/documentation/den0077/latest

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 12 ++++++++++++
 ArmPkg/Include/IndustryStandard/ArmMmSvc.h  | 15 +++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h
index 65b8343ade..ebcb54b28b 100644
--- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h
+++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h
@@ -17,9 +17,21 @@
 #define ARM_FFA_SVC_H_
 
 #define ARM_SVC_ID_FFA_VERSION_AARCH32                  0x84000063
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32      0x8400006F
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32     0x84000070
 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64      0xC400006F
 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64     0xC4000070
 
+/* Generic IDs when using AArch32 or AArch64 execution state */
+#ifdef MDE_CPU_AARCH64
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ     ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP    ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64
+#endif
+#ifdef MDE_CPU_ARM
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ     ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32
+#define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP    ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32
+#endif
+
 #define SPM_MAJOR_VERSION_FFA                           1
 #define SPM_MINOR_VERSION_FFA                           0
 
diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
index 71a5398558..14f81d2a8b 100644
--- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
+++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
@@ -15,10 +15,25 @@
  * privileged operations on its behalf.
  */
 #define ARM_SVC_ID_SPM_VERSION_AARCH32             0x84000060
+#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32       0x84000061
+#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32   0x84000064
+#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32   0x84000065
 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065
 
+/* Generic IDs when using AArch32 or AArch64 execution state */
+#ifdef MDE_CPU_AARCH64
+#define ARM_SVC_ID_SP_EVENT_COMPLETE               ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64
+#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES       ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64
+#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES       ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64
+#endif
+#ifdef MDE_CPU_ARM
+#define ARM_SVC_ID_SP_EVENT_COMPLETE               ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH32
+#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES       ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH32
+#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES       ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH32
+#endif
+
 #define SET_MEM_ATTR_DATA_PERM_MASK       0x3
 #define SET_MEM_ATTR_DATA_PERM_SHIFT        0
 #define SET_MEM_ATTR_DATA_PERM_NO_ACCESS    0
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-05-12 10:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-04 15:20 [PATCH 0/5] Arm 32bit support in StandaloveMm Etienne Carriere
2021-05-04 15:20 ` [PATCH 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs Etienne Carriere
2021-05-11 18:43   ` Sami Mujawar
2021-05-04 15:20 ` [PATCH 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Etienne Carriere
2021-05-11 18:45   ` Sami Mujawar
2021-05-04 15:20 ` [PATCH 3/5] GenGv: Arm: support images entered in Thumb mode Etienne Carriere
2021-05-10 15:54   ` Ard Biesheuvel
2021-05-11 19:13   ` Sami Mujawar
2021-05-04 15:20 ` [PATCH 4/5] StandaloneMmPkg: fix pointer/int casts against 32bit architectures Etienne Carriere
2021-05-05  2:10   ` [edk2-devel] " Yao, Jiewen
2021-05-10 15:50     ` Ard Biesheuvel
2021-05-11 19:14   ` Sami Mujawar
2021-05-04 15:20 ` [PATCH 5/5] StandaloneMmPkg: build for 32bit arm machines Etienne Carriere
2021-05-11 19:18   ` Sami Mujawar
2021-05-12 10:01     ` Etienne Carriere
2021-05-06  3:25 ` 回复: [edk2-devel] [PATCH 0/5] Arm 32bit support in StandaloveMm gaoliming
2021-05-06  6:44   ` Etienne Carriere
  -- strict thread matches above, loose matches on Subject: below --
2021-03-14 20:06 [PATCH 1/5] ArmPkg/IndustryStandard: 32b/64b agnostic FF-A and Mm SVC IDs Etienne Carriere
2021-03-14 20:06 ` [PATCH 2/5] ArmPkg: prepare 32bit ARM build of StandaloneMmPkg Etienne Carriere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox