mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-09 15:24:32 +08:00
e4ecbe83fd
In subsequent patches we'll need to atomically write to a naturally-aligned 64-bit literal embedded within the kernel text. Add a helper for this. For consistency with other text patching code we use copy_to_kernel_nofault(), which is atomic for naturally-aligned accesses up to 64-bits. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Florent Revest <revest@chromium.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20230123134603.1064407-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
16 lines
428 B
C
16 lines
428 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef __ASM_PATCHING_H
|
|
#define __ASM_PATCHING_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
int aarch64_insn_read(void *addr, u32 *insnp);
|
|
int aarch64_insn_write(void *addr, u32 insn);
|
|
|
|
int aarch64_insn_write_literal_u64(void *addr, u64 val);
|
|
|
|
int aarch64_insn_patch_text_nosync(void *addr, u32 insn);
|
|
int aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt);
|
|
|
|
#endif /* __ASM_PATCHING_H */
|