ab89b8a67f
[ Upstream commit2a8db5ec4a] We're currently using stop_machine() to update ftrace & kprobes, which means that the thread that takes text_mutex during may not be the same as the thread that eventually patches the code. This isn't actually a race because the lock is still held (preventing any other concurrent accesses) and there is only one thread running during stop_machine(), but it does trigger a lockdep failure. This patch just elides the lockdep check during stop_machine. Fixes:c15ac4fd60("riscv/ftrace: Add dynamic function tracer support") Suggested-by: Steven Rostedt <rostedt@goodmis.org> Reported-by: Changbin Du <changbin.du@gmail.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230303143754.4005217-1-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
15 lines
314 B
C
15 lines
314 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2020 SiFive
|
|
*/
|
|
|
|
#ifndef _ASM_RISCV_PATCH_H
|
|
#define _ASM_RISCV_PATCH_H
|
|
|
|
int patch_text_nosync(void *addr, const void *insns, size_t len);
|
|
int patch_text(void *addr, u32 insn);
|
|
|
|
extern int riscv_patch_in_stop_machine;
|
|
|
|
#endif /* _ASM_RISCV_PATCH_H */
|