Re: [PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2025-02-06 Thread Zheng Yejian
On 2025/1/22 01:48, Steven Rostedt wrote: Sorry for the late reply. Forgot about this as I was focused on other end-of-year issues. On Sat, 14 Dec 2024 16:37:59 +0800 Zheng Yejian wrote: The direct cause of this issue is the wrong fentry being founded by ftrace_location(), following the

Re: [PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2024-12-14 Thread Zheng Yejian
On 2024/12/14 03:31, Martin Kelly wrote: On Thu, 2024-12-12 at 17:52 +0800, Zheng Yejian wrote: On 2024/12/11 04:49, Martin Kelly wrote: Zheng, do you plan to send a v3? I'd be happy to help out with this patch series if you'd like, as I'm hoping to get this issue resolved (

Re: [PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2024-12-12 Thread Zheng Yejian
sue in: https://lore.kernel.org/all/20241014210841.5a476...@gandalf.local.home/ but there's no conclusion. I can rebase this patch series and send a new version first, and I'm also hoping to get more feedbacks and help to resolve the issue. -- Thanks, Zheng Yejian

[PATCH v2 5/5] ftrace: Revert the FTRACE_MCOUNT_MAX_OFFSET workaround

2024-07-23 Thread Zheng Yejian
9181f7c690 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function") 2. commit 7af82ff90a2b ("powerpc/ftrace: Ignore weak functions") 3. commit f6834c8c59a8 ("powerpc/ftrace: Fix dropping weak symbols with older toolchains") Signed-off-by: Zheng Yejian

[PATCH v2 3/5] ftrace: Skip invalid __fentry__ in ftrace_process_locs()

2024-07-23 Thread Zheng Yejian
will find module of the passed address first, but as ftrace_process_locs() is called, the module has not been fully loaded, so those lookup functions can not work. Fixes: aebfd12521d9 ("x86/ibt,ftrace: Search for __fentry__ location") Signed-off-by: Zheng Yejian --- include/linu

[PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2024-07-23 Thread Zheng Yejian
ll/cak7lnarir5z9hprg932t7yjrwqkx_qz7wkmbxx7ito2w5yj...@mail.gmail.com/ - Changes in PATCH 3/5: - Now name of hole symbol is NULL, so if __fentry__ is located in a hole, kallsyms_lookup() find an NULL name then will return 0, so drop the needless kallsyms_is_hole_symbol(). Zheng Yejia

[PATCH v2 2/5] module: kallsyms: Determine exact function size

2024-07-23 Thread Zheng Yejian
issue, check that given address is within the size of the function found. Signed-off-by: Zheng Yejian --- include/linux/module.h | 7 +++ kernel/module/kallsyms.c | 19 +-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/linux/module.h b/include/linux

[PATCH v2 1/5] kallsyms: Emit symbol at the holes in the text

2024-07-23 Thread Zheng Yejian
-by: Peter Zijlstra Suggested-by: Masahiro Yamada Signed-off-by: Zheng Yejian --- scripts/kallsyms.c | 94 +++-- scripts/link-vmlinux.sh | 4 +- scripts/mksysmap| 2 +- 3 files changed, 94 insertions(+), 6 deletions(-) diff --git a/scripts/kallsyms.c

[PATCH v2 4/5] ftrace: Fix possible out-of-bound issue in ftrace_process_locs()

2024-07-23 Thread Zheng Yejian
quot;) Signed-off-by: Zheng Yejian --- kernel/trace/ftrace.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index fff5d3466c41..6947be8801d9 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -708

Re: [PATCH 2/6] kallsyms: Emit symbol at the holes in the text

2024-07-21 Thread Zheng Yejian
On 2024/7/20 22:14, Masahiro Yamada wrote: On Thu, Jul 18, 2024 at 12:45 PM Zheng Yejian wrote: On 2024/7/16 16:33, Masahiro Yamada wrote: On Thu, Jun 13, 2024 at 10:36 PM Zheng Yejian wrote: When a weak type function is overridden, its symbol will be removed from the symbol table, but

Re: [PATCH 2/6] kallsyms: Emit symbol at the holes in the text

2024-07-17 Thread Zheng Yejian
On 2024/7/16 16:33, Masahiro Yamada wrote: On Thu, Jun 13, 2024 at 10:36 PM Zheng Yejian wrote: When a weak type function is overridden, its symbol will be removed from the symbol table, but its code will not be removed. Besides, due to lacking of size for kallsyms, kernel compute function

[PATCH 6/6] ftrace: Revert the FTRACE_MCOUNT_MAX_OFFSET workaround

2024-06-13 Thread Zheng Yejian
9181f7c690 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function") 2. commit 7af82ff90a2b ("powerpc/ftrace: Ignore weak functions") 3. commit f6834c8c59a8 ("powerpc/ftrace: Fix dropping weak symbols with older toolchains") Signed-off-by: Zheng Yejian

[PATCH 2/6] kallsyms: Emit symbol at the holes in the text

2024-06-13 Thread Zheng Yejian
fs_context Suggested-by: Peter Zijlstra Signed-off-by: Zheng Yejian --- scripts/kallsyms.c | 101 +++- scripts/link-vmlinux.sh | 4 +- scripts/mksysmap| 2 +- 3 files changed, 102 insertions(+), 5 deletions(-) diff --git a/scripts/kallsyms.c

[PATCH 5/6] ftrace: Fix possible out-of-bound issue in ftrace_process_locs()

2024-06-13 Thread Zheng Yejian
quot;) Signed-off-by: Zheng Yejian --- kernel/trace/ftrace.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 0e8628e4d296..c46c35ac9b42 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -657

[PATCH 1/6] kallsyms: Optimize multiple times of realloc() to one time of malloc()

2024-06-13 Thread Zheng Yejian
hat the expansion is generally 10+ times. As an optimization, introduce linked list 'sym_list' to associate and count all symbols, then store them into 'table' at one time. Signed-off-by: Zheng Yejian --- scripts/kallsyms.c | 33 - 1 file changed,

[PATCH 4/6] ftrace: Skip invalid __fentry__ in ftrace_process_locs()

2024-06-13 Thread Zheng Yejian
not work. Fixes: aebfd12521d9 ("x86/ibt,ftrace: Search for __fentry__ location") Signed-off-by: Zheng Yejian --- include/linux/kallsyms.h | 13 + include/linux/module.h | 7 +++ kernel/module/kallsyms.c | 23 +-- kernel/trace/ftrace.c| 15 +++

[PATCH 3/6] module: kallsyms: Determine exact function size

2024-06-13 Thread Zheng Yejian
issue, check that an given address is within the size of the function found. Signed-off-by: Zheng Yejian --- include/linux/module.h | 7 +++ kernel/module/kallsyms.c | 19 +-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/linux/module.h b/include

[PATCH 0/6] kallsyms: Emit symbol for holes in text and fix weak function issue

2024-06-13 Thread Zheng Yejian
_MAX_OFFSET solution, also two related definition for powerpc. [1] https://lore.kernel.org/all/20240607150228.gr8...@noisy.programming.kicks-ass.net/ [2] https://lore.kernel.org/all/20240611092157.gu40...@noisy.programming.kicks-ass.net/ Zheng Yejian (6): kallsyms: Optimize multiple times of real