mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
refactor(cpus): convert Neoverse Poseidon to framework
This involves replacing: * the reset_func with the standard cpu_reset_func_{start,end} to apply errata automatically * the <cpu>_errata_report with the errata_report_shim to report errata automatically ...and for each erratum: * the prologue with the workaround_<type>_start to do the checks and framework registration automatically * the epilogue with the workaround_<type>_end * the checker function with the check_erratum_<type> to make it more descriptive It is important to note that the errata workaround sequences remain unchanged and preserve their git blame. Testing was conducted by: * Manual comparison of disassembly of converted functions with non- converted functions aarch64-none-elf-objdump -D <trusted-firmware-a with conversion>/build/fvp/release/bl31/bl31.elf vs aarch64-none-elf-objdump -D <trusted-firmware-a clean repo>/build/fvp/release/bl31/bl31.elf * Build for release with all errata flags enabled and run default tftf tests CROSS_COMPILE=aarch64-none-elf- make PLAT=fvp DEBUG=0 \ CTX_INCLUDE_AARCH32_REGS=0 HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 \ BL33=./../tf-a-tests/build/fvp/release/tftf.bin \ WORKAROUND_CVE_2022_23960=1 ERRATA_ABI_SUPPORT=1 all fip * Build for debug with all errata enabled and step through ArmDS at reset to ensure all functions are entered. Change-Id: I34e27e468d4f971423a03a95a4a52f4af8bd783a Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
This commit is contained in:
parent
2360d18bb5
commit
471e0b8b34
1 changed files with 17 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Arm Limited. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -26,6 +26,19 @@
|
|||
wa_cve_2022_23960_bhb_vector_table NEOVERSE_POSEIDON_BHB_LOOP_COUNT, neoverse_poseidon
|
||||
#endif /* WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
workaround_reset_start neoverse_poseidon, CVE(2022,23960), WORKAROUND_CVE_2022_23960
|
||||
#if IMAGE_BL31
|
||||
/*
|
||||
* The Neoverse-poseidon generic vectors are overridden to apply errata
|
||||
* mitigation on exception entry from lower ELs.
|
||||
*/
|
||||
adr x0, wa_cve_vbar_neoverse_poseidon
|
||||
msr vbar_el3, x0
|
||||
#endif /* IMAGE_BL31 */
|
||||
workaround_reset_end neoverse_poseidon, CVE(2022,23960)
|
||||
|
||||
check_erratum_chosen neoverse_poseidon, CVE(2022, 23960), WORKAROUND_CVE_2022_23960
|
||||
|
||||
/* ---------------------------------------------
|
||||
* HW will do the cache maintenance while powering down
|
||||
* ---------------------------------------------
|
||||
|
@ -42,52 +55,12 @@ func neoverse_poseidon_core_pwr_dwn
|
|||
ret
|
||||
endfunc neoverse_poseidon_core_pwr_dwn
|
||||
|
||||
func check_errata_cve_2022_23960
|
||||
#if WORKAROUND_CVE_2022_23960
|
||||
mov x0, #ERRATA_APPLIES
|
||||
#else
|
||||
mov x0, #ERRATA_MISSING
|
||||
#endif
|
||||
ret
|
||||
endfunc check_errata_cve_2022_23960
|
||||
|
||||
func neoverse_poseidon_reset_func
|
||||
cpu_reset_func_start neoverse_poseidon
|
||||
/* Disable speculative loads */
|
||||
msr SSBS, xzr
|
||||
cpu_reset_func_end neoverse_poseidon
|
||||
|
||||
#if IMAGE_BL31 && WORKAROUND_CVE_2022_23960
|
||||
/*
|
||||
* The Neoverse Poseidon generic vectors are overridden to apply
|
||||
* errata mitigation on exception entry from lower ELs.
|
||||
*/
|
||||
adr x0, wa_cve_vbar_neoverse_poseidon
|
||||
msr vbar_el3, x0
|
||||
#endif /* IMAGE_BL31 && WORKAROUND_CVE_2022_23960 */
|
||||
|
||||
isb
|
||||
ret
|
||||
endfunc neoverse_poseidon_reset_func
|
||||
|
||||
#if REPORT_ERRATA
|
||||
/*
|
||||
* Errata printing function for Neoverse Poseidon. Must follow AAPCS.
|
||||
*/
|
||||
func neoverse_poseidon_errata_report
|
||||
stp x8, x30, [sp, #-16]!
|
||||
|
||||
bl cpu_get_rev_var
|
||||
mov x8, x0
|
||||
|
||||
/*
|
||||
* Report all errata. The revision-variant information is passed to
|
||||
* checking functions of each errata.
|
||||
*/
|
||||
report_errata WORKAROUND_CVE_2022_23960, neoverse_poseidon, cve_2022_23960
|
||||
|
||||
ldp x8, x30, [sp], #16
|
||||
ret
|
||||
endfunc neoverse_poseidon_errata_report
|
||||
#endif
|
||||
errata_report_shim neoverse_poseidon
|
||||
|
||||
/* ---------------------------------------------
|
||||
* This function provides Neoverse-Poseidon specific
|
||||
|
|
Loading…
Add table
Reference in a new issue