Browse Source

refactor(spm-mm): reorganize secure partition manager shim code

In preparation for adding the support for SEL0 SP in EL3 SPMC,
restructure the existing SPM_MM shim code in a way that allows reuse
of the code for both SPM_MM interface and FF-A EL3 SPMC interface. The
code for changing exception levels is identical for both.

With this restructuring of the code, the shim exception code is moved to
the common sub-directory.

Signed-off-by: Sayanta Pattanayak <sayanta.pattanayak@arm.com>
Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Change-Id: Iadda9cf73f12b56e6a1d31fc21b5ba5dc355867f
pull/1993/merge
Nishant Sharma 3 years ago
parent
commit
1132f06885
  1. 0
      services/std_svc/spm/common/aarch64/spm_shim_exceptions.S
  2. 8
      services/std_svc/spm/common/include/spm_shim_private.h
  3. 7
      services/std_svc/spm/common/spm.mk
  4. 1
      services/std_svc/spm/spm_mm/spm_mm.mk
  5. 4
      services/std_svc/spm/spm_mm/spm_mm_setup.c
  6. 4
      services/std_svc/spm/spm_mm/spm_mm_xlat.c

0
services/std_svc/spm/spm_mm/aarch64/spm_mm_shim_exceptions.S → services/std_svc/spm/common/aarch64/spm_shim_exceptions.S

8
services/std_svc/spm/spm_mm/spm_mm_shim_private.h → services/std_svc/spm/common/include/spm_shim_private.h

@ -1,11 +1,11 @@
/*
* Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2023, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SPM_MM_SHIM_PRIVATE_H
#define SPM_MM_SHIM_PRIVATE_H
#ifndef SPM_SHIM_PRIVATE_H
#define SPM_SHIM_PRIVATE_H
#include <stdint.h>
@ -23,4 +23,4 @@ IMPORT_SYM(uintptr_t, __SPM_SHIM_EXCEPTIONS_END__, SPM_SHIM_EXCEPTIONS_END);
#define SPM_SHIM_EXCEPTIONS_SIZE \
(SPM_SHIM_EXCEPTIONS_END - SPM_SHIM_EXCEPTIONS_START)
#endif /* SPM_MM_SHIM_PRIVATE_H */
#endif /* SPM_SHIM_PRIVATE_H */

7
services/std_svc/spm/common/spm.mk

@ -1,5 +1,5 @@
#
# Copyright (c) 2022, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2022-2023, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@ -10,8 +10,9 @@ endif
INCLUDES += -Iservices/std_svc/spm/common/include
SPM_SOURCES := $(addprefix services/std_svc/spm/common/,\
${ARCH}/spm_helpers.S)
SPM_SOURCES := $(addprefix services/std_svc/spm/common/, \
${ARCH}/spm_helpers.S \
${ARCH}/spm_shim_exceptions.S)
# Let the top-level Makefile know that we intend to include a BL32 image
NEED_BL32 := yes

1
services/std_svc/spm/spm_mm/spm_mm.mk

@ -21,7 +21,6 @@ ifeq (${CTX_INCLUDE_FPREGS},0)
endif
SPM_MM_SOURCES := $(addprefix services/std_svc/spm/spm_mm/, \
${ARCH}/spm_mm_shim_exceptions.S \
spm_mm_main.c \
spm_mm_setup.c \
spm_mm_xlat.c)

4
services/std_svc/spm/spm_mm/spm_mm_setup.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2023, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2021, NVIDIA Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@ -21,7 +21,7 @@
#include "spm_common.h"
#include "spm_mm_private.h"
#include "spm_mm_shim_private.h"
#include "spm_shim_private.h"
/* Setup context of the Secure Partition */
void spm_sp_setup(sp_context_t *sp_ctx)

4
services/std_svc/spm/spm_mm/spm_mm_xlat.c

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2023, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -15,7 +15,7 @@
#include <services/spm_mm_svc.h>
#include "spm_mm_private.h"
#include "spm_mm_shim_private.h"
#include "spm_shim_private.h"
/* Place translation tables by default along with the ones used by BL31. */
#ifndef PLAT_SP_IMAGE_XLAT_SECTION_NAME

Loading…
Cancel
Save