]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest
authorJulien Grall <julien.grall@arm.com>
Mon, 23 Sep 2019 16:45:22 +0000 (17:45 +0100)
committerJulien Grall <julien.grall@arm.com>
Fri, 1 Nov 2019 14:31:07 +0000 (14:31 +0000)
commitefee8ba9bf84d54e752f2a44c510cdfb3cc0c282
tree5b2e7a3656a07f525adfc91ed7cd7bb5c296a4bf
parentdf1259540c3dd541ae52a31ca80953ce6de8c49f
xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest

At the moment, SSBD workaround is re-enabled for Xen after interrupts
are unmasked. This means we may end up to execute some part of the
hypervisor if an interrupt is received before the workaround is
re-enabled.

Each trap may require to unmask different interrupts.
As the rest of enter_hypervisor_from_guest() does not require to have
interrupts masked, the function is now split in two parts:
    1) enter_hypervisor_from_guest_preirq() called with interrupts
       masked.
    2) enter_hypervisor_from_guest() called with interrupts unmasked.

Note that while it might be possible to avoid spliting the function in
two parts, it requires a bit more work than I can currently invest to
avoid using indirect branch.

Furthermore, the function name is rather generic as there might be more
work to dob before interrupts are unmasked in the future.

Fixes: a7898e4c59 ("xen/arm: Add ARCH_WORKAROUND_2 support for guests")
Reported-by: Andrii Anisov <andrii_anisov@epam.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/arm/arm32/entry.S
xen/arch/arm/arm64/entry.S
xen/arch/arm/traps.c