x86/spec-ctrl: Consistently halt speculation using int3
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Jun 2022 21:15:25 +0000 (22:15 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 19 Jul 2022 13:28:18 +0000 (14:28 +0100)
commitaddb336f4afb244fd57eb141a9c6ac365ed36563
tree9ff39208a037ad80c93b9a5bd26aa77123b78a36
parente500b6b8d07f87593a9d0e3a391456ef4ac5ee34
x86/spec-ctrl: Consistently halt speculation using int3

The RSB stuffing loop and retpoline thunks date from the very beginning, when
halting speculation was a brand new field.

These days, we've largely settled on int3 for halting speculation in
non-architectural paths.  It's a single byte, and is fully serialising - a
requirement for delivering #BP if it were to execute.

Update the thunks.  Mostly for consistency across the codebase, but it does
shrink every entrypath in Xen by 6 bytes which is a marginal win.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/include/asm/spec_ctrl_asm.h
xen/arch/x86/indirect-thunk.S