lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] Revert "x86/retpoline: Remove .text..__x86.return_thunk section"
On Tue, Oct 10, 2023 at 07:48:33PM +0200, Peter Zijlstra wrote:
> On Tue, Oct 10, 2023 at 12:10:18PM -0500, David Kaplan wrote:
>
> > arch/x86/kernel/vmlinux.lds.S | 3 +++
> > arch/x86/lib/retpoline.S | 2 ++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
> > index 9cdb1a7332c4..54a5596adaa6 100644
> > --- a/arch/x86/kernel/vmlinux.lds.S
> > +++ b/arch/x86/kernel/vmlinux.lds.S
> > @@ -132,7 +132,10 @@ SECTIONS
> > LOCK_TEXT
> > KPROBES_TEXT
> > SOFTIRQENTRY_TEXT
> > +#ifdef CONFIG_RETPOLINE
> > *(.text..__x86.indirect_thunk)
> > + *(.text..__x86.return_thunk)
> > +#endif
> > STATIC_CALL_TEXT
> >
> > ALIGN_ENTRY_TEXT_BEGIN
> > diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
> > index db813113e637..3da768a71cf9 100644
> > --- a/arch/x86/lib/retpoline.S
> > +++ b/arch/x86/lib/retpoline.S
> > @@ -129,6 +129,8 @@ SYM_CODE_END(__x86_indirect_jump_thunk_array)
> >
> > #ifdef CONFIG_RETHUNK
>
> Perhaps elucidate the future reader with a comment here? Lest someone
> tries removing it again.

Yes, please.

Also we could make objtool properly detect the non-relocated jump
target. But this works for now.

--
Josh

\
 
 \ /
  Last update: 2023-10-10 21:58    [W:0.359 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site