Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage

Instead of manually annotating each .altinstructions entry, just make
the section mergeable and store the entry size in the ELF section
header.

Either way works for objtool create_fake_symbols(), this way produces
cleaner code generation.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/5ac04e6db5be6453dce8003a771ebb0c47b4cd7a.1764694625.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Ingo Molnar
a818f28f 0c314a88

+7 -4
+2
arch/um/include/shared/common-offsets.h
··· 18 18 DEFINE(UM_KERN_GDT_ENTRY_TLS_ENTRIES, GDT_ENTRY_TLS_ENTRIES); 19 19 20 20 DEFINE(UM_SECCOMP_ARCH_NATIVE, SECCOMP_ARCH_NATIVE); 21 + 22 + DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr));
+3 -4
arch/x86/include/asm/alternative.h
··· 197 197 "773:\n" 198 198 199 199 #define ALTINSTR_ENTRY(ft_flags) \ 200 - ".pushsection .altinstructions,\"a\"\n" \ 201 - ANNOTATE_DATA_SPECIAL \ 200 + ".pushsection .altinstructions, \"aM\", @progbits, " \ 201 + __stringify(ALT_INSTR_SIZE) "\n" \ 202 202 " .long 771b - .\n" /* label */ \ 203 203 " .long 774f - .\n" /* new instruction */ \ 204 204 " .4byte " __stringify(ft_flags) "\n" /* feature + flags */ \ ··· 339 339 * instruction. See apply_alternatives(). 340 340 */ 341 341 .macro altinstr_entry orig alt ft_flags orig_len alt_len 342 - ANNOTATE_DATA_SPECIAL 343 342 .long \orig - . 344 343 .long \alt - . 345 344 .4byte \ft_flags ··· 362 363 741: \ 363 364 .skip -(((744f-743f)-(741b-740b)) > 0) * ((744f-743f)-(741b-740b)),0x90 ;\ 364 365 742: \ 365 - .pushsection .altinstructions,"a" ; \ 366 + .pushsection .altinstructions, "aM", @progbits, ALT_INSTR_SIZE ;\ 366 367 altinstr_entry 740b,743f,flag,742b-740b,744f-743f ; \ 367 368 .popsection ; \ 368 369 .pushsection .altinstr_replacement,"ax" ; \
+2
arch/x86/kernel/asm-offsets.c
··· 124 124 OFFSET(ARIA_CTX_rounds, aria_ctx, rounds); 125 125 #endif 126 126 127 + BLANK(); 128 + DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); 127 129 }