[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YW/SkCW9wSnFiivN@hirez.programming.kicks-ass.net>
Date: Wed, 20 Oct 2021 10:25:52 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: x86@...nel.org, andrew.cooper3@...rix.com,
linux-kernel@...r.kernel.org, alexei.starovoitov@...il.com,
ndesaulniers@...gle.com
Subject: Re: [PATCH 4/9] x86/alternative: Implement .retpoline_sites support
On Tue, Oct 19, 2021 at 09:49:13AM -0700, Josh Poimboeuf wrote:
> @@ -1916,8 +1930,25 @@ static int read_static_call_tramps(struct objtool_file *file)
> list_for_each_entry(func, &sec->symbol_list, list) {
> if (func->bind == STB_GLOBAL &&
> !strncmp(func->name, STATIC_CALL_TRAMP_PREFIX_STR,
> - strlen(STATIC_CALL_TRAMP_PREFIX_STR)))
> + strlen(STATIC_CALL_TRAMP_PREFIX_STR))) {
> func->static_call_tramp = true;
> + }
> + }
> + }
> +
> + return 0;
> +}
> +
> +static int read_retpoline_thunks(struct objtool_file *file)
> +{
> + struct section *sec;
> + struct symbol *func;
> +
> + for_each_sec(file, sec) {
> + list_for_each_entry(func, &sec->symbol_list, list) {
> + if (func->bind == STB_GLOBAL && arch_is_retpoline(func)) {
> + func->retpoline = true;
> + }
> }
> }
I've folded these two identical loops over all symbols into a single
classify_symbols() function.
Powered by blists - more mailing lists