[PATCH 0/3] Add version macros for clang and fix arm64 for clang <6.0

2017-11-28 Thread Sami Tolvanen
m64: use -mno-implicit-float instead of -mgeneral-regs-only Sami Tolvanen (2): kbuild: add clang-version.sh kbuild: add cc-if-name-version and compiler-specific variants arch/arm64/Makefile | 5 - scripts/Kbuild.include | 31 +++ scripts/clang-version

[PATCH 2/3] kbuild: add cc-if-name-version and compiler-specific variants

2017-11-28 Thread Sami Tolvanen
This change adds macros for testing both compiler name and version. Current cc-version, cc-ifversion etc. macros that test gcc version are left unchanged to prevent compatibility issues with existing tests. Signed-off-by: Sami Tolvanen --- scripts/Kbuild.include | 31

[PATCH 1/3] kbuild: add clang-version.sh

2017-11-28 Thread Sami Tolvanen
Based on gcc-version.sh, clang-version.sh prints out the correct version of clang. Signed-off-by: Sami Tolvanen --- scripts/clang-version.sh | 33 + 1 file changed, 33 insertions(+) create mode 100755 scripts/clang-version.sh diff --git a/scripts/clang

[PATCH 3/3] arm64: use -mno-implicit-float instead of -mgeneral-regs-only

2017-11-28 Thread Sami Tolvanen
e the workaround only for clang <6.0] Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b35788c909f1..d2efb5a0212f 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/

[PATCH v2 1/2] kbuild: add clang-version.sh

2017-11-30 Thread Sami Tolvanen
Based on gcc-version.sh, clang-version.sh prints out the correct version of clang. Signed-off-by: Sami Tolvanen Tested-by: Nick Desaulniers --- scripts/clang-version.sh | 33 + 1 file changed, 33 insertions(+) create mode 100755 scripts/clang-version.sh diff

[PATCH v2 2/2] kbuild: add __cc-ifversion and compiler-specific variants

2017-11-30 Thread Sami Tolvanen
This change adds macros for testing both compiler name and version. Current cc-version, cc-ifversion etc. macros that test gcc version are left unchanged to prevent compatibility issues with existing tests. Signed-off-by: Sami Tolvanen --- scripts/Kbuild.include | 41

[PATCH v2 1/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION

2017-11-30 Thread Sami Tolvanen
Don't remove .head.text or .exitcall.exit when linking with --gc-sections, and include .init.text.* in .init.text and .init.rodata.* in .init.rodata. Signed-off-by: Sami Tolvanen Reviewed-by: Nicholas Piggin --- include/asm-generic/vmlinux.lds.h | 8 1 file changed, 4 insertions(

[PATCH v2 3/7] kbuild: add ld-name macro

2017-11-30 Thread Sami Tolvanen
GNU gold may require different flags than GNU ld. Add a macro for detecting the linker. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers --- scripts/Kbuild.include | 4 1 file changed, 4 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index

[PATCH v2 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-30 Thread Sami Tolvanen
e the erratum fix is not used even if the linker is configured to enable it by default. This change also adds a warning if the erratum fix is enabled and gold version <1.14 is used. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/ar

[PATCH v2 0/2] Add version macros for clang

2017-11-30 Thread Sami Tolvanen
This patch set adds macros for checking clang version. Changes from v1: - fixed a comment in clang-version.sh - renamed macros to __cc-ifversion and __cc-if-fullversion - fixed a bug with non-bash shells - dropped the arm64 patch as unnecessary Sami Tolvanen (2): kbuild: add clang

[PATCH v2 4/7] kbuild: add __ld-ifversion and linker-specific macros

2017-11-30 Thread Sami Tolvanen
Add macros for testing both linker name and version. Signed-off-by: Sami Tolvanen --- scripts/Kbuild.include | 12 1 file changed, 12 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 899863e4cd05..2991b463b4ce 100644 --- a/scripts/Kbuild.include

[PATCH v2 5/7] arm64: fix -m for GNU gold

2017-11-30 Thread Sami Tolvanen
GNU gold supports different emulations than bfd. Use aarch64_elf64_*_vec instead of aarch64linux. Signed-off-by: Sami Tolvanen Acked-by: Yury Norov --- arch/arm64/Makefile | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b35788c909f1

[PATCH v2 7/7] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS

2017-11-30 Thread Sami Tolvanen
All current versions of GNU gold crash when linking kernel modules with ARM64_MODULE_PLTS due to a known bug: https://sourceware.org/bugzilla/show_bug.cgi?id=14592 To work around the problem, this change removes NOLOAD from .plt and .init.plt. Signed-off-by: Sami Tolvanen Acked-by: Ard

[PATCH v2 2/7] arm64: keep .altinstructions and .altinstr_replacement

2017-11-30 Thread Sami Tolvanen
Make sure the linker doesn't remove .altinstructions or .altinstr_replacement when CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled. Signed-off-by: Sami Tolvanen --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/k

[PATCH v2 0/7] Add support for GNU gold

2017-11-30 Thread Sami Tolvanen
-name-version to __ld-ifversion for consistency - cleaned up the erratum changes in arch/arm64/Makefile Sami Tolvanen (7): kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION arm64: keep .altinstructions and .altinstr_replacement kbuild: add ld-name macro kbuild: add __ld-ifversion and linker

Re: [PATCH 00/15] Add support for clang LTO

2017-11-09 Thread Sami Tolvanen
which is part of the 5.0 release, but not in the latest Android clang prebuilts. Before this change, no branches were generated in __init_stage2_translation. Using -mllvm -jump-threading-threshold=0 also appears to solve this problem. Sami

Re: [PATCH 13/15] arm64: fix mrs_s/msr_s macros for clang LTO

2017-11-09 Thread Sami Tolvanen
seems to be happy with it. > It has solved many problems you also try to solve, and some patches > are looking very similar. I haven't had a closer look at the gcc LTO patches yet, but I am definitely all for using common code where possible. Sami

Re: [PATCH 13/15] arm64: fix mrs_s/msr_s macros for clang LTO

2017-11-09 Thread Sami Tolvanen
problem by reusing vmlinux.o for kallsyms instead of linking all bitcode again in each step. I'm not sure if this is feasible with gcc. Sami

Re: [PATCH 13/15] arm64: fix mrs_s/msr_s macros for clang LTO

2017-11-09 Thread Sami Tolvanen
On Thu, Nov 09, 2017 at 07:48:06AM +0300, Maxim Kuvyrkov wrote: > Regarding CONFIG_* options, I would expect most of the configuration > changes to be equally valid for both GCC's and Clang's LTO support. > Sami, I don't think it's fair to ask you to support both Cla

Re: [PATCH 10/15] arm64: disable ARM64_ERRATUM_843419 for clang LTO

2017-11-09 Thread Sami Tolvanen
s awkward as well. I agree. Unless someone objects, I'll replace this in v2 with a patch that leaves the relocations in module.c even when the erratum is selected. Sami

Re: [PATCH v2 08/18] arm64: don't disable ADR_PREL_PG_HI21* with ARM64_ERRATUM_843419

2017-11-17 Thread Sami Tolvanen
rop this patch in v3 as passing code model to LLVMgold fixes the issue with LTO. Sami

Re: [v2,12/18] kbuild: add support for clang LTO

2017-11-20 Thread Sami Tolvanen
x27;t know how to deal with an archive of LLVM IR files, but I can certainly use thin archives as an index and extract the path names for linking. I'll look into it. Sami

Re: [PATCH v2 09/18] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-20 Thread Sami Tolvanen
about older versions of gold. Sami

Re: [PATCH v2 16/18] arm64: crypto: disable LTO for aes-ce-cipher.c

2017-11-20 Thread Sami Tolvanen
;aese v0.16b, v1.16b ;umov w12, v0.4s[0] ; ^ LLVM ERROR: Error parsing inline asm Sami

Re: [PATCH v2 16/18] arm64: crypto: disable LTO for aes-ce-cipher.c

2017-11-20 Thread Sami Tolvanen
our compat issue. Sure, that would also work. Sami

Re: [PATCH v2 00/18] Add support for clang LTO

2017-11-20 Thread Sami Tolvanen
Absolutely. I'll split the patches into more sensible sets. Sami

Re: [PATCH 3/3] arm64: use -mno-implicit-float instead of -mgeneral-regs-only

2017-11-29 Thread Sami Tolvanen
ugh. Sami

Re: Link time optimization for LTO/x86

2017-11-29 Thread Sami Tolvanen
d changing the config option prefix to LTO_GCC, for example? It looks like there are a few places where gcc LTO needs to be disabled, but clang LTO works fine, and vice versa. My earlier clang LTO patches also had a solution for MODVERSIONS, which might work with gcc as well. Sami

Re: [v2,12/18] kbuild: add support for clang LTO

2017-11-29 Thread Sami Tolvanen
v3 for review once I receive some feedback for the clang/gold patches we need first. Sami

[PATCH 0/7] Add support for GNU gold

2017-11-29 Thread Sami Tolvanen
These patches add macros for detecting the linker name and version, and apply fixes and workarounds needed to link the arm64 kernel with GNU gold. Sami Tolvanen (7): kbuild: add ld-name macro and support for GNU gold kbuild: add ld-if-name-version and linker-specific macros kbuild: fix

[PATCH 2/7] kbuild: add ld-if-name-version and linker-specific macros

2017-11-29 Thread Sami Tolvanen
Add macros for testing both linker name and version. Signed-off-by: Sami Tolvanen --- scripts/Kbuild.include | 12 1 file changed, 12 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a7c7843c2cf1..5d286d69e8dc 100644 --- a/scripts/Kbuild.include

[PATCH 7/7] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS

2017-11-29 Thread Sami Tolvanen
All current versions of GNU gold crash when linking kernel modules with ARM64_MODULE_PLTS due to a known bug: https://sourceware.org/bugzilla/show_bug.cgi?id=14592 To work around the problem, this change removes NOLOAD from .plt and .init.plt. Signed-off-by: Sami Tolvanen --- arch/arm64

[PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-29 Thread Sami Tolvanen
e the erratum fix is not used even if the linker is configured to enable it by default. This change also adds a warning if the erratum fix is enabled and gold version <1.14 is used. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/ar

[PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement

2017-11-29 Thread Sami Tolvanen
Make sure the linker doesn't remove .altinstructions or .altinstr_replacement when CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled. Signed-off-by: Sami Tolvanen --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/k

[PATCH 3/7] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold

2017-11-29 Thread Sami Tolvanen
Don't remove .head.text or .exitcall.exit when linking with --gc-sections, and include .init.text.* in .init.text and .init.rodata.* in .init.rodata. Signed-off-by: Sami Tolvanen --- include/asm-generic/vmlinux.lds.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --

[PATCH 4/7] arm64: fix -m for GNU gold

2017-11-29 Thread Sami Tolvanen
GNU gold supports different emulations than bfd. Use aarch64_elf64_*_vec instead of aarch64linux. Signed-off-by: Sami Tolvanen Acked-by: Yury Norov --- arch/arm64/Makefile | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b35788c909f1

[PATCH 1/7] kbuild: add ld-name macro and support for GNU gold

2017-11-29 Thread Sami Tolvanen
GNU gold may require different flags than GNU ld. Add a macro for detecting the linker and conditionally add gold specific flags from LDFLAGS_GOLD. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers --- Makefile | 5 + scripts/Kbuild.include | 4 2 files changed

Re: [PATCH 2/3] kbuild: add cc-if-name-version and compiler-specific variants

2017-11-30 Thread Sami Tolvanen
lversion for consistency? > I think you can do like follows to avoid code duplication. > > # backward compatibility > cc-ifversion = $(gcc-ifversion) > cc-if-fullversion = $(gcc-if-fullversion) Sure, both changes sound good to me. I'll fix these in v2. Sami

Re: [PATCH 1/7] kbuild: add ld-name macro and support for GNU gold

2017-11-30 Thread Sami Tolvanen
ving it in v2. Sami

Re: [PATCH 5/7] arm64: keep .altinstructions and .altinstr_replacement

2017-11-30 Thread Sami Tolvanen
ossibly then you could also do a 3rd patch to allow arm64 to > select it if it's working with gcc? These patches only fix the issues I ran into with clang and gold when testing on a single device. I feel like more testing would be needed before enabling this by default for arm64. Sami

Re: [PATCH 6/7] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-30 Thread Sami Tolvanen
else > ... > > ? Sure. I'll clean this up in v2. Sami

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

2024-10-08 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 v4 02/19] tools: Add gendwarfksyms

2024-10-08 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 v4 00/19] Implement DWARF modversions

2024-10-08 Thread Sami Tolvanen
m/samitolvanen/linux/commits/gendwarfksyms-v4 If you also want to test the series with Rust modules, this branch adds Matt's latest modversion_info series and a small patch to enable Rust modversions: https://github.com/samitolvanen/linux/commits/rustmodversions-v4 Sami [1] https://lore.kern

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

2024-10-08 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 --- scripts/gendwarfksyms/Makefile| 1 + scripts/gendwarfksyms/die.c

[PATCH v4 04/19] gendwarfksyms: Expand base_type

2024-10-08 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 v4 06/19] gendwarfksyms: Expand type modifiers and typedefs

2024-10-08 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 v4 03/19] gendwarfksyms: Add address matching

2024-10-08 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 | 148 ++ 3 files changed, 163 insertions(+) diff --git a/scripts/gendwarf

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

2024-10-08 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 ---

[PATCH v4 07/19] gendwarfksyms: Expand subroutine_type

2024-10-08 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(+)

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

2024-10-11 Thread Sami Tolvanen
Hi Luis, On Fri, Oct 11, 2024 at 4:42 PM Luis Chamberlain wrote: > > On Tue, Oct 08, 2024 at 06:38:24PM +, Sami Tolvanen wrote: > > Hi, > > > > Here's v4 of the DWARF modversions series. The main motivation is > > modversions support for Rust, which is i

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

2024-10-08 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 v4 12/19] gendwarfksyms: Add symtypes output

2024-10-08 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 v4 13/19] gendwarfksyms: Add symbol versioning

2024-10-08 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 | 11

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

2024-10-08 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 v4 11/19] gendwarfksyms: Add die_map debugging

2024-10-08 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 --- scripts/gendwarfksyms

[PATCH v4 08/19] gendwarfksyms: Expand array_type

2024-10-08 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 v4 15/19] gendwarfksyms: Add support for reserved and ignored fields

2024-10-08 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 --- scripts/gendwarfksyms/dwarf.c | 202 +- sc

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

2024-10-08 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 v4 16/19] gendwarfksyms: Add support for symbol type pointers

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

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

2024-10-08 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 | 39

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

2024-10-08 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 @@

Re: [PATCH v2] module: sign with sha512 instead of sha1 by default

2024-10-16 Thread Sami Tolvanen
quired modules with > scripts/sign-file" > choice > prompt "Hash algorithm to sign modules" > depends on MODULE_SIG || IMA_APPRAISE_MODSIG > + default MODULE_SIG_SHA512 > help > This determines which sort of hashing algorithm will be used during > signature generation. This algorithm _must_ be built into the > kernel This looks good to me. Thank you for the patch! Reviewed-by: Sami Tolvanen Sami

Re: [PATCH 00/12] Module Validation Refactor

2024-10-16 Thread Sami Tolvanen
nel/module/main.c | 569 +-- > 2 files changed, 428 insertions(+), 148 deletions(-) Looks like these patches are unchanged from the pre-split version[1]. For the series: Reviewed-by: Sami Tolvanen [1] https://lore.kernel.org/linux-modules/20240925233854.90072-1-mmau...@google.com/ Sami

Re: [PATCH v6 4/5] modpost: Produce extended MODVERSIONS information

2024-10-16 Thread Sami Tolvanen
TENDED_MODVERSIONS in scripts/Makefile.modpost instead. [1] https://github.com/samitolvanen/linux/commits/rustmodversions Sami

Re: [PATCH v6 1/5] export_report: Rehabilitate script

2024-10-16 Thread Sami Tolvanen
essed the section attribute, > leading to a regex mismatch. Update it to match modpost.c > > [1]: > https://lore.kernel.org/all/20190909113423.2289-2-yamada.masah...@socionext.com/ If this script has been broken for half a decade and nobody noticed, does anyone actually use it? If this is dead code, I would prefer to just delete it. Sami

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

2024-10-16 Thread Sami Tolvanen
Hi Petr, On Wed, Oct 16, 2024 at 2:16 PM Petr Pavlu wrote: > > On 10/8/24 20:38, Sami Tolvanen wrote: > > /* > > - * These can be emitted for stand-elone assembly code, which means we > > + * These can be emitted for stand-alone assembly code, which mea

Re: [RFC PATCH v1] module: sign with sha512 by default to avoid build errors

2024-10-10 Thread Sami Tolvanen
unds like a better > solution. Will likely give it a try, unless someone brings up unwanted > side effects this might cause. Yes, that would be a much better way to change the default. Overall, moving away from SHA-1 seems like a good idea and SHA-512 feels like a reasonable choice. Luis, do you see any issues with changing the default here? Sami

Re: [PATCH v7 0/3] Extended MODVERSIONS Support

2024-10-24 Thread Sami Tolvanen
Drop patches to fix export_report.pl Unless Luis prefers to deal with this separately, perhaps you can just include a patch to delete export_report.pl in this series? Sami

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
talled" >&2 > + exit $ksft_skip > + fi Is there a reason to test for kmod? I don't see it called directly in this script. Also, shouldn't you add the module directory to TARGETS in tools/testing/selftests/Makefile? Otherwise the script won't be installed with the rest of kselftests. Sami

[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 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 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 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

[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 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 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 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 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 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 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 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 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 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 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 00/19] Implement DWARF modversions

2024-10-30 Thread Sami Tolvanen
m/samitolvanen/linux/commits/rustmodversions-v5 Sami [1] https://lore.kernel.org/lkml/znizetkkqweig...@bombadil.infradead.org/ [2] https://lore.kernel.org/lkml/20240925233854.90072-1-mmau...@google.com/ --- v5: - Rebased on v6.12-rc5. - Fixed an issue with limiting structure expansion, and appli

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_SYMTY

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 v4 14/19] gendwarfksyms: Add support for kABI rules

2024-10-23 Thread Sami Tolvanen
Hi, On Tue, Oct 22, 2024 at 7:39 AM Petr Pavlu wrote: > > On 10/8/24 20:38, Sami Tolvanen wrote: > > +/* > > + * KABI_USE_ARRAY(fqn) > > + * Treat the struct fqn as a declaration, i.e. even if a definition > > + * is available, don't expand

Re: [PATCH v4 13/19] gendwarfksyms: Add symbol versioning

2024-10-23 Thread Sami Tolvanen
This does require a cast when freeing the string, which isn't ideal, but I feel it's overall not a terrible trade-off. Sami

Re: [PATCH v7 2/3] modpost: Produce extended MODVERSIONS information

2024-10-24 Thread Sami Tolvanen
gt; Signed-off-by: Matthew Maurer Thanks for fixing this, LGTM. Reviewed-by: Sami Tolvanen Sami

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

2024-10-23 Thread Sami Tolvanen
Hi, On Wed, Oct 23, 2024 at 2:59 PM Petr Pavlu wrote: > > On 10/8/24 20:38, Sami Tolvanen wrote: > > +gendwarfksyms := scripts/gendwarfksyms/gendwarfksyms > > +getexportsymbols = $(NM) $(1) | sed -n 's/.* __export_symbol_\(.*\)/$(2)/p' > > + > &g

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

2024-10-23 Thread Sami Tolvanen
On Wed, Oct 23, 2024 at 2:53 PM Petr Pavlu wrote: > > I've noted some nits above which you might want to trivially address. These all looked reasonable to me, I'll address them in the next version. > Otherwise this looks ok to me, feel free to add: > > Reviewed-by: Petr Pavlu Thanks! Sami

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 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

<    5   6   7   8   9   10   11   12   >