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>
This commit is contained in:
Christophe Leroy
2017-11-24 08:31:09 +01:00
committed by Michael Ellerman
parent 8cf4c05712
commit 8183d99f4a
3 changed files with 7 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ static int __patch_instruction(unsigned int *exec_addr, unsigned int instr,
return 0;
}
static int raw_patch_instruction(unsigned int *addr, unsigned int instr)
int raw_patch_instruction(unsigned int *addr, unsigned int instr)
{
return __patch_instruction(addr, instr, addr);
}
@@ -155,7 +155,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
* when text_poke_area is not ready, but we still need
* to allow patching. We just do the plain old patching
*/
if (!this_cpu_read(*PTRRELOC(&text_poke_area)))
if (!this_cpu_read(text_poke_area))
return raw_patch_instruction(addr, instr);
local_irq_save(flags);