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 16:38:02 +0000 (16:38 +0000)
commitc0a56ea0fd92ecb471936b7355ddbecbaea3707c
treef4f3e7d44b20ba42352064a2bc1192b6f6746dc3
parent62c91eb66a2904eefb1d1d9642e3697a1e3c3a3c
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>
xen/arch/arm/arm64/entry.S
xen/arch/arm/vsmc.c