fix(el3-spmc): add datastore linker script markers

Datastore symbol used by EL3 SPMC is not relocated at
boot time when using ENABLE_PIE=1.
Use linker script markers instead of symbol.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: If22d2fc8deacc74c73d7dc51bb70093935d9fa2b
This commit is contained in:
Shruti Gupta 2022-12-20 18:01:43 +00:00
parent fa45e03c38
commit ba33528a00
3 changed files with 17 additions and 12 deletions

View file

@ -18,6 +18,9 @@ SECTIONS
ASSERT(. == ALIGN(PAGE_SIZE),
"ARM_EL3_TZC_DRAM_BASE address is not aligned on a page boundary.")
.el3_tzc_dram (NOLOAD) : ALIGN(PAGE_SIZE) {
__PLAT_SPMC_SHMEM_DATASTORE_START__ = .;
*(.arm_spmc_shmem_datastore)
__PLAT_SPMC_SHMEM_DATASTORE_END__ = .;
__EL3_SEC_DRAM_START__ = .;
*(.arm_el3_tzc_dram)
__EL3_SEC_DRAM_UNALIGNED_END__ = .;

View file

@ -7,23 +7,14 @@
#include <platform_def.h>
/*
* On the FVP platform when using the EL3 SPMC implementation allocate the
* datastore for tracking shared memory descriptors in the TZC DRAM section
* to ensure sufficient storage can be allocated.
* Provide an implementation of the accessor method to allow the datastore
* details to be retrieved by the SPMC.
* The SPMC will take care of initializing the memory region.
*/
IMPORT_SYM(uintptr_t, __PLAT_SPMC_SHMEM_DATASTORE_START__, DATASTORE_BASE);
#define PLAT_SPMC_SHMEM_DATASTORE_SIZE 512 * 1024
__section(".arm_el3_tzc_dram") static uint8_t
__section(".arm_el3_tzc_dram") __unused static uint8_t
plat_spmc_shmem_datastore[PLAT_SPMC_SHMEM_DATASTORE_SIZE];
int plat_spmc_shmem_datastore_get(uint8_t **datastore, size_t *size)
{
*datastore = plat_spmc_shmem_datastore;
*datastore = (uint8_t *)DATASTORE_BASE;
*size = PLAT_SPMC_SHMEM_DATASTORE_SIZE;
return 0;
}

View file

@ -99,6 +99,17 @@
FVP_DTB_DRAM_MAP_SIZE, \
MT_MEMORY | MT_RO | MT_NS)
/*
* On the FVP platform when using the EL3 SPMC implementation allocate the
* datastore for tracking shared memory descriptors in the TZC DRAM section
* to ensure sufficient storage can be allocated.
* Provide an implementation of the accessor method to allow the datastore
* details to be retrieved by the SPMC.
* The SPMC will take care of initializing the memory region.
*/
#define PLAT_SPMC_SHMEM_DATASTORE_SIZE 512 * 1024
#if SPMC_AT_EL3
/*
* Number of Secure Partitions supported.