Re: [syzbot] linux-next build error (19)

2025-01-30 Thread Sami Tolvanen
On Thu, Jan 30, 2025 at 5:20 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:a13f6e0f405e Add linux-next specific files for 20250130 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=10221ddf98 > kernel config: ht

Re: Unaligned accesses when loading modules

2025-01-14 Thread Sami Tolvanen
Hi Mikulas, On Tue, Jan 14, 2025 at 6:07 PM Mikulas Patocka wrote: > > Hi > > On PA-RISC, with the kernel 6.12.9, I get unaligned pointer warnings when > a module is loaded. The warnings are caused by the fact that the > .gnu.linkonce.this_module section is not aligned to the appropriate > bounda

Re: [PATCH v2 28/28] cfi: Use RCU while invoking __module_address().

2025-01-06 Thread Sami Tolvanen
Hi, On Mon, Jan 6, 2025 at 10:00 AM Elliot Berman wrote: > > On Thu, Jan 02, 2025 at 04:24:22PM -0800, Sami Tolvanen wrote: > > Hi Elliot, > > > > On Mon, Dec 30, 2024 at 7:33 PM Elliot Berman > > wrote: > > > > > > On Fri, Dec 20, 2024 at 0

[PATCH v8 01/18] tools: Add gendwarfksyms

2025-01-03 Thread Sami Tolvanen
Add a basic DWARF parser, which uses libdw to traverse the debugging information in an object file and looks for functions and variables. In follow-up patches, this will be expanded to produce symbol versions for CONFIG_MODVERSIONS from DWARF. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu

[PATCH v8 18/18] Documentation/kbuild: Add DWARF module versioning

2025-01-03 Thread Sami Tolvanen
Add documentation for gendwarfksyms changes, and the kABI stability features that can be useful for distributions even though they're not used in mainline kernels. Signed-off-by: Sami Tolvanen --- Documentation/kbuild/gendwarfksyms.rst | 308 + Documentation/k

[PATCH v8 17/18] kbuild: Add gendwarfksyms as an alternative to genksyms

2025-01-03 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen --- kernel/module/Kconfig | 22 ++ scripts/Makefile | 2 +- scripts/Makefile.build | 35 +-- 3

[PATCH v8 16/18] export: Add __gendwarfksyms_ptr_ references to exported symbols

2025-01-03 Thread Sami Tolvanen
igned-off-by: Sami Tolvanen --- include/linux/export.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 2633df4d31e6..a8c23d945634 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -52,9 +52,24 @@

[PATCH v8 14/18] gendwarfksyms: Add support for reserved and ignored fields

2025-01-03 Thread Sami Tolvanen
truct { int b; int v; }; }; Here gendwarfksyms --stable replaces the union with the type of the placeholder field when calculating versions. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c

[PATCH v8 12/18] gendwarfksyms: Add symbol versioning

2025-01-03 Thread Sami Tolvanen
Calculate symbol versions from the fully expanded type strings in type_map, and output the versions in a genksyms-compatible format. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 2 +- scripts/gendwarfksyms/dwarf.c | 25

[PATCH v8 15/18] gendwarfksyms: Add support for symbol type pointers

2025-01-03 Thread Sami Tolvanen
xternal_symbol); Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 55 +- scripts/gendwarfksyms/examples/symbolptr.c | 33 + scripts/gendwarfksyms/gendwarfksyms.h | 7 +++ scripts/gendwarfksyms/symbols.c

[PATCH v8 08/18] gendwarfksyms: Expand structure types

2025-01-03 Thread Sami Tolvanen
type { base_type u8 byte_size(1) encoding(7) } data_ptr data_member_location(0) , member base_type usize byte_size(8) encoding(7) length data_member_location(8) } byte_size(16) alignment(8) msg ) -> base_type void Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu ---

[PATCH v8 13/18] gendwarfksyms: Add support for kABI rules

2025-01-03 Thread Sami Tolvanen
umerator values when calculating versions. This may be needed when the last field of the enum is used as a sentinel and new fields must be added before it. Add examples for using the rules under the examples/ directory. Signed-off-by: Sami Tolvanen --- scripts/gendwarfksyms/Makefile

[PATCH v8 10/18] gendwarfksyms: Add die_map debugging

2025-01-03 Thread Sami Tolvanen
Debugging the DWARF processing can be somewhat challenging, so add more detailed debugging output for die_map operations. Add the --dump-die-map flag, which adds color coded tags to the output for die_map changes. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms

[PATCH v8 11/18] gendwarfksyms: Add symtypes output

2025-01-03 Thread Sami Tolvanen
references are wrapped in single quotes. E.g.: s#'core::result::Result' 2. The actual type definition is the simple parsed DWARF format we output with --dump-dies, not the preprocessed C-style format genksyms produces. Signed-off-by: Sami Tolvanen Reviewed-by:

[PATCH v8 09/18] gendwarfksyms: Limit structure expansion

2025-01-03 Thread Sami Tolvanen
t the ABI. Consider type definitions in .c files to be declarations to prevent opaque types from changing symbol versions. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/cache.c | 51 +++ sc

[PATCH v8 07/18] gendwarfksyms: Expand array_type

2025-01-03 Thread Sami Tolvanen
(8) } Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c index 7d8a4eb6c387..46ce17b2459b 100644 --- a/scripts

[PATCH v8 06/18] gendwarfksyms: Expand subroutine_type

2025-01-03 Thread Sami Tolvanen
) } } ) -> base_type unsigned long byte_size(8) encoding(7) Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 84 ++- scripts/gendwarfksyms/gendwarfksyms.h | 4 ++ 2 files changed, 85 insertions(+), 3 deletions(-) d

[PATCH v8 04/18] gendwarfksyms: Add a cache for processed DIEs

2025-01-03 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c

[PATCH v8 05/18] gendwarfksyms: Expand type modifiers and typedefs

2025-01-03 Thread Sami Tolvanen
-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/die.c | 12 + scripts/gendwarfksyms/dwarf.c | 67 +++ scripts/gendwarfksyms/gendwarfksyms.h | 5 ++ 3 files changed, 84 insertions(+) diff --git a/scripts/gendwarfksyms/die.c b

[PATCH v8 03/18] gendwarfksyms: Expand base_type

2025-01-03 Thread Sami Tolvanen
variable base_type unsigned long byte_size(8) encoding(7) ... Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 160 ++ 1 file changed, 160 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts

[PATCH v8 02/18] gendwarfksyms: Add address matching

2025-01-03 Thread Sami Tolvanen
d-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/gendwarfksyms.c | 2 + scripts/gendwarfksyms/gendwarfksyms.h | 13 +++ scripts/gendwarfksyms/symbols.c | 161 ++ 3 files changed, 176 insertions(+) diff --git a/scripts/gendwarf

[PATCH v8 00/18] Implement DWARF modversions

2025-01-03 Thread Sami Tolvanen
e for calculating assembly modversions. v1: https://lore.kernel.org/lkml/20240617175818.58219-17-samitolva...@google.com/ --- Sami Tolvanen (18): tools: Add gendwarfksyms gendwarfksyms: Add address matching gendwarfksyms: Expand base_type gendwarfksyms: Add a cache for processed DIEs gendw

Re: [PATCH v2 28/28] cfi: Use RCU while invoking __module_address().

2025-01-02 Thread Sami Tolvanen
Hi Elliot, On Mon, Dec 30, 2024 at 7:33 PM Elliot Berman wrote: > > On Fri, Dec 20, 2024 at 06:41:42PM +0100, Sebastian Andrzej Siewior wrote: > > __module_address() can be invoked within a RCU section, there is no > > requirement to have preemption disabled. > > > > I'm not sure if using rcu_rea

Re: [PATCH v2 28/28] cfi: Use RCU while invoking __module_address().

2025-01-02 Thread Sami Tolvanen
rcu_read_lock() will introduce the regression that > > has been fixed in commit 14c4c8e41511a ("cfi: Use > > rcu_read_{un}lock_sched_notrace"). > > > > Cc: Elliot Berman > > Cc: Kees Cook > > Cc: Nathan Chancellor > > Cc: Sami Tolvanen &g

Re: [PATCH v7 02/18] gendwarfksyms: Add address matching

2025-01-02 Thread Sami Tolvanen
Hi, On Sat, Dec 28, 2024 at 4:29 PM Masahiro Yamada wrote: > > On Fri, Dec 20, 2024 at 6:07 AM Sami Tolvanen wrote: > > > > diff --git a/scripts/gendwarfksyms/symbols.c > > b/scripts/gendwarfksyms/symbols.c > > index 7adf2ed9b89b..98febb524dd5 100644 > > -

Re: [PATCH v7 01/18] tools: Add gendwarfksyms

2025-01-02 Thread Sami Tolvanen
Hi Masahiro, On Fri, Dec 27, 2024 at 6:02 AM Masahiro Yamada wrote: > > On Fri, Dec 20, 2024 at 6:07 AM Sami Tolvanen wrote: > > > +int main(int argc, char **argv) > > +{ > > + unsigned int n; > > + int opt; > > + > > + st

[PATCH v7 18/18] Documentation/kbuild: Add DWARF module versioning

2024-12-19 Thread Sami Tolvanen
Add documentation for gendwarfksyms changes, and the kABI stability features that can be useful for distributions even though they're not used in mainline kernels. Signed-off-by: Sami Tolvanen --- Documentation/kbuild/gendwarfksyms.rst | 308 + Documentation/k

[PATCH v7 17/18] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-12-19 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen --- kernel/module/Kconfig | 22 ++ scripts/Makefile | 2 +- scripts/Makefile.build | 35 +-- 3

[PATCH v7 16/18] export: Add __gendwarfksyms_ptr_ references to exported symbols

2024-12-19 Thread Sami Tolvanen
igned-off-by: Sami Tolvanen --- include/linux/export.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 2633df4d31e6..a8c23d945634 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -52,9 +52,24 @@

[PATCH v7 15/18] gendwarfksyms: Add support for symbol type pointers

2024-12-19 Thread Sami Tolvanen
xternal_symbol); Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 55 +- scripts/gendwarfksyms/examples/symbolptr.c | 33 + scripts/gendwarfksyms/gendwarfksyms.h | 7 +++ scripts/gendwarfksyms/symbols.c

[PATCH v7 14/18] gendwarfksyms: Add support for reserved and ignored fields

2024-12-19 Thread Sami Tolvanen
truct { int b; int v; }; }; Here gendwarfksyms --stable replaces the union with the type of the placeholder field when calculating versions. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c

[PATCH v7 13/18] gendwarfksyms: Add support for kABI rules

2024-12-19 Thread Sami Tolvanen
umerator values when calculating versions. This may be needed when the last field of the enum is used as a sentinel and new fields must be added before it. Add examples for using the rules under the examples/ directory. Signed-off-by: Sami Tolvanen --- scripts/gendwarfksyms/Makefile

[PATCH v7 12/18] gendwarfksyms: Add symbol versioning

2024-12-19 Thread Sami Tolvanen
Calculate symbol versions from the fully expanded type strings in type_map, and output the versions in a genksyms-compatible format. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 2 +- scripts/gendwarfksyms/dwarf.c | 25

[PATCH v7 11/18] gendwarfksyms: Add symtypes output

2024-12-19 Thread Sami Tolvanen
references are wrapped in single quotes. E.g.: s#'core::result::Result' 2. The actual type definition is the simple parsed DWARF format we output with --dump-dies, not the preprocessed C-style format genksyms produces. Signed-off-by: Sami Tolvanen Reviewed-by:

[PATCH v7 10/18] gendwarfksyms: Add die_map debugging

2024-12-19 Thread Sami Tolvanen
Debugging the DWARF processing can be somewhat challenging, so add more detailed debugging output for die_map operations. Add the --dump-die-map flag, which adds color coded tags to the output for die_map changes. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms

[PATCH v7 09/18] gendwarfksyms: Limit structure expansion

2024-12-19 Thread Sami Tolvanen
t the ABI. Consider type definitions in .c files to be declarations to prevent opaque types from changing symbol versions. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/cache.c | 51 +++ sc

[PATCH v7 07/18] gendwarfksyms: Expand array_type

2024-12-19 Thread Sami Tolvanen
(8) } Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c index 7d8a4eb6c387..46ce17b2459b 100644 --- a/scripts

[PATCH v7 08/18] gendwarfksyms: Expand structure types

2024-12-19 Thread Sami Tolvanen
type { base_type u8 byte_size(1) encoding(7) } data_ptr data_member_location(0) , member base_type usize byte_size(8) encoding(7) length data_member_location(8) } byte_size(16) alignment(8) msg ) -> base_type void Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu ---

[PATCH v7 06/18] gendwarfksyms: Expand subroutine_type

2024-12-19 Thread Sami Tolvanen
) } } ) -> base_type unsigned long byte_size(8) encoding(7) Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 84 ++- scripts/gendwarfksyms/gendwarfksyms.h | 4 ++ 2 files changed, 85 insertions(+), 3 deletions(-) d

[PATCH v7 05/18] gendwarfksyms: Expand type modifiers and typedefs

2024-12-19 Thread Sami Tolvanen
-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/die.c | 12 + scripts/gendwarfksyms/dwarf.c | 67 +++ scripts/gendwarfksyms/gendwarfksyms.h | 5 ++ 3 files changed, 84 insertions(+) diff --git a/scripts/gendwarfksyms/die.c b

[PATCH v7 04/18] gendwarfksyms: Add a cache for processed DIEs

2024-12-19 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c

[PATCH v7 03/18] gendwarfksyms: Expand base_type

2024-12-19 Thread Sami Tolvanen
variable base_type unsigned long byte_size(8) encoding(7) ... Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 160 ++ 1 file changed, 160 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts

[PATCH v7 02/18] gendwarfksyms: Add address matching

2024-12-19 Thread Sami Tolvanen
d-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/gendwarfksyms.c | 2 + scripts/gendwarfksyms/gendwarfksyms.h | 13 ++ scripts/gendwarfksyms/symbols.c | 163 ++ 3 files changed, 178 insertions(+) diff --git a/scripts/gendwarf

[PATCH v7 01/18] tools: Add gendwarfksyms

2024-12-19 Thread Sami Tolvanen
Add a basic DWARF parser, which uses libdw to traverse the debugging information in an object file and looks for functions and variables. In follow-up patches, this will be expanded to produce symbol versions for CONFIG_MODVERSIONS from DWARF. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu

[PATCH v7 00/18] Implement DWARF modversions

2024-12-19 Thread Sami Tolvanen
code. Note that with gendwarfksyms, we have to actually build a temporary .o file for calculating assembly modversions. v1: https://lore.kernel.org/lkml/20240617175818.58219-17-samitolva...@google.com/ --- Sami Tolvanen (18): tools: Add gendwarfksyms gendwarfksyms: Add address matching gendwarf

Re: [PATCH v6 18/18] Documentation/kbuild: Add DWARF module versioning

2024-12-16 Thread Sami Tolvanen
Hi, On Sat, Dec 14, 2024 at 3:34 AM Masahiro Yamada wrote: > > On Fri, Nov 22, 2024 at 5:43 AM Sami Tolvanen wrote: > > > > +When a symbol pointer is found in DWARF, gendwarfksyms can use its > > +type for calculating symbol versions even if the symbol is defined > &g

Re: [PATCH v6 01/18] tools: Add gendwarfksyms

2024-12-05 Thread Sami Tolvanen
rote: > > > > > > > > On Thu, Nov 21, 2024 at 08:42:22PM +, Sami Tolvanen wrote: > > > > > Add a basic DWARF parser, which uses libdw to traverse the debugging > > > > > information in an object file and looks for functions and variables. >

Re: [PATCH v6 00/18] Implement DWARF modversions

2024-11-25 Thread Sami Tolvanen
On Mon, Nov 25, 2024 at 4:41 PM Miguel Ojeda wrote: > > On Mon, Nov 25, 2024 at 2:29 PM Neal Gompa wrote: > > > > As my Acked-by was removed, I'm sorry to say that there is no point > > for me to provide feedback since it is unwanted. > > > > I hope it lands soon, but I also hope the people here

Re: [PATCH v6 00/18] Implement DWARF modversions

2024-11-25 Thread Sami Tolvanen
Hi, On Sat, Nov 23, 2024 at 1:23 PM Sedat Dilek wrote: > > > BTW, I am testing with the latest kmod-git and pahole-git. > > > > I will give this a try when Linux v6.12.1 is released. > > > > I have a prolonged build-time of +22,75 per cent. > Compared gendwarfksyms-v5 + Linux-v6.12.0 VS. gendwarf

Re: [PATCH v6 00/18] Implement DWARF modversions

2024-11-25 Thread Sami Tolvanen
Hi Sedat, On Fri, Nov 22, 2024 at 3:51 AM Sedat Dilek wrote: > > Thanks for the update, Sami. > > What are your plans to get this upstream? Once everything has been reviewed, I'm suspect it would be up to Masahiro to decide if he wants to pick this up. > Is Linux 6.13 the new development base?

[PATCH v6 17/18] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-11-21 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen --- kernel/module/Kconfig | 25 - scripts/Makefile | 2 +- scripts/Makefile.build | 35 +-- 3

[PATCH v6 13/18] gendwarfksyms: Add support for kABI rules

2024-11-21 Thread Sami Tolvanen
umerator values when calculating versions. This may be needed when the last field of the enum is used as a sentinel and new fields must be added before it. Add examples for using the rules under the examples/ directory. Signed-off-by: Sami Tolvanen --- scripts/gendwarfksyms/Makefile

[PATCH v6 07/18] gendwarfksyms: Expand array_type

2024-11-21 Thread Sami Tolvanen
(8) } Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c index 7e6b477d7c12..ade9b3b7b119 100644 --- a/scripts

[PATCH v6 03/18] gendwarfksyms: Expand base_type

2024-11-21 Thread Sami Tolvanen
variable base_type unsigned long byte_size(8) encoding(7) ... Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 159 ++ 1 file changed, 159 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts

[PATCH v6 04/18] gendwarfksyms: Add a cache for processed DIEs

2024-11-21 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c

[PATCH v6 18/18] Documentation/kbuild: Add DWARF module versioning

2024-11-21 Thread Sami Tolvanen
Add documentation for gendwarfksyms changes, and the kABI stability features that can be useful for distributions even though they're not used in mainline kernels. Signed-off-by: Sami Tolvanen --- Documentation/kbuild/gendwarfksyms.rst | 308 + Documentation/k

[PATCH v6 14/18] gendwarfksyms: Add support for reserved and ignored fields

2024-11-21 Thread Sami Tolvanen
truct { int b; int v; }; }; Here gendwarfksyms --stable replaces the union with the type of the placeholder field when calculating versions. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c

[PATCH v6 10/18] gendwarfksyms: Add die_map debugging

2024-11-21 Thread Sami Tolvanen
Debugging the DWARF processing can be somewhat challenging, so add more detailed debugging output for die_map operations. Add the --dump-die-map flag, which adds color coded tags to the output for die_map changes. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms

[PATCH v6 16/18] export: Add __gendwarfksyms_ptr_ references to exported symbols

2024-11-21 Thread Sami Tolvanen
igned-off-by: Sami Tolvanen --- include/linux/export.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 0bbd02fd351d..cf71d3202e5b 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -52,9 +52,24 @@

[PATCH v6 08/18] gendwarfksyms: Expand structure types

2024-11-21 Thread Sami Tolvanen
type { base_type u8 byte_size(1) encoding(7) } data_ptr data_member_location(0) , member base_type usize byte_size(8) encoding(7) length data_member_location(8) } byte_size(16) alignment(8) msg ) -> base_type void Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu ---

[PATCH v6 01/18] tools: Add gendwarfksyms

2024-11-21 Thread Sami Tolvanen
Add a basic DWARF parser, which uses libdw to traverse the debugging information in an object file and looks for functions and variables. In follow-up patches, this will be expanded to produce symbol versions for CONFIG_MODVERSIONS from DWARF. Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu

[PATCH v6 06/18] gendwarfksyms: Expand subroutine_type

2024-11-21 Thread Sami Tolvanen
) } } ) -> base_type unsigned long byte_size(8) encoding(7) Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 84 ++- scripts/gendwarfksyms/gendwarfksyms.h | 4 ++ 2 files changed, 85 insertions(+), 3 deletions(-) d

[PATCH v6 02/18] gendwarfksyms: Add address matching

2024-11-21 Thread Sami Tolvanen
d-off-by: Sami Tolvanen --- scripts/gendwarfksyms/gendwarfksyms.c | 2 + scripts/gendwarfksyms/gendwarfksyms.h | 13 +++ scripts/gendwarfksyms/symbols.c | 161 ++ 3 files changed, 176 insertions(+) diff --git a/scripts/gendwarfksyms/gendwarfksyms.c b/sc

[PATCH v6 15/18] gendwarfksyms: Add support for symbol type pointers

2024-11-21 Thread Sami Tolvanen
xternal_symbol); Signed-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 55 +- scripts/gendwarfksyms/examples/symbolptr.c | 33 + scripts/gendwarfksyms/gendwarfksyms.h | 7 +++ scripts/gendwarfksyms/symbols.c

[PATCH v6 12/18] gendwarfksyms: Add symbol versioning

2024-11-21 Thread Sami Tolvanen
Calculate symbol versions from the fully expanded type strings in type_map, and output the versions in a genksyms-compatible format. Signed-off-by: Sami Tolvanen --- scripts/gendwarfksyms/Makefile| 2 +- scripts/gendwarfksyms/dwarf.c | 25 +- scripts/gendwarfksyms

[PATCH v6 11/18] gendwarfksyms: Add symtypes output

2024-11-21 Thread Sami Tolvanen
references are wrapped in single quotes. E.g.: s#'core::result::Result' 2. The actual type definition is the simple parsed DWARF format we output with --dump-dies, not the preprocessed C-style format genksyms produces. Signed-off-by: Sami Tolvanen --- scripts/gen

[PATCH v6 09/18] gendwarfksyms: Limit structure expansion

2024-11-21 Thread Sami Tolvanen
t the ABI. Consider type definitions in .c files to be declarations to prevent opaque types from changing symbol versions. Signed-off-by: Sami Tolvanen --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/cache.c | 51 +++ scripts/gendwarfksyms/dwarf.c

[PATCH v6 05/18] gendwarfksyms: Expand type modifiers and typedefs

2024-11-21 Thread Sami Tolvanen
-off-by: Sami Tolvanen Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/die.c | 12 + scripts/gendwarfksyms/dwarf.c | 67 +++ scripts/gendwarfksyms/gendwarfksyms.h | 5 ++ 3 files changed, 84 insertions(+) diff --git a/scripts/gendwarfksyms/die.c b

[PATCH v6 00/18] Implement DWARF modversions

2024-11-21 Thread Sami Tolvanen
Added a GENDWARFKSYMS option and hooked up kbuild support for both C and assembly code. Note that with gendwarfksyms, we have to actually build a temporary .o file for calculating assembly modversions. v1: https://lore.kernel.org/lkml/20240617175818.58219-17-samitolva...@google.com/ --- Sami

Re: [PATCH v5 10/19] gendwarfksyms: Limit structure expansion

2024-11-20 Thread Sami Tolvanen
On Wed, Oct 30, 2024 at 05:01:17PM +, Sami Tolvanen wrote: > > For pointers, limit structure expansion after the first pointer > in the symbol type. This should be plenty for detecting ABI > differences, but it stops us from pulling in half the kernel for > types that cont

Re: [PATCH v5 01/19] scripts: move genksyms crc32 implementation to a common include

2024-11-19 Thread Sami Tolvanen
Hi Darrick, On Tue, Nov 19, 2024 at 12:48 PM Darrick J. Wong wrote: > > On Mon, Nov 18, 2024 at 09:58:09PM +, Sami Tolvanen wrote: > > Hi, > > > > On Sat, Nov 16, 2024 at 9:09 AM Masahiro Yamada > > wrote: > > > > > > On Thu, Nov

Re: [PATCH v5 01/19] scripts: move genksyms crc32 implementation to a common include

2024-11-18 Thread Sami Tolvanen
Hi, On Sat, Nov 16, 2024 at 9:09 AM Masahiro Yamada wrote: > > On Thu, Nov 14, 2024 at 2:54 AM Sami Tolvanen wrote: > > > > Hi, > > > > On Mon, Nov 11, 2024 at 8:06 PM Masahiro Yamada > > wrote: > > > > > > On Thu, Oct 31, 2024 at 2:01 AM

Re: [PATCH v5 01/19] scripts: move genksyms crc32 implementation to a common include

2024-11-13 Thread Sami Tolvanen
Hi, On Mon, Nov 11, 2024 at 8:06 PM Masahiro Yamada wrote: > > On Thu, Oct 31, 2024 at 2:01 AM Sami Tolvanen wrote: > > > > To avoid duplication between host programs, move the crc32 code to a > > shared header file. > > > Only the motivation to use this lo

Re: [PATCH v5 18/19] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-11-13 Thread Sami Tolvanen
Hi Masahiro, On Mon, Nov 11, 2024 at 8:09 PM Masahiro Yamada wrote: > > On Thu, Oct 31, 2024 at 2:01 AM Sami Tolvanen wrote: > > > > # These mirror gensymtypes_c and co above, keep them in synch. >

Re: [PATCH] tests/module/gen_test_kallsyms.sh: use 0 value for variables

2024-11-06 Thread Sami Tolvanen
Call Trace: > > dump_stack_lvl+0x56/0x80 > do_init_module.cold+0x21/0x26 > init_module_from_file+0x88/0xf0 > idempotent_init_module+0x108/0x300 > __x64_sys_finit_module+0x5a/0xb0 > do_syscall_64+0x4b/0x110 > entry_SYSCALL_64_after_hwframe+0x76/0x7e > RIP: 0033:0x

Re: [PATCH v5 00/19] Implement DWARF modversions

2024-10-30 Thread Sami Tolvanen
Hi Sedat, On Wed, Oct 30, 2024 at 2:00 PM Sedat Dilek wrote: > > Hi Sami, > > perfect timing: Nathan uploaded SLIM LLVM toolchain v19.1.3 > > KBUILD_GENDWARFKSYMS_STABLE is to be set manually? > What value is recommended? The usage is similar to KBUILD_SYMTYPES, you can just set KBUILD_GENDWARFK

[PATCH v5 02/19] tools: Add gendwarfksyms

2024-10-30 Thread Sami Tolvanen
Add a basic DWARF parser, which uses libdw to traverse the debugging information in an object file and looks for functions and variables. In follow-up patches, this will be expanded to produce symbol versions for CONFIG_MODVERSIONS from DWARF. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa

[PATCH v5 00/19] Implement DWARF modversions

2024-10-30 Thread Sami Tolvanen
es. - Added a GENDWARFKSYMS option and hooked up kbuild support for both C and assembly code. Note that with gendwarfksyms, we have to actually build a temporary .o file for calculating assembly modversions. v1: https://lore.kernel.org/lkml/20240617175818.58219-17-samitolva...@google.com/

[PATCH v5 09/19] gendwarfksyms: Expand structure types

2024-10-30 Thread Sami Tolvanen
type { base_type u8 byte_size(1) encoding(7) } data_ptr data_member_location(0) , member base_type usize byte_size(8) encoding(7) length data_member_location(8) } byte_size(16) alignment(8) msg ) -> base_type void Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-b

[PATCH v5 11/19] gendwarfksyms: Add die_map debugging

2024-10-30 Thread Sami Tolvanen
Debugging the DWARF processing can be somewhat challenging, so add more detailed debugging output for die_map operations. Add the --dump-die-map flag, which adds color coded tags to the output for die_map changes. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu

[PATCH v5 17/19] export: Add __gendwarfksyms_ptr_ references to exported symbols

2024-10-30 Thread Sami Tolvanen
igned-off-by: Sami Tolvanen Acked-by: Neal Gompa --- include/linux/export.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/export.h b/include/linux/export.h index 0bbd02fd351d..cf71d3202e5b 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@

[PATCH v5 18/19] kbuild: Add gendwarfksyms as an alternative to genksyms

2024-10-30 Thread Sami Tolvanen
When MODVERSIONS is enabled, allow selecting gendwarfksyms as the implementation, but default to genksyms. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- kernel/module/Kconfig | 25 - scripts/Makefile | 2 +- scripts/Makefile.build | 41

[PATCH v5 05/19] gendwarfksyms: Add a cache for processed DIEs

2024-10-30 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/Makefile| 1 + scripts

[PATCH v5 19/19] Documentation/kbuild: Add DWARF module versioning

2024-10-30 Thread Sami Tolvanen
Add documentation for gendwarfksyms changes, and the kABI stability features that can be useful for distributions even though they're not used in mainline kernels. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- Documentation/kbuild/gendwarfksyms.rst

[PATCH v5 15/19] gendwarfksyms: Add support for reserved and ignored fields

2024-10-30 Thread Sami Tolvanen
truct { int b; int v; }; }; Here gendwarfksyms --stable replaces the union with the type of the placeholder field when calculating versions. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c

[PATCH v5 16/19] gendwarfksyms: Add support for symbol type pointers

2024-10-30 Thread Sami Tolvanen
xternal_symbol); Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 55 +- scripts/gendwarfksyms/examples/symbolptr.c | 33 + scripts/gendwarfksyms/gendwarfksyms.h | 7 +++ scripts/gendwarfk

[PATCH v5 12/19] gendwarfksyms: Add symtypes output

2024-10-30 Thread Sami Tolvanen
references are wrapped in single quotes. E.g.: s#'core::result::Result' 2. The actual type definition is the simple parsed DWARF format we output with --dump-dies, not the preprocessed C-style format genksyms produces. Signed-off-by: Sami Tolvanen Acked-by:

[PATCH v5 14/19] gendwarfksyms: Add support for kABI rules

2024-10-30 Thread Sami Tolvanen
tory. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/Makefile | 1 + scripts/gendwarfksyms/dwarf.c | 19 +- scripts/gendwarfksyms/examples/kabi.h | 61 + scripts/gendwarfksyms/examples/kabi_rules.c | 56 + s

[PATCH v5 13/19] gendwarfksyms: Add symbol versioning

2024-10-30 Thread Sami Tolvanen
Calculate symbol versions from the fully expanded type strings in type_map, and output the versions in a genksyms-compatible format. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/dwarf.c | 25 +- scripts/gendwarfksyms/gendwarfksyms.c | 10

[PATCH v5 10/19] gendwarfksyms: Limit structure expansion

2024-10-30 Thread Sami Tolvanen
type. This should be plenty for detecting ABI differences, but it stops us from pulling in half the kernel for types that contain pointers to large kernel data structures, like task_struct, for example. Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/Makefile

[PATCH v5 08/19] gendwarfksyms: Expand array_type

2024-10-30 Thread Sami Tolvanen
(8) } Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c index 7e6b477d7c12..ade9b3b7b119

[PATCH v5 07/19] gendwarfksyms: Expand subroutine_type

2024-10-30 Thread Sami Tolvanen
) } } ) -> base_type unsigned long byte_size(8) encoding(7) Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 84 ++- scripts/gendwarfksyms/gendwarfksyms.h | 4 ++ 2 files changed, 85 insertions(+)

[PATCH v5 06/19] gendwarfksyms: Expand type modifiers and typedefs

2024-10-30 Thread Sami Tolvanen
-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/die.c | 12 + scripts/gendwarfksyms/dwarf.c | 67 +++ scripts/gendwarfksyms/gendwarfksyms.h | 5 ++ 3 files changed, 84 insertions(+) diff --git a/scripts

[PATCH v5 04/19] gendwarfksyms: Expand base_type

2024-10-30 Thread Sami Tolvanen
variable base_type unsigned long byte_size(8) encoding(7) ... Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa Reviewed-by: Petr Pavlu --- scripts/gendwarfksyms/dwarf.c | 159 ++ 1 file changed, 159 insertions(+) diff --git a/scripts/gendwarfksyms/dwarf.c

[PATCH v5 01/19] scripts: move genksyms crc32 implementation to a common include

2024-10-30 Thread Sami Tolvanen
To avoid duplication between host programs, move the crc32 code to a shared header file. Suggested-by: Petr Pavlu Signed-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/genksyms/genksyms.c | 77 +- scripts/include/crc32.h | 93

[PATCH v5 03/19] gendwarfksyms: Add address matching

2024-10-30 Thread Sami Tolvanen
d-off-by: Sami Tolvanen Acked-by: Neal Gompa --- scripts/gendwarfksyms/gendwarfksyms.c | 2 + scripts/gendwarfksyms/gendwarfksyms.h | 13 +++ scripts/gendwarfksyms/symbols.c | 161 ++ 3 files changed, 176 insertions(+) diff --git a/scripts/gendwarf

Re: [PATCH] scripts: Remove export_report.pl

2024-10-29 Thread Sami Tolvanen
of it because it is clearly unused. > > Signed-off-by: Matthew Maurer Thanks for the patch! Applying this separately without waiting for the rest of the extended modversions series to land makes sense to me. Reviewed-by: Sami Tolvanen Sami

Re: [PATCH v3] selftests: add new kallsyms selftests

2024-10-29 Thread Sami Tolvanen
Hi Luis, On Mon, Oct 21, 2024 at 12:33 PM Luis Chamberlain wrote: > > diff --git a/lib/tests/module/gen_test_kallsyms.sh > b/lib/tests/module/gen_test_kallsyms.sh > new file mode 100755 > index ..e85f10dc11bd > --- /dev/null > +++ b/lib/tests/module/gen_test_kallsyms.sh > @@ -0,0 +1,

Re: [PATCH v7 1/3] modules: Support extended MODVERSIONS info

2024-10-25 Thread Sami Tolvanen
we reproduce > the munging for the new format. Other architectures do not appear to > have architecture-specific usage of this information. > > Signed-off-by: Matthew Maurer Reviewed-by: Sami Tolvanen Sami

Re: [PATCH v7 3/3] rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS

2024-10-25 Thread Sami Tolvanen
On Wed, Oct 23, 2024 at 02:31:30AM +, Matthew Maurer wrote: > From: Sami Tolvanen > > Previously, two things stopped Rust from using MODVERSIONS: > 1. Rust symbols are occasionally too long to be represented in the >original versions table > 2. Rust types cannot be prop

  1   2   3   4   5   6   7   8   9   10   >