From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH v1 06/27] x86/entry/64: Adapt assembly for PIE support Date: Fri, 20 Oct 2017 19:52:17 +0200 Message-ID: <3EA62B98-ED93-48BC-9113-05CA09E6FC5E__31815.2972301052$1508521984$gmane$org@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: 7bit Return-path: In-Reply-To: <20171020152028.syq6woeet6it3z3h@gmail.com> 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 To: Ingo Molnar Cc: Nicolas Pitre , Michal Hocko , =?utf-8?Q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , linux-doc@vger.kernel.org, Daniel Micay , Len Brown , Peter Zijlstra , Christopher Li , "=?utf-8?Q? Jan_H_._Sch=C3=B6nherr ?=" , 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 List-Id: virtualization@lists.linuxfoundation.org > On Oct 20, 2017, at 5:20 PM, Ingo Molnar wrote: > > > * 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, Ugh, brain was off. This is a bit messy. We could use a macro for this, too, I suppose. > > Ingo