mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
x86/nospec, objtool: Introduce ANNOTATE_IGNORE_ALTERNATIVE
To facillitate other usage of ignoring alternatives; rename ANNOTATE_NOSPEC_IGNORE to ANNOTATE_IGNORE_ALTERNATIVE. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
b69656fa7e
commit
ff05ab2305
4 changed files with 34 additions and 23 deletions
|
|
@ -457,13 +457,13 @@ static void add_ignores(struct objtool_file *file)
|
|||
* But it at least allows objtool to understand the control flow *around* the
|
||||
* retpoline.
|
||||
*/
|
||||
static int add_nospec_ignores(struct objtool_file *file)
|
||||
static int add_ignore_alternatives(struct objtool_file *file)
|
||||
{
|
||||
struct section *sec;
|
||||
struct rela *rela;
|
||||
struct instruction *insn;
|
||||
|
||||
sec = find_section_by_name(file->elf, ".rela.discard.nospec");
|
||||
sec = find_section_by_name(file->elf, ".rela.discard.ignore_alts");
|
||||
if (!sec)
|
||||
return 0;
|
||||
|
||||
|
|
@ -475,7 +475,7 @@ static int add_nospec_ignores(struct objtool_file *file)
|
|||
|
||||
insn = find_insn(file, rela->sym->sec, rela->addend);
|
||||
if (!insn) {
|
||||
WARN("bad .discard.nospec entry");
|
||||
WARN("bad .discard.ignore_alts entry");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1239,7 +1239,7 @@ static int decode_sections(struct objtool_file *file)
|
|||
|
||||
add_ignores(file);
|
||||
|
||||
ret = add_nospec_ignores(file);
|
||||
ret = add_ignore_alternatives(file);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue