xen/arm: Add ARCH_WORKAROUND_2 support for guests
authorJulien Grall <julien.grall@arm.com>
Tue, 12 Jun 2018 11:36:36 +0000 (12:36 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 22 Jun 2018 01:59:42 +0000 (02:59 +0100)
commita7898e4c593f83cc5db419d99bdecc0b220bf4e3
tree4206a5eac72c6913e89ad4f9b547fa9c2d620abe
parent07182e7d490aa6318a9d33706d8b40cbdb62e51d
xen/arm: Add ARCH_WORKAROUND_2 support for guests

In order to offer ARCH_WORKAROUND_2 support to guests, we need to track the
state of the workaround per-vCPU. The field 'pad' in cpu_info is now
repurposed to store flags easily accessible in assembly.

As the hypervisor will always run with the workaround enabled, we may
need to enable (on guest exit) or disable (on guest entry) the
workaround.

A follow-up patch will add fastpath for the workaround for arm64 guests.

Note that check_workaround_ssbd() is used instead of ssbd_get_state()
because the former is implemented using an alternative. Thefore the code
will be shortcut on affected platform.

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/domain.c
xen/arch/arm/traps.c
xen/arch/arm/vsmc.c
xen/include/asm-arm/current.h