From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Garnier Subject: Re: [RFC v3 20/27] x86/ftrace: Adapt function tracing for PIE support Date: Thu, 5 Oct 2017 09:01:14 -0700 Message-ID: References: <20171004212003.28296-1-thgarnie@google.com> <20171004212003.28296-21-thgarnie@google.com> <20171005090633.5a6ce840@gandalf.local.home> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: <20171005090633.5a6ce840@gandalf.local.home> To: Steven Rostedt Cc: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Arnd Bergmann , Kees Cook , 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 , Christoph Lameter , Boris Ostrovsky List-Id: linux-arch.vger.kernel.org On Thu, Oct 5, 2017 at 6:06 AM, Steven Rostedt wrote: > On Wed, 4 Oct 2017 14:19:56 -0700 > Thomas Garnier wrote: > >> When using -fPIE/PIC with function tracing, the compiler generates a >> call through the GOT (call *__fentry__@GOTPCREL). This instruction >> takes 6 bytes instead of 5 on the usual relative call. >> >> With this change, function tracing supports 6 bytes on traceable >> function and can still replace relative calls on the ftrace assembly >> functions. >> >> Position Independent Executable (PIE) support will allow to extended the >> KASLR randomization range below the -2G memory limit. > > Question: This 6 bytes is only the initial call that gcc creates. When > function tracing is enabled, the calls are back to the normal call to > the ftrace trampoline? That is correct. > > -- Steve > -- Thomas