xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_2
authorJulien Grall <julien.grall@arm.com>
Tue, 12 Jun 2018 11:36:40 +0000 (12:36 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 22 Jun 2018 01:59:43 +0000 (02:59 +0100)
commit6dec2c87c4d7b2f03806266c5ceff82b69792a17
tree29f2a4903254e903f079db78d4b7c8ac3e184389
parentbb2e9fc7df592753e1fd73b4fec21c375cd3e2e1
xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_2

The function ARM_SMCCC_ARCH_WORKAROUND_2 will be called by the guest for
enabling/disabling the ssbd mitigation. So we want the handling to
be as fast as possible.

The new sequence will forward guest's ARCH_WORKAROUND_2 call to EL3 and
also track the state of the workaround per-vCPU.

Note that since we need to execute branches, this always executes after
the spectre-v2 mitigation.

This code is based on KVM counterpart "arm64: KVM: Handle guest's
ARCH_WORKAROUND_2 requests" written by Marc Zyngier.

This is part of XSA-263.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/asm-offsets.c
xen/arch/arm/arm64/entry.S
xen/arch/arm/cpuerrata.c