From: Ingo Molnar Subject: Re: [PATCH v1 06/27] x86/entry/64: Adapt assembly for PIE support Date: Fri, 20 Oct 2017 17:20:28 +0200 Message-ID: <20171020152028.syq6woeet6it3z3h@gmail.com> References: <20171011203027.11248-1-thgarnie@google.com> <20171011203027.11248-7-thgarnie@google.com> <20171020082646.bkxrps35sb3gq2nr@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Nicolas Pitre , Michal Hocko , Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-doc@vger.kernel.org, Daniel Micay , Len Brown , Peter Zijlstra , Christopher Li , Jan H =?iso-8859-1?Q?=2E_Sch=F6nherr?= , Alexei Starovoitov , virtualization@lists.linux-foundation.org, David Howells , Paul Gortmaker , Waiman Long , Pavel Machek , "H . Peter Anvin" , Kernel Hardening , Christoph Lameter , Thomas Gleixner , the arch/x86 maintainers , Herbert Xu , Daniel Borkmann , Jon To: Thomas Garnier Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: linux-crypto.vger.kernel.org * Thomas Garnier wrote: > >> */ > >> - cmpq $.Lentry_SYSCALL_64_after_fastpath_call, (%rsp) > >> + leaq .Lentry_SYSCALL_64_after_fastpath_call(%rip), %r11 > >> + cmpq %r11, (%rsp) > >> jne 1f > > This patch seems to add extra overhead to the syscall fast-path even when PIE is > > disabled, right? > > It does add extra instructions when one is not possible, I preferred > that over ifdefing but I can change it. So my problem is, this pattern repeats in many other places as well, but sprinking various pieces of assembly code with #ifdefs would be very bad as well. I have no good idea how to solve this. Thanks, Ingo