powerpc/lib: Don't use __put_user_asm_goto() outside of uaccess.h

__put_user_asm_goto() is internal to uaccess.h

Use __put_kernel_nofault() instead. The generated code is identical.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3e32c4f0361933909368b68f5ee569e5de661c1b.1615398498.git.christophe.leroy@csgroup.eu
This commit is contained in:
Christophe Leroy 2021-03-10 17:57:04 +00:00 committed by Michael Ellerman
parent fd69d544b0
commit e63ceebdad
1 changed files with 9 additions and 4 deletions

View File

@ -21,10 +21,15 @@
static int __patch_instruction(struct ppc_inst *exec_addr, struct ppc_inst instr, static int __patch_instruction(struct ppc_inst *exec_addr, struct ppc_inst instr,
struct ppc_inst *patch_addr) struct ppc_inst *patch_addr)
{ {
if (!ppc_inst_prefixed(instr)) if (!ppc_inst_prefixed(instr)) {
__put_user_asm_goto(ppc_inst_val(instr), patch_addr, failed, "stw"); u32 val = ppc_inst_val(instr);
else
__put_user_asm_goto(ppc_inst_as_u64(instr), patch_addr, failed, "std"); __put_kernel_nofault(patch_addr, &val, u32, failed);
} else {
u64 val = ppc_inst_as_u64(instr);
__put_kernel_nofault(patch_addr, &val, u64, failed);
}
asm ("dcbst 0, %0; sync; icbi 0,%1; sync; isync" :: "r" (patch_addr), asm ("dcbst 0, %0; sync; icbi 0,%1; sync; isync" :: "r" (patch_addr),
"r" (exec_addr)); "r" (exec_addr));