diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-11-24 02:31:09 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-01-20 23:06:25 -0500 |
commit | 8183d99f4a22c2abbc543847a588df3666ef0c0c (patch) | |
tree | 4fa8acc3ff00f162c9eedf29ec9607f4aa0acf6d /arch/powerpc/lib/code-patching.c | |
parent | 8cf4c05712f04a405f0dacebcca8f042b391694a (diff) |
powerpc/lib/feature-fixups: use raw_patch_instruction()
feature fixups need to use patch_instruction() early in the boot,
even before the code is relocated to its final address, requiring
patch_instruction() to use PTRRELOC() in order to address data.
But feature fixups applies on code before it is set to read only,
even for modules. Therefore, feature fixups can use
raw_patch_instruction() instead.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index e1c58937281f..e0d881ab304e 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -38,7 +38,7 @@ static int __patch_instruction(unsigned int *exec_addr, unsigned int instr, | |||
38 | return 0; | 38 | return 0; |
39 | } | 39 | } |
40 | 40 | ||
41 | static int raw_patch_instruction(unsigned int *addr, unsigned int instr) | 41 | int raw_patch_instruction(unsigned int *addr, unsigned int instr) |
42 | { | 42 | { |
43 | return __patch_instruction(addr, instr, addr); | 43 | return __patch_instruction(addr, instr, addr); |
44 | } | 44 | } |
@@ -155,7 +155,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr) | |||
155 | * when text_poke_area is not ready, but we still need | 155 | * when text_poke_area is not ready, but we still need |
156 | * to allow patching. We just do the plain old patching | 156 | * to allow patching. We just do the plain old patching |
157 | */ | 157 | */ |
158 | if (!this_cpu_read(*PTRRELOC(&text_poke_area))) | 158 | if (!this_cpu_read(text_poke_area)) |
159 | return raw_patch_instruction(addr, instr); | 159 | return raw_patch_instruction(addr, instr); |
160 | 160 | ||
161 | local_irq_save(flags); | 161 | local_irq_save(flags); |