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 16:38:02 +0000 (16:38 +0000)
commit599616d70eb886b9ad0ef9d6b51693ce790504ba
treefd5771bb6543e344127f11423fa1d172bf7e68dd
parent35d1b85a6b43483f6bd007d48757434e54743e98
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>
xen/arch/arm/cpuerrata.c