[PATCH RFC 09/10] ftrace: Use module writable address

From: Rick Edgecombe
Date: Fri Nov 20 2020 - 15:32:04 EST


Use the module writable address to accommodate arch's that have a
separate writable address for perm_alloc.

Signed-off-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 8185f7240095..ea6377108bab 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -6134,7 +6134,7 @@ static int ftrace_process_locs(struct module *mod,
if (!count)
return 0;

- sort(start, count, sizeof(*start),
+ sort(module_adjust_writable_addr(start), count, sizeof(*start),
ftrace_cmp_ips, NULL);

start_pg = ftrace_allocate_pages(count);
--
2.20.1