ARM: PSCI: Add secure stack and data sections
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 15 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 15 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [U-Boot] [PATCH 00/15] ARM: PSCI: Add secure stack and data sections
Hi,
Quoted 5 lines · Chen-Yu Tsai
Hi everyone,
This is ARM PSCI improvements part 2. This series cleans up PSCI stack allocation and target PC storage by introducing a secure stack section and a secure data section.
I've added this series to my personal repo sunxi-wip branch for testing.
It might be best to also merge it via the u-boot-sunxi tree ?
Regards,
Hans
Quoted 95 lines
The series got larger than I planned. Some patches are just moving or consolidating code, and a few are adding missing macros. It's based on v3 of my "sunxi: PSCI implementation rewrite in C" series from earlier.
Patch 1 consolidates the stack setup code from all the PSCI-enabled platforms (which likely originated from the initial sunxi version) into a common function, and moves it into a seperate common function that is called before
psci_arch_init. A weak stubpsci_arch_initis added for platforms that no longer need a custom version.Patch 2 converts the remaining sunxi PSCI assembly code into C.
Patch 3 adds the missing
CONFIG_ARMV7_PSCI_NR_CPUS=2for sun7i/A20.Patch 4 makes the linker page align PSCI text only when it is directly executed, i.e. not copied to
CONFIG_ARMV7_SECURE_BASE.Patch 5 adds a fallback value for
CONFIG_ARMV7_PSCI_NR_CPUS. The value is 4, which was the fixed maximum number of stacks allocated.Patch 6 adds an empty stack section for the secure monitor.
Patch 7 has PSCI allocate its stack in the new secure stack section.
Patch 8 removes the now unused
psci_text_endsymbol. This was previously used to find where to allocate the stack.Patch 9 adds a config variable for specifying the maximum size of the secure section (text, data, stack, etc.) and checks if the binary exceeds it.
Patch 10 defines
CONFIG_ARMV7_SECURE_MAX_SIZEfor sun6i/sun7i (A31/A20), Allwinner SoCs that have a block of secure SRAM.Patch 11 moves the
__securemacro toasm/secure.h. Previously sunxi and i.MX7 were defining it themselves.Patch 12 adds a secure data section, and a
__secure_datamacro.Patch 13 adds helper functions to save and get per-CPU target PC addresses for use in PSCI.
Patch 14 converts all PSCI-enabled platforms to the new helper functions to save/get target PC addresses.
Patch 15 makes the
psci_get_cpu_stack_topfunction local/static. This function should only be used by the stack setup routine.Regards
ChenYuChen-Yu Tsai (15):
ARM: PSCI: Split out common stack setup code frompsci_arch_init
sunxi: Move remaining PSCI assembly code to C
sunxi: Add missingCONFIG_ARMV7_PSCI_NR_CPUSfor sun7i
ARM: Page align secure section only when it is executed in situ
ARM: PSCI: Add fallback value forCONFIG_ARMV7_PSCI_NR_CPUS
ARM: Add an empty secure stack section
ARM: PSCI: Allocate PSCI stack in secure stack section
ARM: PSCI: Remove unusedpsci_text_endsymbol
ARM: AddCONFIG_ARMV7_SECURE_MAX_SIZEand check size of secure section
sunxi: DefineCONFIG_ARMV7_SECURE_MAX_SIZEfor sun6i/sun7i
ARM: Move__securedefinition to commonasm/secure.h
ARM: Add secure section for initialized data
ARM: PSCI: Add helper functions to access per-CPU target PC storage
ARM: PSCI: Switch to per-CPU target PC storage in secure data section
ARM: PSCI: Makepsci_get_cpu_stack_toplocal toarmv7/psci.Sarch/arm/cpu/armv7/Makefile | 1 + arch/arm/cpu/armv7/ls102xa/psci.S | 26 ++++---------- arch/arm/cpu/armv7/mx7/psci-mx7.c | 2 +- arch/arm/cpu/armv7/mx7/psci.S | 31 +++++------------ arch/arm/cpu/armv7/nonsec_virt.S | 7 +++- arch/arm/cpu/armv7/psci-common.c | 39 +++++++++++++++++++++ arch/arm/cpu/armv7/psci.S | 55 ++++++++++++++++++++++-------- arch/arm/cpu/armv7/sunxi/Makefile | 1 - arch/arm/cpu/armv7/sunxi/psci.c | 9 +++-- arch/arm/cpu/armv7/sunxi/psci_head.S | 66 ------------------------------------ arch/arm/cpu/u-boot.lds | 60 +++++++++++++++++++++++++------- arch/arm/include/asm/armv7.h | 2 ++ arch/arm/include/asm/config.h | 5 +++ arch/arm/include/asm/psci.h | 9 ++++- arch/arm/include/asm/secure.h | 3 ++ arch/arm/lib/sections.c | 2 ++ arch/arm/mach-tegra/psci.S | 16 ++++----- include/configs/sun6i.h | 1 + include/configs/sun7i.h | 2 ++ 19 files changed, 183 insertions(+), 154 deletions(-) create mode 100644 arch/arm/cpu/armv7/psci-common.c delete mode 100644 arch/arm/cpu/armv7/sunxi/psci_head.S