xen/arm: move errata CSV2 check earlier
authorBertrand Marquis <bertrand.marquis@arm.com>
Tue, 15 Feb 2022 10:39:47 +0000 (10:39 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Mar 2022 17:15:41 +0000 (17:15 +0000)
commit3d963874461b3001e33f3ff90e285670f04d16c4
tree95c399bdccb62325e70d81ddb12e09b31450caef
parent8d18b03c95850239a1a9ebaeb565936c7c9ae070
xen/arm: move errata CSV2 check earlier

CSV2 availability check is done after printing to the user that
workaround 1 will be used. Move the check before to prevent saying to the
user that workaround 1 is used when it is not because it is not needed.
This will also allow to reuse install_bp_hardening_vec function for
other use cases.

Code previously returning "true", now returns "0" to conform to
enable_smccc_arch_workaround_1 returning an int and surrounding code
doing a "return 0" if workaround is not needed.

This is part of XSA-398 / CVE-2022-23960.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Julien Grall <julien@xen.org>
(cherry picked from commit 599616d70eb886b9ad0ef9d6b51693ce790504ba)
xen/arch/arm/cpuerrata.c