From: Sami Uddin
Prevent usage of shared memory regions where the length is zero,
as such configurations are not valid and may lead to unexpected behavior.
Signed-off-by: Sami Uddin
---
v3:
- Use idiomatic 'if (!region->len)' as suggested by reviewer
v2:
- Fixed coding style issue
From: Sami Uddin
Prevent usage of shared memory regions where the length is zero,
as such configurations are not valid and may lead to unexpected behavior.
Signed-off-by: Sami Uddin
---
v2:
- Fixed coding style issue: added space after 'if' statement
include/linux/virtio_config.h
From: Sami Uddin
Prevent usage of shared memory regions where the length is zero,
as such configurations are not valid and may lead to unexpected behavior.
Signed-off-by: Sami Uddin
---
include/linux/virtio_config.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux
Document the "byte_size" and "type_string" kABI stability rules.
Signed-off-by: Sami Tolvanen
---
Documentation/kbuild/gendwarfksyms.rst | 97 --
1 file changed, 92 insertions(+), 5 deletions(-)
diff --git a/Documentation/kbuild/gendwarfksyms.rst
b/
iginal
and therefore, won't change versions for symbols that reference
the changed structure.
Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
---
scripts/gendwarfksyms/dwarf.c| 14 -
scripts/gendwarfksyms/examples/kabi.h| 7 +++
scripts/gendwarfksym
Change the gendwarfksyms documentation to use proper chapter,
section, and subsection adornments instead of fragile section
numbers.
Suggested-by: Masahiro Yamada
Signed-off-by: Sami Tolvanen
---
Documentation/kbuild/gendwarfksyms.rst | 44 +-
1 file changed, 22
lating versions.
Suggested-by: Giuliano Procida
Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
---
scripts/gendwarfksyms/examples/kabi.h| 14 ++-
scripts/gendwarfksyms/examples/kabi_ex.c | 5 +
scripts/gendwarfksyms/examples/kabi_ex.h | 79 -
scripts/gendwarfk
Reduce code duplication by moving kABI rule look-ups to separate
functions.
Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
---
scripts/gendwarfksyms/kabi.c | 101 +++
1 file changed, 44 insertions(+), 57 deletions(-)
diff --git a/scripts/gendwarfksyms
used for version calculation.
Sami
---
v3:
- Added a patch to drop documentation section numbers based
on Masahiro's suggestion.
v2: https://lore.kernel.org/r/20250505212401.3379699-6-samitolva...@google.com/
- Cleaned up type string parsing based on Petr's feedback.
v1: https://lo
;ll send v3 that drops the section numbers.
Sami
Document byte_size and type_string kABI stability rules. Also fix
the section numbers while we're at it.
Signed-off-by: Sami Tolvanen
---
Documentation/kbuild/gendwarfksyms.rst | 103 +++--
1 file changed, 95 insertions(+), 8 deletions(-)
diff --git a/Documentation/k
lating versions.
Suggested-by: Giuliano Procida
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/examples/kabi.h| 14 ++-
scripts/gendwarfksyms/examples/kabi_ex.c | 5 +
scripts/gendwarfksyms/examples/kabi_ex.h | 79 -
scripts/gendwarfksyms/gendwarfksyms.h
iginal
and therefore, won't change versions for symbols that reference
the changed structure.
Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
---
scripts/gendwarfksyms/dwarf.c| 14 -
scripts/gendwarfksyms/examples/kabi.h| 7 +++
scripts/gendwarfksym
Reduce code duplication by moving kABI rule look-ups to separate
functions.
Signed-off-by: Sami Tolvanen
Reviewed-by: Petr Pavlu
---
scripts/gendwarfksyms/kabi.c | 101 +++
1 file changed, 44 insertions(+), 57 deletions(-)
diff --git a/scripts/gendwarfksyms
used for version calculation.
Sami
---
v2:
- Cleaned up type string parsing based on Petr's feedback.
v1: https://lore.kernel.org/r/20250430214049.2658716-6-samitolva...@google.com/
---
Sami Tolvanen (4):
gendwarfksyms: Clean up kABI rule look-ups
gendwarfksyms: Add a kABI rule t
Hi Petr,
On Mon, May 5, 2025 at 5:17 AM Petr Pavlu wrote:
>
> On 4/30/25 23:40, Sami Tolvanen wrote:
> > +static void type_parse(const char *name, const char *str,
> > +struct type_expansion *type)
> > +{
> > + char *fragment;
> > +
lating versions.
Suggested-by: Giuliano Procida
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/examples/kabi.h| 14 ++-
scripts/gendwarfksyms/examples/kabi_ex.c | 5 +
scripts/gendwarfksyms/examples/kabi_ex.h | 79 -
scripts/gendwarfksyms/gendwarfksyms.h
iginal
and therefore, won't change versions for symbols that reference
the changed structure.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c| 14 -
scripts/gendwarfksyms/examples/kabi.h| 7 +++
scripts/gendwarfksyms/examples/kabi_ex.c | 2 ++
scrip
Document byte_size and type_string kABI stability rules. Also fix
the section numbers while we're at it.
Signed-off-by: Sami Tolvanen
---
Documentation/kbuild/gendwarfksyms.rst | 103 +++--
1 file changed, 95 insertions(+), 8 deletions(-)
diff --git a/Documentation/k
used for version calculation.
Sami
---
Sami Tolvanen (4):
gendwarfksyms: Clean up kABI rule look-ups
gendwarfksyms: Add a kABI rule to override byte_size attributes
gendwarfksyms: Add a kABI rule to override type strings
Documentation/kbuild: Add new gendwarfksyms kABI rules
Document
Reduce code duplication by moving kABI rule look-ups to separate
functions.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/kabi.c | 101 +++
1 file changed, 44 insertions(+), 57 deletions(-)
diff --git a/scripts/gendwarfksyms/kabi.c b/scripts
e module [$module] BTF: -22
As the issue occurs in pahole v1.28 and the fix was merged
after v1.29 was released, require pahole v1.29 when
GENDWARFKSYMS is enabled with DEBUG_INFO_BTF on X86.
Reported-by: Paolo Pisati
Signed-off-by: Sami Tolvanen
---
Changes in v2:
- Also allow pahole 129
Hi Masahiro,
On Sun, Apr 6, 2025 at 1:21 PM Masahiro Yamada wrote:
>
> On Fri, Mar 21, 2025 at 8:28 AM Sami Tolvanen wrote:
> >
> > With CONFIG_GENDWARFKSYMS, __gendwarfksyms_ptr variables are added
> > to the kernel in EXPORT_SYMBOL() to ensure DWARF type informat
on
was merged after v1.29 was released, so later versions of pahole
shouldn't have this issue. Require pahole >v1.29 when GENDWARFKSYMS
is enabled with DEBUG_INFO_BTF on X86.
Reported-by: Paolo Pisati
Signed-off-by: Sami Tolvanen
---
kernel/module/Kconfig | 4
1 file changed, 4 i
Hi Petr,
On Wed, Mar 12, 2025 at 5:05 AM Petr Pavlu wrote:
>
> On 3/7/25 01:12, Sami Tolvanen wrote:
> > On Thu, Mar 06, 2025 at 06:28:58PM +0100, Christophe Leroy wrote:
> >> Le 06/03/2025 à 14:13, Petr Pavlu a écrit :
> >>> Section .static_call_sites hold
ns in the module linker script
feels cleaner than having an array of section names in the code. To be
fair, I think this code predates v5.10, where scripts/module.lds.S was
first added.
Sami
ild with gendwarfksyms and Rust is 14.8%
faster with this patch applied on my test system. Without Rust, there's
still a 10.4% improvement in build time when gendwarfksyms is used.
Note that symbol versions are unchanged with this patch.
Suggested-by: Giuliano Procida
Signed-off-by:
em, I assume
libdw-dev would be required to build with CONFIG_GENDWARFKSYMS.
Sami
ou're testing with something newer?
$ hppa64-linux-gnu-ld.bfd --version
GNU ld (GNU Binutils for Debian) 2.42.50.20240625
$ hppa64-linux-gnu-objdump -h configs.ko | grep -E '(format|this_module)'
configs.ko: file format elf64-hppa-linux
17 .gnu.linkonce.this_module 0300
5c50 2**4
Sami
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
ps://github.com/samitolvanen/linux/commits/gendwarfksyms-v8
If you also want to test the series with actual Rust modules, this
branch adds v13 of Matt's modversion_info series:
https://github.com/samitolvanen/linux/commits/rustmodversions-v8
Sami
[1] https://lore.kernel.or
esn't use this code since v6.1.
> - Your series as-is (no recurisve loop)
Note that this patch only adds a comment to is_module_cfi_trap(), so I
wouldn't expect a functional change.
Sami
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
ps://github.com/samitolvanen/linux/commits/gendwarfksyms-v7
If you also want to test the series with actual Rust modules, this
branch adds Matt's latest modversion_info series:
https://github.com/samitolvanen/linux/commits/rustmodversions-v7
Sami
[1] https://lore.kernel.or
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.
>
make you feel unwelcomed.
Thank you for putting this more eloquently than I could, Miguel. Neal,
I do appreciate your feedback, and I'm sorry if I didn't make it clear
enough in my previous emails. I would very much welcome your
Tested-by, or another suitable tag that's acceptable to both you and
Masahiro.
Sami
mber of attributes we look up depending on the DIE
type, but I haven't had time to look into it yet. I'll take a closer
look when I'm back from my vacation in about three weeks.
Sami
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
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
v6
If you also want to test the series with actual Rust modules, this
branch adds Matt's latest modversion_info series:
https://github.com/samitolvanen/linux/commits/rustmodversions-v6
Sami
[1] https://lore.kernel.org/lkml/znizetkkqweig...@bombadil.infradead.org/
[2]
https://lore.kernel.o
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
1 - 100 of 1146 matches
Mail list logo