Commit graph

7 commits

Author SHA1 Message Date
Sudeep Holla
a869e2dc45 fix(spmd): fix build failure due to redefinition
Clang build breaks with the following warning:

  |  In file included from services/std_svc/spmd/spmd_logical_sp.c:15:
  |  include/services/el3_spmd_logical_sp.h:15:38: error: redefinition of
  |    typedef 'spmd_spm_core_context_t' is a C11 feature [-Werror,-Wtypedef-redefinition].
  |     15 | typedef struct spmd_spm_core_context spmd_spm_core_context_t;
  |        |                                      ^
  |  services/std_svc/spmd/spmd_private.h:58:3: note: previous definition is here
  |     58 | } spmd_spm_core_context_t;
  |        |   ^
  |    CC      services/std_svc/std_svc_setup.c
  |  1 error generated.
  |  In file included from services/std_svc/spmd/spmd_main.c:35:
  |  services/std_svc/spmd/spmd_private.h:58:3: error: redefinition of typedef
  |    'spmd_spm_core_context_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
  |     58 | } spmd_spm_core_context_t;
  |        |   ^
  |  include/services/el3_spmd_logical_sp.h:15:38: note: previous definition is here
  |     15 | typedef struct spmd_spm_core_context spmd_spm_core_context_t;
  |        |                                      ^
  |  1 error generated.

A structure 'spmd_spm_core_context_t' defined in 'spmd_private.h' is
also declared in 'el3_spmd_logical_sp.h' as it is used in a couple of
function declarations. These function declarations can be moved to
spmd_private.h as they are not needed elsewhere.

Change-Id: Ic6b9a277abe00cb7129f671570abf7255be62dfa
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-12-03 16:02:21 +00:00
Raghu Krishnamurthy
b04343f3c9 fix(spmd): coverity scan issues
Coverity defects fixed by this patch are:
*** CID 400208:  Performance inefficiencies  (PASS_BY_VALUE)
/include/services/el3_spmd_logical_sp.h: 108 in
ffa_partition_info_regs_get_last_idx()

*** CID 400207:  Performance inefficiencies  (PASS_BY_VALUE)
/services/std_svc/spmd/spmd_logical_sp.c: 359 in
ffa_partition_info_regs_get_part_info()

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I9597377a8ec3d5519995e1619d99ee7102f33939
2023-09-25 13:06:13 -07:00
Raghu Krishnamurthy
a1a9a95071 feat(fvp): spmd logical partition smc handler
This patch adds a basic el3 spmd logical partition to the fvp platform
via a platform specific smc handler. One of the use cases for el3
logical partitions is to have the ability to translate sip calls into
ff-a direct requests via the use of spmd logical partitions. The smc
handler creates a direct request based on the incoming smc parameters
and forwards the call as a direct request from the spmd logical
partition to the target secure partition.

Change-Id: If8ba9aab8203924bd00fc1dcdf9cd05a9a04a147
2023-08-11 18:57:50 -07:00
Raghu Krishnamurthy
95f7f6d86a feat(spmd): get logical partitions info
This patch enables FF-A secure partitions and the SPMC to query EL3 SPMD
logical partitions that are present in the system via partition get info
regs abi. Note that normal world will not be able to see EL3 SPMD
logical partitions as per the spec.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I3fca8aed8ae156a559a74521803324c13ae3d55a
2023-08-11 18:56:34 -07:00
Raghu Krishnamurthy
0b850e9e7c feat(spmd): add partition info get regs
This patch adds support for an EL3 SPMD logical partition to discover
secure partitions using the FFA_PARTITION_INFO_GET_REGS abi. It also
adds helper functions for a logical partition to use the information
returned in registers in a meaningful way.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: Id69488e7367e17e2dfa6c8e332be3c8d41f6c773
2023-08-11 18:55:18 -07:00
Raghu Krishnamurthy
66bdfd6e4e feat(spmd): el3 direct message API
This patch implements an API that is exposed to SPMD logical partitions
that can be used to send direct messages to a secure partition.
It also adds required code in the SPMD smc handler to complete the
direct response appropriately.

Change-Id: I2d0e38415f13ad4fd28f8984d565036b7d3a9e71
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
2023-08-11 18:55:11 -07:00
Raghu Krishnamurthy
890b508820 feat(spmd): add spmd logical partitions
Add header file to help with creation of SPMD logical partitions. Also
update linker files to create sections to record SPMD logical partitions
declared. This follows the same pattern as the EL3 SPMC's logical
partitions. This patch also adds initialization of SPMD logical
partitions when the SPMD comes up.
ENABLE_SPMD_LP is a build flag that is used to enable support for
SPMD logical partitions.
Note that the approach chosen is to keep SPMD and SPMC logical
partition support separate, as opposed to extend the existing SPMC
logical partition support since the code would need to have a number of
ifdefs and the interactions with various build options such as
SPMC_AT_EL3 needs to be accounted for, which would make code more
complicated.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I9642ddbf6ea26dd3f4a283baec598d61c07e3661
2023-08-03 07:03:13 -07:00