[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YWbfPxkMdpr96lqx@zn.tnic>
Date: Wed, 13 Oct 2021 15:29:35 +0200
From: Borislav Petkov <bp@...en8.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: x86@...nel.org, jpoimboe@...hat.com, andrew.cooper3@...rix.com,
linux-kernel@...r.kernel.org, alexei.starovoitov@...il.com,
ndesaulniers@...gle.com
Subject: Re: [PATCH 1/9] objtool,x86: Replace alternatives with
.retpoline_sites
On Wed, Oct 13, 2021 at 02:22:18PM +0200, Peter Zijlstra wrote:
> Instead of writing complete alternatives, simply provide a list of all
> the retpoline thunk calls. Then the kernel is free to do with them as
> it pleases. Simpler code all-round.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> arch/x86/kernel/vmlinux.lds.S | 12 +++
> arch/x86/lib/retpoline.S | 42 ------------
> tools/objtool/arch/x86/decode.c | 126 +++++++-----------------------------
> tools/objtool/elf.c | 84 ------------------------
> tools/objtool/include/objtool/elf.h | 1
> 5 files changed, 38 insertions(+), 227 deletions(-)
>
> --- a/arch/x86/kernel/vmlinux.lds.S
> +++ b/arch/x86/kernel/vmlinux.lds.S
> @@ -273,6 +273,18 @@ SECTIONS
> }
#ifdef CONFIG_RETPOLINE around it I guess...
> /*
> + * List of instructions that call/jmp/jcc to retpoline thunks
> + * __x86_indirect_thunk_*(). These instructions can be patched along
> + * with alternatives, after which the section can be freed.
> + */
> + . = ALIGN(8);
> + .retpoline_sites : AT(ADDR(.retpoline_sites) - LOAD_OFFSET) {
> + __retpoline_sites = .;
> + *(.retpoline_sites)
> + __retpoline_sites_end = .;
> + }
#endif
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists