From: Andy Lutomirski Subject: Re: [PATCH v1 06/27] x86/entry/64: Adapt assembly for PIE support Date: Fri, 20 Oct 2017 18:27:24 +0200 Message-ID: <1F0B8A18-092F-42AF-91B4-7A5D414ED83D@amacapital.net> References: <20171011203027.11248-1-thgarnie@google.com> <20171011203027.11248-7-thgarnie@google.com> <20171020082646.bkxrps35sb3gq2nr@gmail.com> <20171020152028.syq6woeet6it3z3h@gmail.com> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: Thomas Garnier , Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Arnd Bergmann , Kees Cook , Andrey Ryabinin , Matthias Kaehlcke , Tom Lendacky , Andy Lutomirski , "Kirill A . Shutemov" , Borislav Petkov , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Juergen Gross , Chris Wright , Alok Kataria , Rusty Russell , Tejun Heo Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: <20171020152028.syq6woeet6it3z3h@gmail.com> List-Id: linux-crypto.vger.kernel.org > On Oct 20, 2017, at 5:20 PM, Ingo Molnar wrote: >=20 >=20 > * Thomas Garnier wrote: >=20 >>>> */ >>>> - cmpq $.Lentry_SYSCALL_64_after_fastpath_call, (%rsp) >>>> + leaq .Lentry_SYSCALL_64_after_fastpath_call(%rip), %r11 >>>> + cmpq %r11, (%rsp) >>>> jne 1f >=20 >>> This patch seems to add extra overhead to the syscall fast-path even whe= n PIE is >>> disabled, right? >>=20 >> It does add extra instructions when one is not possible, I preferred >> that over ifdefing but I can change it. >=20 > So my problem is, this pattern repeats in many other places as well, but s= prinking=20 > various pieces of assembly code with #ifdefs would be very bad as well. >=20 > I have no good idea how to solve this. >=20 How about: .macro JMP_TO_LABEL ... > Thanks, >=20 > Ingo