feat(cpus): conform DSU errata to errata framework PCS
Errata framework expects workarounds to clobber x0 to x8 and checker
functions to clobber x0-x4.
Update DSU errata functions to adhere to the standard, which is documented
here: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19295.
Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: Ie0e492473ab8b2bee4335b6b1db00796fabdd59d
diff --git a/lib/cpus/aarch64/dsu_helpers.S b/lib/cpus/aarch64/dsu_helpers.S
index b7e028a..a34b9a6 100644
--- a/lib/cpus/aarch64/dsu_helpers.S
+++ b/lib/cpus/aarch64/dsu_helpers.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2022, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2019-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -44,11 +44,11 @@
/* --------------------------------------------------
* Errata Workaround for DSU erratum #798953.
*
- * Can clobber only: x0-x17
+ * Can clobber only: x0-x8
* --------------------------------------------------
*/
func errata_dsu_798953_wa
- mov x17, x30
+ mov x8, x30
bl check_errata_dsu_798953
cbz x0, 1f
@@ -58,7 +58,7 @@
msr CLUSTERACTLR_EL1, x0
isb
1:
- ret x17
+ ret x8
endfunc errata_dsu_798953_wa
/* -----------------------------------------------------------------------
@@ -72,7 +72,7 @@
* This function is called from both assembly and C environment. So it
* follows AAPCS.
*
- * Clobbers: x0-x15
+ * Clobbers: x0-x4
* -----------------------------------------------------------------------
*/
.globl check_errata_dsu_936184
@@ -83,7 +83,7 @@
* Default behaviour respresents SCU is always present with DSU.
* CPUs can override this definition if required.
*
- * Can clobber only: x0-x14
+ * Can clobber only: x0-x3
* --------------------------------------------------------------------
*/
func is_scu_present_in_dsu
@@ -92,7 +92,7 @@
endfunc is_scu_present_in_dsu
func check_errata_dsu_936184
- mov x15, x30
+ mov x4, x30
bl is_scu_present_in_dsu
cmp x0, xzr
/* Default error status */
@@ -116,17 +116,17 @@
b.hs 1f
mov x0, #ERRATA_APPLIES
1:
- ret x15
+ ret x4
endfunc check_errata_dsu_936184
/* --------------------------------------------------
* Errata Workaround for DSU erratum #936184.
*
- * Can clobber only: x0-x17
+ * Can clobber only: x0-x8
* --------------------------------------------------
*/
func errata_dsu_936184_wa
- mov x17, x30
+ mov x8, x30
bl check_errata_dsu_936184
cbz x0, 1f
@@ -137,7 +137,7 @@
msr CLUSTERACTLR_EL1, x0
isb
1:
- ret x17
+ ret x8
endfunc errata_dsu_936184_wa
/* -----------------------------------------------------------------------
@@ -176,11 +176,11 @@
/* --------------------------------------------------
* Errata Workaround for DSU erratum #2313941.
*
- * Can clobber only: x0-x17
+ * Can clobber only: x0-x8
* --------------------------------------------------
*/
func errata_dsu_2313941_wa
- mov x17, x30
+ mov x8, x30
bl check_errata_dsu_2313941
cbz x0, 1f
@@ -190,6 +190,5 @@
msr CLUSTERACTLR_EL1, x0
isb
1:
- ret x17
+ ret x8
endfunc errata_dsu_2313941_wa
-