xen/arm: Allow to discover and use SMCCC_ARCH_WORKAROUND_3
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 17 Feb 2022 14:52:54 +0000 (14:52 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Mar 2022 17:15:41 +0000 (17:15 +0000)
commitdab616cd3d4856a7a4d4f3a429a82dbdbf1aeeb9
treebc12a9e075e2223ad23446b90ccb215291c10604
parent789523a2aac88e3668f9c4ad892fa47b5f6bf1a7
xen/arm: Allow to discover and use SMCCC_ARCH_WORKAROUND_3

Allow guest to discover whether or not SMCCC_ARCH_WORKAROUND_3 is
supported and create a fastpath in the code to handle guests request to
do the workaround.

The function SMCCC_ARCH_WORKAROUND_3 will be called by the guest for
flushing the branch history. So we want the handling to be as fast as
possible.

As the mitigation is applied on every guest exit, we can check for the
call before saving all context and return very early.

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 c0a56ea0fd92ecb471936b7355ddbecbaea3707c)
xen/arch/arm/arm64/entry.S
xen/arch/arm/vsmc.c