From 6b8d7ece3b26e579d012a33b0c8e2297cd08fc26 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 22 Jul 2020 16:17:30 +0200 Subject: [PATCH] Revert "arm64/alternatives: use subsections for replacement sequences" This reverts commit d6d9145866fbfac91c9c1dd8e32b355bdd63d000 which is commit f7b93d42945cc71e1346dd5ae07c59061d56745e upstream as it makes clang go boom in the build systems :( Cc: Will Deacon Signed-off-by: Greg Kroah-Hartman Change-Id: I082c05e3d9cc00fd7173897a7c89c56aecf7facb --- arch/arm64/include/asm/alternative.h | 16 ++++++++-------- arch/arm64/kernel/vmlinux.lds.S | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index 849d891c60a8..1a7ba3de7079 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h @@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { } ".pushsection .altinstructions,\"a\"\n" \ ALTINSTR_ENTRY(feature) \ ".popsection\n" \ - ".subsection 1\n" \ + ".pushsection .altinstr_replacement, \"a\"\n" \ "663:\n\t" \ newinstr "\n" \ "664:\n\t" \ - ".previous\n\t" \ + ".popsection\n\t" \ ".org . - (664b-663b) + (662b-661b)\n\t" \ ".org . - (662b-661b) + (664b-663b)\n" \ ".endif\n" @@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } 662: .pushsection .altinstructions, "a" altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f .popsection - .subsection 1 + .pushsection .altinstr_replacement, "ax" 663: \insn2 -664: .previous +664: .popsection .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b) .endif @@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .pushsection .altinstructions, "a" altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f .popsection - .subsection 1 + .pushsection .altinstr_replacement, "ax" .align 2 /* So GAS knows label 661 is suitably aligned */ 661: .endm @@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .macro alternative_else 662: .if .Lasm_alt_mode==0 - .subsection 1 + .pushsection .altinstr_replacement, "ax" .else - .previous + .popsection .endif 663: .endm @@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .macro alternative_endif 664: .if .Lasm_alt_mode==0 - .previous + .popsection .endif .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 6b6bc70c9aec..78b2fec39ba0 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -154,6 +154,9 @@ SECTIONS *(.altinstructions) __alt_instructions_end = .; } + .altinstr_replacement : { + *(.altinstr_replacement) + } . = ALIGN(PAGE_SIZE); __inittext_end = .;