[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 51781ce8f4486c3738a6c85175b599ad1be71f89
WARNING: Author mismatch between patch and upstream commit: Backport author: Nam Caonamcao@linutronix.de Commit author: Samuel Hollandsamuel.holland@sifive.com
Status in newer kernel trees: 6.14.y | Present (exact SHA1) 6.12.y | Present (exact SHA1)
Note: The patch differs from the upstream commit: --- 1: 51781ce8f4486 ! 1: 1bc29061a4457 riscv: Pass patch_text() the length in bytes @@ Metadata ## Commit message ## riscv: Pass patch_text() the length in bytes
+ [ Upstream commit 51781ce8f4486c3738a6c85175b599ad1be71f89 ] + patch_text_nosync() already handles an arbitrary length of code, so this removes a superfluous loop and reduces the number of icache flushes.
@@ Commit message Reviewed-by: Conor Dooley conor.dooley@microchip.com Link: https://lore.kernel.org/r/20240327160520.791322-6-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt palmer@rivosinc.com + [apply to v6.6] + Signed-off-by: Nam Cao namcao@linutronix.de
## arch/riscv/include/asm/patch.h ## @@ @@ arch/riscv/kernel/probes/kprobes.c: post_kprobe_handler(struct kprobe *, struct + p->ainsn.api.restore = (unsigned long)p->addr + len;
- patch_text_nosync(p->ainsn.api.insn, &p->opcode, 1); -- patch_text_nosync(p->ainsn.api.insn + offset, &insn, 1); +- patch_text_nosync((void *)p->ainsn.api.insn + offset, &insn, 1); + patch_text_nosync(p->ainsn.api.insn, &p->opcode, len); -+ patch_text_nosync(p->ainsn.api.insn + len, &insn, GET_INSN_LENGTH(insn)); ++ patch_text_nosync((void *)p->ainsn.api.insn + len, &insn, GET_INSN_LENGTH(insn)); }
static void __kprobes arch_prepare_simulate(struct kprobe *p) -@@ arch/riscv/kernel/probes/kprobes.c: int __kprobes arch_prepare_kprobe(struct kprobe *p) +@@ arch/riscv/kernel/probes/kprobes.c: void *alloc_insn_page(void) /* install breakpoint in text */ void __kprobes arch_arm_kprobe(struct kprobe *p) { ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success |