]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Place a speculation barrier sequence following an eret instruction
authorJulien Grall <julien@xen.org>
Thu, 19 Dec 2019 08:12:21 +0000 (08:12 +0000)
committerJulien Grall <julien@xen.org>
Tue, 14 Jan 2020 14:27:04 +0000 (14:27 +0000)
commitcf2e9cc0ba0432f05cdca36dcd46be5fdfd7ca0c
treeac3a5bb3b5915d8afb8b8c2d507818a17e42feca
parent43ab30b13fe8b1d5f92a9ad2ca7d61f4c77b6cac
xen/arm: Place a speculation barrier sequence following an eret instruction

Some CPUs can speculate past an ERET instruction and potentially perform
speculative accesses to memory before processing the exception return.
Since the register state is often controlled by lower privilege level
at the point of an ERET, this could potentially be used as part of a
side-channel attack.

Newer CPUs may implement a new SB barrier instruction which acts
as an architected speculation barrier. For current CPUs, the sequence
DSB; ISB is known to prevent speculation.

The latter sequence is heavier than SB but it would never be executed
(this is speculation after all!).

Introduce a new macro 'sb' that could be used when a speculation barrier
is required. For now it is using dsb; isb but this could easily be
updated to cater SB in the future.

This is XSA-312.

Signed-off-by: Julien Grall <julien@xen.org>
xen/arch/arm/arm32/entry.S
xen/arch/arm/arm64/entry.S
xen/include/asm-arm/macros.h