From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 77F723858D37; Thu, 25 May 2023 18:43:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77F723858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685040227; bh=4/zLKdFJkwj0O8kZkuhQdcjMhvhdnBwiR571fFgpyko=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q5+GB1S1XGi9ZqSDa2Kiixer6KfZuW3a0QiK6ebqzyYskbcEuQzhpNDEezp8Nm7jW tijKhZ/MrJspXlk/T9cZ4TLsoUbhYa67MN8oUyGcY5pXUill3t692/Vuj+wOkUjpKh iBzqeAURWX5FwArpWi1stKGJXzlAxiE2e7v6bVQ8= From: "wcohen at redhat dot com" To: systemtap@sourceware.org Subject: =?UTF-8?B?W0J1ZyBydW50aW1lLzMwNDE1XSBjb25mbGljdGluZyB0eXBlcyBm?= =?UTF-8?B?b3Ig4oCYa2FsbHN5bXNfb25fZWFjaF9zeW1ib2zigJk=?= Date: Thu, 25 May 2023 18:43:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30415 --- Comment #9 from William Cohen --- Hi Martin, The kallsyms_on_each_symbol in runtime/sym.c is acting a wrapper for the non-export kernel kallsyms_on_each_symbol.=20 In older linux 5.11 and older versions of the kernel's kallsyms_on_each_sym= bol the code iterates through the kernel's symbols. If none of the callback functions return a non zero value, then then module_kallsyms_on_each_symbol= is called: https://elixir.bootlin.com/linux/v4.20.17/source/kernel/kallsyms.c#= L178 . However, in linux 5.12 kernels and newer https://elixir.bootlin.com/linux/v5.12/source/kernel/kallsyms.c#L185 the module_kallsyms_on_each_symbol at the end of function has been removed. The was changed by kernel git commit 013c1667cf78c1d847152f7116436d82dcab3db4.= =20=20 The module_kallsyms_on_each_symbol callback includes the struct module argument, https://elixir.bootlin.com/linux/v5.11.22/source/kernel/module.c#L4499 .=20 Looking at how these functions are used in live patching. The live patching makes a distinction between the kernel and modules. It looks like need to have two callback functions: one for kernels and one = for modules, but might be able to make the kernel just a wrapper to the module callback, the existing stapkp_symbol_callback. Then would need code to find the module_kallsyms_on_each_function and have two passes: one for the kernel and one for the modules.=20 One other concern about the relocation mechanism is how to make sure that getting the correct symbol as names may not be unique. There can be multip= le symbols with the same name in kallsym output. This can be observed with the following : sudo cat /proc/kallsyms | awk '{print $3}' |sort |uniq -c |grep -v " 1 " |s= ort -nr | more --=20 You are receiving this mail because: You are the assignee for the bug.=