mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
The BPF JIT needs to write invalid instructions to RX regions of memory to invalidate removed BPF programs. This needs a function like memset() that can work with RX memory. Implement patch_text_set_nosync() which is similar to text_poke_set() of x86. Signed-off-by: Puranjay Mohan <[email protected]> Reviewed-by: Pu Lehui <[email protected]> Acked-by: Björn Töpel <[email protected]> Tested-by: Björn Töpel <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
16 lines
385 B
C
16 lines
385 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_set_nosync(void *addr, u8 c, size_t len);
|
|
int patch_text(void *addr, u32 *insns, int ninsns);
|
|
|
|
extern int riscv_patch_in_stop_machine;
|
|
|
|
#endif /* _ASM_RISCV_PATCH_H */
|