[Bug target/102952] New code-gen options for retpolines and straight line speculation
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 27 20:00:17 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to peterz from comment #7)
> (In reply to H.J. Lu from comment #3)
> > Created attachment 51678 [details]
> > A patch to add -mharden-sls=
> >
> > x86: Add -mharden-sls=[none|all|return|indirect-branch]
> >
> > Generate code to mitigate against straight line speculation.
>
> I'm getting (a lot) spurious int3 instructions with this, for example:
>
> 0000000000000280 <do_SYSENTER_32>:
> 280: 48 81 8f 90 00 00 00 00 02 00 00 orq $0x200,0x90(%rdi)
> 28b: 48 8b 47 20 mov 0x20(%rdi),%rax
> 28f: 48 89 87 98 00 00 00 mov %rax,0x98(%rdi)
> 296: e9 75 ff ff ff jmp 210 <do_fast_syscall_32>
> 29b: cc int3
>
> That's not an *indirect* jump there.
Please provide a testcase.
More information about the Gcc-bugs
mailing list