Re: [PATCH 1/9] objtool,x86: Replace alternatives with .retpoline_sites

From: Josh Poimboeuf
Date: Wed Oct 13 2021 - 16:11:45 EST


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@xxxxxxxxxxxxx>

+1, let the kernel patch its own damn self ;-)

> +int arch_rewrite_retpolines(struct objtool_file *file)

Guess it shouldn't be called arch_rewrite_retpolines() anymore. And it
can be moved to check.c next to create_static_call_sections().

Also is it possible to remove the arch_is_retpoline() check in
get_alt_entry()? I'm having trouble remembering why that was needed in
the first place.

--
Josh