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
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
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
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
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
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
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 @@
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
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
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
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
---
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
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
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:
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
(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
)
}
}
)
-> 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
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
-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
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
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
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
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
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
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
> > -
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
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
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
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 @@
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
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
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
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
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:
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
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
(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
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
---
)
}
}
)
-> 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
-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
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
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
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
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
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
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
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.
>
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
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
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?
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
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
(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
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
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
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
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
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
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 @@
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
---
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
)
}
}
)
-> 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
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
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
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
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
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
-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
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
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
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
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
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
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.
>
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
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
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
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/
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
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
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
@@
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
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
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
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
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
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:
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
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
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
(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
)
}
}
)
-> 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(+)
-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
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
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
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
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
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,
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
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 - 100 of 1033 matches
Mail list logo