Commit 5303df24 authored by Zong Li's avatar Zong Li Committed by Palmer Dabbelt

riscv: Use NOKPROBE_SYMBOL() instead of __krpobes annotation

The __kprobes annotation is old style, so change it to NOKPROBE_SYMBOL().
Signed-off-by: default avatarZong Li <zong.li@sifive.com>
Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent b80b3d58
...@@ -20,7 +20,7 @@ struct patch_insn { ...@@ -20,7 +20,7 @@ struct patch_insn {
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
static DEFINE_RAW_SPINLOCK(patch_lock); static DEFINE_RAW_SPINLOCK(patch_lock);
static void __kprobes *patch_map(void *addr, int fixmap) static void *patch_map(void *addr, int fixmap)
{ {
uintptr_t uintaddr = (uintptr_t) addr; uintptr_t uintaddr = (uintptr_t) addr;
struct page *page; struct page *page;
...@@ -37,13 +37,15 @@ static void __kprobes *patch_map(void *addr, int fixmap) ...@@ -37,13 +37,15 @@ static void __kprobes *patch_map(void *addr, int fixmap)
return (void *)set_fixmap_offset(fixmap, page_to_phys(page) + return (void *)set_fixmap_offset(fixmap, page_to_phys(page) +
(uintaddr & ~PAGE_MASK)); (uintaddr & ~PAGE_MASK));
} }
NOKPROBE_SYMBOL(patch_map);
static void __kprobes patch_unmap(int fixmap) static void patch_unmap(int fixmap)
{ {
clear_fixmap(fixmap); clear_fixmap(fixmap);
} }
NOKPROBE_SYMBOL(patch_unmap);
static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len) static int patch_insn_write(void *addr, const void *insn, size_t len)
{ {
void *waddr = addr; void *waddr = addr;
bool across_pages = (((uintptr_t) addr & ~PAGE_MASK) + len) > PAGE_SIZE; bool across_pages = (((uintptr_t) addr & ~PAGE_MASK) + len) > PAGE_SIZE;
...@@ -68,14 +70,16 @@ static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len) ...@@ -68,14 +70,16 @@ static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len)
return ret; return ret;
} }
NOKPROBE_SYMBOL(patch_insn_write);
#else #else
static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len) static int patch_insn_write(void *addr, const void *insn, size_t len)
{ {
return probe_kernel_write(addr, insn, len); return probe_kernel_write(addr, insn, len);
} }
NOKPROBE_SYMBOL(patch_insn_write);
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
int __kprobes patch_text_nosync(void *addr, const void *insns, size_t len) int patch_text_nosync(void *addr, const void *insns, size_t len)
{ {
u32 *tp = addr; u32 *tp = addr;
int ret; int ret;
...@@ -87,8 +91,9 @@ int __kprobes patch_text_nosync(void *addr, const void *insns, size_t len) ...@@ -87,8 +91,9 @@ int __kprobes patch_text_nosync(void *addr, const void *insns, size_t len)
return ret; return ret;
} }
NOKPROBE_SYMBOL(patch_text_nosync);
static int __kprobes patch_text_cb(void *data) static int patch_text_cb(void *data)
{ {
struct patch_insn *patch = data; struct patch_insn *patch = data;
int ret = 0; int ret = 0;
...@@ -106,8 +111,9 @@ static int __kprobes patch_text_cb(void *data) ...@@ -106,8 +111,9 @@ static int __kprobes patch_text_cb(void *data)
return ret; return ret;
} }
NOKPROBE_SYMBOL(patch_text_cb);
int __kprobes patch_text(void *addr, u32 insn) int patch_text(void *addr, u32 insn)
{ {
struct patch_insn patch = { struct patch_insn patch = {
.addr = addr, .addr = addr,
...@@ -118,3 +124,4 @@ int __kprobes patch_text(void *addr, u32 insn) ...@@ -118,3 +124,4 @@ int __kprobes patch_text(void *addr, u32 insn)
return stop_machine_cpuslocked(patch_text_cb, return stop_machine_cpuslocked(patch_text_cb,
&patch, cpu_online_mask); &patch, cpu_online_mask);
} }
NOKPROBE_SYMBOL(patch_text);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment