Messages in this thread |  | | Subject | Re: [RFC 09/10] x86/enter: Create macros to restrict/unrestrict Indirect Branch Speculation | From | David Woodhouse <> | Date | Sun, 04 Feb 2018 20:22:33 +0000 |
| |
On Sun, 2018-02-04 at 19:43 +0100, Thomas Gleixner wrote: > > __x86_return_thunk would look like this: > > __x86_return_thunk: > testl $0xf, PER_CPU_VAR(call_depth) > jnz 1f > stuff_rsb > 1: > decl PER_CPU_VAR(call_depth) > ret > > The call_depth variable would be reset on context switch.
Note that the 'jnz' can be predicted taken there, allowing the CPU to speculate all the way to the 'ret'... and beyond.
[unhandled content-type:application/x-pkcs7-signature] |  |