aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2014-11-28 08:40:45 -0500
committerWill Deacon <will.deacon@arm.com>2014-12-04 05:28:24 -0500
commit932ded4b0b9bf111fbf9d176ec12152a0d29b0fd (patch)
tree72ae4cdbea21713d55576bf12fa8c095d3b48679 /arch/arm64/include
parentcbbf2e6ed7c2adabfa5cc64901c7b89e029d1e20 (diff)
arm64: add module support for alternatives fixups
Currently the kernel patches all necessary instructions once at boot time, so modules are not covered by this. Change the apply_alternatives() function to take a beginning and an end pointer and introduce a new variant (apply_alternatives_all()) to cover the existing use case for the static kernel image section. Add a module_finalize() function to arm64 to check for an alternatives section in a module and patch only the instructions from that specific area. Since that module code is not touched before the module initialization has ended, we don't need to halt the machine before doing the patching in the module's code. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/alternative.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
index f6d206e7f9e9..d261f01e2bae 100644
--- a/arch/arm64/include/asm/alternative.h
+++ b/arch/arm64/include/asm/alternative.h
@@ -13,7 +13,8 @@ struct alt_instr {
13 u8 alt_len; /* size of new instruction(s), <= orig_len */ 13 u8 alt_len; /* size of new instruction(s), <= orig_len */
14}; 14};
15 15
16void apply_alternatives(void); 16void apply_alternatives_all(void);
17void apply_alternatives(void *start, size_t length);
17void free_alternatives_memory(void); 18void free_alternatives_memory(void);
18 19
19#define ALTINSTR_ENTRY(feature) \ 20#define ALTINSTR_ENTRY(feature) \