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 | 274 +
Documentation/k
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 @@
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 | 39
xternal_symbol);
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 55 +-
scripts/gendwarfksyms/examples/symbolptr.c | 29
scripts/gendwarfksyms/gendwarfksyms.h | 7 +++
scripts/gendwarfksyms/symbols.c| 27 +++
4 file
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
---
scripts/gendwarfksyms/dwarf.c | 202 +-
scripts/gendwarfksyms/exa
tory.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/Makefile | 1 +
scripts/gendwarfksyms/dwarf.c | 19 +-
scripts/gendwarfksyms/examples/kabi.h | 61 ++
scripts/gendwarfksyms/examples/kabi_rules.c | 56 +
scripts/gendwarfksyms/gendwar
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/dwarf.c | 25 +-
scripts/gendwarfksyms/gendwarfksyms.c | 11 ++-
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
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
---
scripts/gendwarfksyms/dwarf.c | 15
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
---
scripts/gendwarfksyms/Makefile| 1 +
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
---
scripts/gendwarfksyms/
(8)
}
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 30 ++
1 file changed, 30 insertions(+)
diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
index 5bdab5b80ca2..caf25da0a9b9 100644
--- a/scripts/gendwarfksyms/dwarf.c
)
}
}
)
-> base_type unsigned long byte_size(8) encoding(7)
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 84 ++-
scripts/gendwarfksyms/gendwarfksyms.h | 4 ++
2 files changed, 85 insertions(+), 3 deletions(-)
diff --git a/scripts/gendwarfks
-off-by: Sami Tolvanen
---
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/scripts/gendwarfksyms
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
---
scripts/gendwarfksyms/Makefile| 1 +
scripts/gendwarfksyms/die.c | 143
variable base_type unsigned long byte_size(8) encoding(7)
...
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 157 ++
1 file changed, 157 insertions(+)
diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
index
d-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/gendwarfksyms.c | 2 +
scripts/gendwarfksyms/gendwarfksyms.h | 13 +++
scripts/gendwarfksyms/symbols.c | 153 +-
3 files changed, 165 insertions(+), 3 deletions(-)
diff --git a/scripts/gendwarfksyms/gendwarfksyms
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
---
kernel/module
To avoid duplication between host programs, move the crc32 code to a
shared header file.
Suggested-by: Petr Pavlu
Signed-off-by: Sami Tolvanen
---
scripts/genksyms/genksyms.c | 77 +-
scripts/include/crc32.h | 93 +
2 files
Import list_is_first, list_is_last, list_replace, and list_replace_init.
Signed-off-by: Sami Tolvanen
---
scripts/include/list.h | 50 ++
1 file changed, 50 insertions(+)
diff --git a/scripts/include/list.h b/scripts/include/list.h
index fea1e2b79063
C and assembly code. Note that with gendwarfksyms,
we have to actually build a temporary .o file for calculating
assembly modversions.
---
Sami Tolvanen (20):
scripts: import more list macros
scripts: move genksyms crc32 implementation to a common include
tools: Add gendwarfksyms
gendwarfks
Hi,
On Thu, Sep 12, 2024 at 2:58 PM Benno Lossin wrote:
>
> On 12.09.24 22:58, Sami Tolvanen wrote:
> > That's an interesting point. Is the problem that you cannot assign
> > arbitrary values to the Rust enum that bindgen generates, or is using
> > a #define the pr
Hi Benno,
On Thu, Sep 12, 2024 at 11:08 AM Benno Lossin wrote:
>
> On 12.09.24 18:06, Sami Tolvanen wrote:
> >
> > I thought about this a bit and I wonder if we need a separate
> > mechanism for that, or is it sufficient to just #define any additional
> > hidden val
On Wed, Sep 11, 2024 at 4:43 AM Petr Pavlu wrote:
>
> On 8/31/24 02:05, Sami Tolvanen wrote:
> > On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote:
> >>
> >> yes, this is one of the approaches we use in SLES. We add kabi paddings
> >> to some structures
Hi Petr,
On Wed, Sep 11, 2024 at 3:08 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > +static inline unsigned long partial_crc32(const char *s, unsigned long crc)
> > +{
> > + while (*s)
> > + crc = partial_crc32_one(*s
Hi Petr,
On Tue, Sep 10, 2024 at 7:58 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > @@ -122,6 +135,16 @@ int main(int argc, const char **argv)
> >
> > check(symbol_read_exports(stdin));
> >
> > + if (symtypes_file) {
> > +
On Tue, Sep 10, 2024 at 2:44 AM Masahiro Yamada wrote:
>
> On Fri, Sep 6, 2024 at 5:53 AM Sami Tolvanen wrote:
> >
> > Thanks for the patch! I think this would otherwise work, but I also
> > need jhash (or a similar hash function), and I can't combine the
> &
Hi,
On Thu, Sep 5, 2024 at 2:30 AM Masahiro Yamada wrote:
>
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> >
> > +++ b/scripts/gendwarfksyms/gendwarfksyms.h
> > @@ -0,0 +1,78 @@
> > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > +/*
&
On Tue, Sep 3, 2024 at 8:15 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > Expand each structure type only once per exported symbol. This
> > is necessary to support self-referential structures, which would
> > otherwise result in infinite recursion,
On Tue, Sep 3, 2024 at 8:11 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> >
> > +static int __process_subroutine_type(struct state *state, struct die
> > *cache,
> > + Dwarf_Die *die, const char *type)
> &
Hi Petr,
On Mon, Sep 2, 2024 at 3:05 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > +void die_map_free(void)
> > +{
> > + struct hlist_node *tmp;
> > + unsigned int stats[LAST + 1];
> > + struct die *cd;
> > + int
On Sun, Sep 1, 2024 at 11:00 AM Masahiro Yamada wrote:
>
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> >
> > /*
> > - * Symbol processing
> > + * Exported symbol processing
> > */
> > static int process_subprogram(struct state *state, D
Hi,
On Sun, Sep 1, 2024 at 11:11 AM Masahiro Yamada wrote:
>
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> >
> > +static int set_symbol_addr(struct symbol *sym, void *arg)
> > +{
> > + struct symbol_addr *addr = arg;
> > +
> >
Hi Masahiro,
On Sun, Sep 1, 2024 at 10:51 AM Masahiro Yamada wrote:
>
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> >
> > refers to struct pt_regs, make sure it's visible.
> >
> > Signed-off-by: Sami Tolvanen
>
>
> Then, why don't
Hi Miroslav,
On Fri, Aug 30, 2024 at 9:34 AM Miroslav Benes wrote:
>
> yes, this is one of the approaches we use in SLES. We add kabi paddings
> to some structures in advance (see [1] as a random example) and then use
> it later if needed.
>
> It is not the only approach. Much more often we do no
On Wed, Aug 28, 2024 at 02:35:29PM +0200, Petr Pavlu wrote:
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
> > index 65a29d0bd8f4..71cfab0553da 100644
> > --- a/scripts/gendwarfksyms/dwarf.c
> >
Hi Masahiro,
On Wed, Aug 28, 2024 at 04:04:09PM +0900, Masahiro Yamada wrote:
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> >
> > The first 16 patches of this series add a small tool for computing
>
>
> Splitting a new tool into small chunks makes line-by-l
On Thu, Aug 29, 2024 at 03:15:02AM +0900, Masahiro Yamada wrote:
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> > +static int append_item(struct die *cd, struct die_fragment **res)
> > +{
> > + struct die_fragment *prev;
> > + struct die_fragmen
On Wed, Aug 28, 2024 at 02:46:03PM +0200, Petr Pavlu wrote:
> > +static int process_fmt(struct state *state, const char *fmt, ...)
>
> Nit: The state parameter is unused by a number of these process_*()
> functions, including the leaf process(). I suggest removing it so it
> doesn't need to be pas
On Wed, Aug 28, 2024 at 04:15:03PM +0900, Masahiro Yamada wrote:
> On Wed, Aug 28, 2024 at 3:50 PM Masahiro Yamada wrote:
> >
> > On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen
> > wrote:
> > >
> > > The compiler may choose not to emit type information in
On Thu, Aug 29, 2024 at 03:22:25AM +0900, Masahiro Yamada wrote:
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> > int symbol_read_exports(FILE *file)
> > @@ -57,13 +93,14 @@ int symbol_read_exports(FILE *file)
> >
On Thu, Aug 29, 2024 at 03:16:21AM +0900, Masahiro Yamada wrote:
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> > @@ -105,6 +105,8 @@ int main(int argc, const char **argv)
> > if (parse_options(argc, argv) < 0)
> > return usage(
Hi Masahiro,
On Thu, Aug 29, 2024 at 02:45:03AM +0900, Masahiro Yamada wrote:
> On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote:
> > +static int usage(void)
> > +{
> > + error("usage: gendwarfksyms [options] elf-object-file ...");
>
>
>
>
On Wed, Aug 28, 2024 at 02:31:05PM +0200, Petr Pavlu wrote:
> On 8/26/24 20:47, Sami Tolvanen wrote:
> > How do you propose using the function? This loop goes through multiple
> > input files, should we need them, and we iterate through all the CUs
> > in process_modules.
&
Hi Petr,
On Tue, Aug 27, 2024 at 12:40 PM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > +static inline u32 symbol_addr_hash(const struct symbol_addr *addr)
> > +{
> > + return jhash(addr, sizeof(struct symbol_addr), 0);
>
> I would be c
Hi Petr,
On Tue, Aug 27, 2024 at 2:16 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > +static bool is_export_symbol(struct state *state, Dwarf_Die *die)
> > +{
> > + Dwarf_Die *source = die;
> > + Dwarf_Die origin;
> > +
> &
Hi Greg,
On Fri, Aug 16, 2024 at 12:14 AM Greg Kroah-Hartman
wrote:
>
> On Thu, Aug 15, 2024 at 05:39:05PM +, Sami Tolvanen wrote:
> > --- /dev/null
> > +++ b/scripts/gendwarfksyms/dwarf.c
> > @@ -0,0 +1,87 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
&g
Hi Petr,
On Mon, Aug 26, 2024 at 10:42 AM Petr Pavlu wrote:
>
> On 8/15/24 19:39, Sami Tolvanen wrote:
> > +static int parse_options(int argc, const char **argv)
> > +{
> > + for (int i = 1; i < argc; i++) {
> > + bool flag = false;
> >
On Thu, Aug 22, 2024 at 11:53 PM Greg Kroah-Hartman
wrote:
>
> On Thu, Aug 22, 2024 at 12:00:15PM +, Benno Lossin wrote:
> > > Here's one example in the android tree where 4 64bit fields are reserved
> > > for future abi changes:
> > >
> > > https://android.googlesource.com/kernel/common/
On Fri, Aug 23, 2024 at 10:06 AM Kris Van Hees wrote:
>
> On Fri, Aug 23, 2024 at 04:53:29PM +, Sami Tolvanen wrote:
> > Hi Kris,
> >
> > On Thu, Aug 22, 2024 at 02:19:39PM -0400, Kris Van Hees wrote:
> > > diff --git a/scripts/generate_bu
Hi Kris,
On Thu, Aug 22, 2024 at 02:19:39PM -0400, Kris Van Hees wrote:
> diff --git a/scripts/generate_builtin_ranges.awk
> b/scripts/generate_builtin_ranges.awk
> new file mode 100755
> index ..68df05fd3036
> --- /dev/null
> +++ b/scripts/generate_builtin_ranges.awk
> @@ -0,0 +1,505
Hi Jon,
On Thu, Aug 22, 2024 at 9:43 AM Jonathan Corbet wrote:
>
> Sami Tolvanen writes:
>
> > The first 16 patches of this series add a small tool for computing
> > symbol versions from DWARF, called gendwarfksyms. When passed a
> > list of exported symbols a
t and C code for modules so we can ensure we get proper
> reviews for both parts of the code and so that we can scale.
>
> Add those who have stepped up to help.
>
> Signed-off-by: Luis Chamberlain
Acked-by: Sami Tolvanen
Sami
On Wed, Aug 21, 2024 at 4:31 AM Benno Lossin wrote:
>
> On 20.08.24 22:03, Matthew Maurer wrote:
> >>> The way `KAbiReserved` is implemented is via a `union` (maybe a bit
> >>> ironic, considering what I said in my other replies, but in this case,
> >>> we would provide a safe abstraction over thi
On Tue, Aug 20, 2024 at 5:21 PM Masami Hiramatsu wrote:
>
> On Wed, 21 Aug 2024 08:43:51 +0900
> Masami Hiramatsu (Google) wrote:
>
> > On Tue, 20 Aug 2024 18:11:09 -0400
> > Steven Rostedt wrote:
> >
> > > On Wed, 21 Aug 2024 07:05:39 +0900
> > > Masami Hiramatsu (Google) wrote:
> > >
> > >
>
On Mon, Aug 19, 2024 at 10:17 PM Benno Lossin wrote:
>
> On 19.08.24 21:38, Sami Tolvanen wrote:
> >
> > This definitely looks cleaner than unions in Rust, but how would this
> > scheme be visible in DWARF? You might also need to expand the annotation
> > to allo
On Tue, Aug 20, 2024 at 3:48 AM Mark Rutland wrote:
>
> On Tue, Aug 20, 2024 at 10:03:30AM +0900, Masami Hiramatsu wrote:
> > On Mon, 19 Aug 2024 12:02:44 -0400
> > Steven Rostedt wrote:
> >
> > > On Tue, 20 Aug 2024 00:56:49 +0900
> > > Masami Hiramatsu (Google) wrote:
> > > >
> > > > >
> > > >
Hi Benno,
On Sat, Aug 17, 2024 at 01:19:55PM +, Benno Lossin wrote:
>
> For this use-case (the one in the patch), I don't really know if we want
> to copy the approach from C. Do we even support exporting kABI from
> Rust? If yes, then we I would recommend we tag it in the source code
> inste
Hi Greg,
On Fri, Aug 16, 2024 at 12:20 AM Greg Kroah-Hartman
wrote:
>
> On Thu, Aug 15, 2024 at 05:39:20PM +, Sami Tolvanen wrote:
> > Distributions that want to maintain a stable kABI need the ability to
> > add reserved fields to kernel data structures that they anti
Hi Sedat,
On Thu, Aug 15, 2024 at 8:14 PM Sedat Dilek wrote:
>
> so this work is on top of Linux v6.11-rc3
Correct. git format-patch also adds the base commit to the end of the
cover letter.
> can you tag it as gendwarfksyms-v2?
Sure. Here you go:
https://github.com/samitolvanen/linux/commits
Hi Matt,
On Tue, Aug 6, 2024 at 9:25 PM Matthew Maurer wrote:
>
[...]
> +void modversion_ext_start(const struct load_info *info,
> + struct modversion_info_ext *start)
> +{
> + unsigned int crc_idx = info->index.vers_ext_crc;
> + unsigned int name_idx = info->i
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 | 34 --
3
refers to struct pt_regs, make sure it's visible.
Signed-off-by: Sami Tolvanen
---
arch/x86/include/asm/asm-prototypes.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/asm-prototypes.h
b/arch/x86/include/asm/asm-prototypes.h
index 25466c4d2134..c82e68c8b7c2 1
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 @@
g int byte_size(8) encoding(5) data_member_location(0),
member base_type long int byte_size(8) encoding(5) data_member_location(8),
} byte_size(16);
#SYMVER exported 0x67997f89
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 148 +-
sc
g --stable, the definition is ignored and we again
have the original symbol version:
subprogram(
formal_parameter pointer_type {
structure_type struct0 {
}
} byte_size(8),
)
-> base_type int byte_size(4) encoding(5);
#SYMVER func 0x7e8284f9
Signed-off-b
Add a basic CRC32 implementation adapted from genksyms, and produce
matching output from symtypes strings in type_map.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/Makefile| 1 +
scripts/gendwarfksyms/crc32.c | 69 ++
scripts/gendwarfksyms/crc32.h
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
.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 19 +--
scripts/gendwarfksyms/gendwarfksyms.c | 9 +
scripts/gendwarfksyms/gendwarfksyms.h | 14 ++
3 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/scripts/gendwarfksyms
levels. 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
---
scripts/gendwarfksyms/Makefile| 1 +
scripts
&str {
member pointer_type {
base_type u8 byte_size(1) encoding(7)
} data_member_location(0),
member base_type usize byte_size(8) encoding(7) data_member_location(8),
} byte_size(16) alignment(8)
},
)
-> base_type void;
Signed-off-by: Sami Tolvanen
-
(8)
};
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 31 +++
1 file changed, 31 insertions(+)
diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
index c81652426be8..4ec69fce95f3 100644
--- a/scripts/gendwarfksyms/dwarf.c
ype void;
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 57 ++-
scripts/gendwarfksyms/gendwarfksyms.h | 1 +
2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
in
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
---
scripts/gendwarfksyms/Makefile| 1 +
scripts/gendwarfksyms/die.c | 170
-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/die.c | 13 +
scripts/gendwarfksyms/dwarf.c | 76 +--
scripts/gendwarfksyms/gendwarfksyms.h | 7 ++-
3 files changed, 92 insertions(+), 4 deletions(-)
diff --git a/scripts/gendwarfksyms/die.c b/scripts
base_type unsigned long byte_size(8) encoding(7);
...
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 121 +-
1 file changed, 120 insertions(+), 1 deletion(-)
diff --git a/scripts/gendwarfksyms/dwarf.c b/scripts/gendwarfksyms/dwarf.c
index
xternal_symbol);
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/dwarf.c | 26 +-
scripts/gendwarfksyms/gendwarfksyms.h | 6 ++
scripts/gendwarfksyms/symbols.c | 16
3 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/scripts
d-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/gendwarfksyms.c | 2 +
scripts/gendwarfksyms/gendwarfksyms.h | 7 ++
scripts/gendwarfksyms/symbols.c | 161 +-
3 files changed, 165 insertions(+), 5 deletions(-)
diff --git a/scripts/gendwarfksyms/gendwarfksyms
Add support for passing a list of exported symbols to gendwarfksyms
via stdin and filter out non-exported symbols from the output.
Signed-off-by: Sami Tolvanen
---
scripts/gendwarfksyms/Makefile| 1 +
scripts/gendwarfksyms/dwarf.c | 53 ++-
scripts/gendwarfksyms
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
---
kernel/module
data structure fields and declaration-onl
structures. Also added examples for using these features.
- 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
assem
anges in the first
place, this series looks reasonable to me. Thanks for cleaning this
up!
Reviewed-by: Sami Tolvanen
Sami
Hi,
On Wed, Aug 7, 2024 at 3:08 AM Masami Hiramatsu wrote:
>
> On Wed, 7 Aug 2024 00:19:20 +
> Song Liu wrote:
>
> > Do you mean we do not want patch 3/3, but would like to keep 1/3 and part
> > of 2/3 (remove the _without_suffix APIs)? If this is the case, we are
> > undoing the change by S
Hi Petr,
On Thu, Aug 1, 2024 at 4:22 AM Petr Pavlu wrote:
>
> STG is an interesting tool. I've played with it a bit last year. To be
> frank, I was surprised to see a new tool being proposed by Google to
> generate modversion CRCs from DWARF instead of potentially extending
> your STG project for
Hi Petr,
On Mon, Jul 22, 2024 at 8:20 AM Petr Pavlu wrote:
>
> From my perspective, I'm okay if gendwarfksyms doesn't provide
> functionality to compare a new object file with its reference symtypes
> file.
>
> As mentioned, genksyms has this functionality but I actually think the
> way it works
Hi Luis,
On Thu, Jul 18, 2024 at 5:15 PM Luis Chamberlain wrote:
>
> On Tue, Jul 09, 2024 at 12:08:16PM +0200, Miguel Ojeda wrote:
> > On Mon, Jul 8, 2024 at 11:42 PM Luis Chamberlain wrote:
> > >
> > > The rationale here is that a rust binding means commitment then also
> > > from fresh blood t
On Tue, Jul 16, 2024 at 12:12 AM Greg Kroah-Hartman
wrote:
>
> > After replacement:
> >
> > union {
> > u64 new_member;
> > struct {
> > u8 __kabi_reserved_1[8];
> > };
> > }
>
> Note, such a thing would only be for the distros that w
Hi Petr,
On Wed, Jul 10, 2024 at 7:30 AM Petr Pavlu wrote:
>
> On 6/17/24 19:58, Sami Tolvanen wrote:
> > Hi folks,
> >
> > This series implements CONFIG_MODVERSIONS for Rust, an important
> > feature for distributions like Android that want to ship Rust
>
On Mon, Jul 8, 2024 at 2:33 PM Luis Chamberlain wrote:
>
> Looking at this again its not to me why Masahiro Yamada's suggestion on
> that old patch series to just increase the length and put long symbols
> names into its own section [0] could not be embraced with a new kconfig
> option, so new ker
Hi Luis,
On Fri, Jun 28, 2024 at 10:36 AM Luis Chamberlain wrote:
>
> On Fri, Jun 28, 2024 at 02:23:49PM +0200, Miroslav Benes wrote:
> > On Fri, 7 Jun 2024, Song Liu wrote:
> >
> > > Hi Miroslav,
> > >
> > > Thanks for reviewing the patch!
> > >
> > > I think it is possible. Currently, kallsyms_
Hi Luis,
On Tue, Jun 18, 2024 at 12:42:51PM -0700, Luis Chamberlain wrote:
> On Mon, Jun 17, 2024 at 05:58:19PM +0000, Sami Tolvanen wrote:
> > The first 12 patches of this series add a small tool for computing
> > symbol versions from DWARF, called gendwarfksyms. When passe
On Wed, Jun 19, 2024 at 04:03:45AM +0900, Masahiro Yamada wrote:
> On Wed, Jun 19, 2024 at 2:18 AM Greg Kroah-Hartman
> wrote:
> >
> > On Wed, Jun 19, 2024 at 01:50:36AM +0900, Masahiro Yamada wrote:
> > > On Wed, Jun 19, 2024 at 1:44 AM Greg Kroah-Hartman
> > > wrote:
> > > >
> > > > That's cool
On Wed, Jun 19, 2024 at 01:47:13AM +0900, Masahiro Yamada wrote:
> On Tue, Jun 18, 2024 at 2:58 AM Sami Tolvanen wrote:
> >
> > +#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
>
>
>
>
> I know this is a copy-
Hi Masahiro,
On Wed, Jun 19, 2024 at 01:28:21AM +0900, Masahiro Yamada wrote:
> I am surprised at someone who attempts to add another variant of genksyms.
The options are rather limited if we want Rust modules that are
compatible with modversions. We either come up with a way to version
Rust symb
e_type void;
Signed-off-by: Sami Tolvanen
---
tools/gendwarfksyms/gendwarfksyms.h | 5 ++
tools/gendwarfksyms/types.c | 127 +++-
2 files changed, 130 insertions(+), 2 deletions(-)
diff --git a/tools/gendwarfksyms/gendwarfksyms.h
b/tools/gendwarfksyms/gend
Use gendwarfksyms to generate symbol versions for exported Rust symbols,
and allow CONFIG_MODVERSIONS to be enabled with CONFIG_RUST, assuming the
debugging information needed by gendwarfksyms is also available.
Signed-off-by: Sami Tolvanen
---
Makefile | 6 ++
init/Kconfig | 2
When checking modversions for symbol names longer than MODULE_NAME_LEN,
look for the hashed symbol name instead. This is needed for Rust modules,
which frequently use symbol names longer than the maximum length
supported by struct modversion_info.
Suggested-by: Matthew Maurer
Signed-off-by: Sami
if needed.
Suggested-by: Matthew Maurer
Signed-off-by: Sami Tolvanen
---
scripts/mod/Makefile | 4 +-
scripts/mod/modpost.c | 20 ++-
scripts/mod/modpost.h | 20 +++
scripts/mod/symhash.c | 327 ++
4 files changed, 364 insertions(+), 7 deletions(-)
Understanding the operation and caching of the tool can be somewhat
challenging without a debugger. Add inline debugging information with
the --inline-debug command, which adds highlighted tags to the --debug
output with information about cache states etc.
Signed-off-by: Sami Tolvanen
---
tools
levels
inside the pointer. This should be plenty for catching ABI differences
and stops us from pulling in half the kernel for structs that contain
pointers to large structs like task_struct.
Signed-off-by: Sami Tolvanen
---
tools/gendwarfksyms/cache.c | 49
tools
1 - 100 of 891 matches
Mail list logo