Message ID | b0aac2127d30c32e5742e978045c5793667bb7ce.1664289176.git.christophe.leroy@csgroup.eu (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v1,1/6] powerpc/code-patching: Use pte_offset_kernel() instead of virt_to_kpte() | expand |
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index ad0cf3108dd0..0f3acb0534b6 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -158,7 +158,7 @@ static int __do_patch_instruction(u32 *addr, ppc_inst_t instr) text_poke_addr = (unsigned long)__this_cpu_read(text_poke_area)->addr & PAGE_MASK; patch_addr = (u32 *)(text_poke_addr + offset_in_page(addr)); - pte = virt_to_kpte(text_poke_addr); + pte = pte_offset_kernel(pmd_off_k(text_poke_addr), text_poke_addr); __set_pte_at(&init_mm, text_poke_addr, pte, pfn_pte(pfn, PAGE_KERNEL), 0); /* See ptesync comment in radix__set_pte_at() */ if (radix_enabled())
virt_to_kpte() checks pmd_none() and returns NULL in that case. __do_patch_instruction() doesn't expect the pmd to be none and doesn't handle the case anyway. So avoid the pmd_none() check by using pte_offset_kernel() directly. It improves ftrace activation by approx 1% on an 8xx. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- arch/powerpc/lib/code-patching.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)