]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Protect against CALL/JMP straight-line speculation
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Jul 2020 11:39:59 +0000 (12:39 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Jul 2020 16:01:24 +0000 (17:01 +0100)
commit3b7dab93f2401b08c673244c9ae0f92e08bd03ba
tree21a55918663a412042940f1fcbeae69d07547d4b
parent23ca7ec0ba620db52a646d80e22f9703a6589f66
x86/spec-ctrl: Protect against CALL/JMP straight-line speculation

Some x86 CPUs speculatively execute beyond indirect CALL/JMP instructions.

With CONFIG_INDIRECT_THUNK / Retpolines, indirect CALL/JMP instructions are
converted to direct CALL/JMP's to __x86_indirect_thunk_REG(), leaving just a
handful of indirect JMPs implementing those stubs.

There is no architectrual execution beyond an indirect JMP, so use INT3 as
recommended by vendors to halt speculative execution.  This is shorter than
LFENCE (which would also work fine), but also shows up in logs if we do
unexpected execute them.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Paul Durrant <paul@xen.org>
xen/arch/x86/indirect-thunk.S