From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9DC8F3858C27; Wed, 27 Oct 2021 20:00:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DC8F3858C27 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102952] New code-gen options for retpolines and straight line speculation Date: Wed, 27 Oct 2021 20:00:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2021 20:00:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102952 --- Comment #8 from H.J. Lu --- (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=3D > >=20 > > x86: Add -mharden-sls=3D[none|all|return|indirect-branch] > >=20 > > Generate code to mitigate against straight line speculation. >=20 > I'm getting (a lot) spurious int3 instructions with this, for example: >=20 > 0000000000000280 : > 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 > 29b: cc int3 >=20 > That's not an *indirect* jump there. Please provide a testcase.=