- Oct 06, 2024
-
-
Aaron Thompson authored
The blank line causes execve() to fail: # strace ./postinst execve("./postinst", ...) = -1 ENOEXEC (Exec format error) strace: exec: Exec format error +++ exited with 1 +++ However running the scripts via shell does work (at least with bash) because the shell attempts to execute the file as a shell script when execve() fails. Fixes: b611daae ("kbuild: deb-pkg: split image and debug objects staging out into functions") Signed-off-by:
Aaron Thompson <dev@aaront.org> Reviewed-by:
Nathan Chancellor <nathan@kernel.org> Reviewed-by:
Nicolas Schier <nicolas@fjasle.eu> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Sami Tolvanen authored
Import list_is_first, list_is_last, list_replace, and list_replace_init. Signed-off-by:
Sami Tolvanen <samitolvanen@google.com> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Oct 02, 2024
-
-
Masahiro Yamada authored
If you enable "Option -> Show Debug Info" and click a link, the program terminates with the following error: *** buffer overflow detected ***: terminated The buffer overflow is caused by the following line: strcat(data, "$"); The buffer needs one more byte to accommodate the additional character. Fixes: c4f7398b ("kconfig: qconf: make debug links work again") Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Oct 01, 2024
-
-
Masahiro Yamada authored
The constructor of ConfigMainWindow() calls show*View(), which needs to calculate symbol values. conf_read() must be called before that. Fixes: 060e05c3 ("kconfig: qconf: remove initial call to conf_changed()") Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Since commit 95573cac ("kconfig: cache expression values"), xconfig emits a lot of false-positive "unmet direct dependencies" warnings. While conf_read() clears val_is_valid flags, 'make xconfig' calculates symbol values even before the conf_read() call. This is another issue that should be addressed separately, but it has revealed that the val_is_valid field is not initialized. Fixes: 95573cac ("kconfig: cache expression values") Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Sep 30, 2024
-
-
Masahiro Yamada authored
Since commit f79dc03f ("kconfig: refactor choice value calculation"), Kconfig for ARCH=powerpc may result in an infinite loop. This occurs because there are two entries for POWERPC64_CPU in a choice block. If the same symbol appears twice in a choice block, the ->choice_link node is added twice to ->choice_members, resulting a corrupted linked list. A simple test case is: choice prompt "choice" config A bool "A" config B bool "B 1" config B bool "B 2" endchoice Running 'make defconfig' results in an infinite loop. One solution is to replace the current two entries: config POWERPC64_CPU bool "Generic (POWER5 and PowerPC 970 and above)" depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN select PPC_64S_HASH_MMU config POWERPC64_CPU bool "Generic (POWER8 and above)" depends on PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN select ARCH_HAS_FAST_MULTIPLIER select PPC_64S_HASH_MMU select PPC_HAS_LBARX_LHARX with the following single entry: config POWERPC64_CPU bool "Generic 64 bit powerpc" depends on PPC_BOOK3S_64 select ARCH_HAS_FAST_MULTIPLIER if CPU_LITTLE_ENDIAN select PPC_64S_HASH_MMU select PPC_HAS_LBARX_LHARX if CPU_LITTLE_ENDIAN In my opinion, the latter looks cleaner, but PowerPC maintainers may prefer to display different prompts depending on CPU_LITTLE_ENDIAN. For now, this commit fixes the issue in Kconfig, restoring the original behavior. I will reconsider whether such a use case is worth supporting. Fixes: f79dc03f ("kconfig: refactor choice value calculation") Reported-by:
Marco Bonelli <marco@mebeim.net> Closes: https://lore.kernel.org/all/1763151587.3581913.1727224126288@privateemail.com/ Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Commit aab94339 ("of: Add support for linking device tree blobs into vmlinux") introduced a mechanism to embed DTBs into vmlinux. Initially, it was used for wrapping boot DTBs in arch/*/boot/dts/, but it is now reused for more generic purposes, such as testing. Built-in DTBs are discarded because KERNEL_DTB() is part of INIT_DATA, as defined in include/asm-generic/vmlinux.lds.h. This has not been an issue so far because OF unittests are triggered during boot, as defined by late_initcall(of_unittest). However, the recent clk KUnit test additions have caused problems because KUnit can execute test suites after boot. For example: # echo > /sys/kernel/debug/kunit/clk_register_clk_parent_data_device/run This command triggers a stack trace because built-in DTBs have already been freed. While it is possible to move such test suites from kunit_test_suites to kunit_test_init_section_suites, it would be preferable to avoid usage limitations. This commit moves non-boot built-in DTBs to the .rodata section. Since these generic DTBs are looked up by name, they do not need to be placed in the special .dtb.init.rodata section. Boot DTBs should remain in .dtb.init.rodata because the arch boot code generally does not know the DT name, thus it uses the __dtb_start symbol to locate it. This separation also ensures that the __dtb_start symbol references the boot DTB. Currently, the .dtb.init.rodata is a mixture of both boot and non-boot DTBs. The __dtb_start symbol must be followed by the boot DTB, but we currently rely on the link order (i.e., the order in Makefiles), which is very fragile. The implementation is kind of cheesy; the section is .dtb.init.rodata when $(obj) starts with arch/$(SRCARCH)/boot/dts, and .rodata section otherwise. This will be refactored later. Fixes: 5c9dd72d ("of: Add a KUnit test for overlays and test managed APIs") Fixes: 5776526b ("clk: Add KUnit tests for clk fixed rate basic type") Fixes: 274aff87 ("clk: Add KUnit tests for clks registered with struct clk_parent_data") Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Acked-by:
Rob Herring (Arm) <robh@kernel.org>
-
- Sep 28, 2024
-
-
Julia Lawall authored
The isomorphism neg_if_exp negates the test of a ?: conditional, making it unnecessary to have an explicit case for a negated test with the branches inverted. At the same time, we can disable neg_if_exp in cases where a different API function may be more suitable for a negated test. Finally, in the non-patch cases, E matches an expression with parentheses around it, so there is no need to mention () explicitly in the pattern. The () are still needed in the patch cases, because we want to drop them, if they are present. Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
The parentheses are only needed if there is a disjunction, ie a set of possible changes. If there is only one pattern, we can remove these parentheses. Just like the format: - x + y not: ( - x + y ) Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_yes_no() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_on_off() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_write_read() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_read_write() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_enable{d}_ disable{d}() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_lo{w}_hi{gh}() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As other rules done, we add rules for str_hi{gh}_lo{w}() to check the relative opportunities. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
As done with str_true_false(), add checks for str_false_true() opportunities. A simple test can find over 9 cases currently exist in the tree. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
Hongbo Li authored
After str_true_false() has been introduced in the tree, we can add rules for finding places where str_true_false() can be used. A simple test can find over 10 locations. Signed-off-by:
Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Julia Lawall <Julia.Lawall@inria.fr>
-
- Sep 27, 2024
-
-
Al Viro authored
no_llseek had been defined to NULL two years ago, in commit 868941b1 ("fs: remove no_llseek") To quote that commit, At -rc1 we'll need do a mechanical removal of no_llseek - git grep -l -w no_llseek | grep -v porting.rst | while read i; do sed -i '/\<no_llseek\>/d' $i done would do it. Unfortunately, that hadn't been done. Linus, could you do that now, so that we could finally put that thing to rest? All instances are of the form .llseek = no_llseek, so it's obviously safe. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Sep 20, 2024
-
-
Jan Stancek authored
ENGINE API has been deprecated since OpenSSL version 3.0 [1]. Distros have started dropping support from headers and in future it will likely disappear also from library. It has been superseded by the PROVIDER API, so use it instead for OPENSSL MAJOR >= 3. [1] https://github.com/openssl/openssl/blob/master/README-ENGINES.md [jarkko: fixed up alignment issues reported by checkpatch.pl --strict] Signed-off-by:
Jan Stancek <jstancek@redhat.com> Reviewed-by:
Jarkko Sakkinen <jarkko@kernel.org> Tested-by:
R Nageswara Sastry <rnsastry@linux.ibm.com> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Jarkko Sakkinen <jarkko@kernel.org>
-
Jan Stancek authored
ERR_get_error_line() is deprecated since OpenSSL 3.0. Use ERR_peek_error_line() instead, and combine display_openssl_errors() and drain_openssl_errors() to a single function where parameter decides if it should consume errors silently. Signed-off-by:
Jan Stancek <jstancek@redhat.com> Reviewed-by:
Jarkko Sakkinen <jarkko@kernel.org> Tested-by:
R Nageswara Sastry <rnsastry@linux.ibm.com> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Jarkko Sakkinen <jarkko@kernel.org>
-
Jan Stancek authored
Couple error handling helpers are repeated in both tools, so move them to a common header. Signed-off-by:
Jan Stancek <jstancek@redhat.com> Reviewed-by:
Jarkko Sakkinen <jarkko@kernel.org> Tested-by:
R Nageswara Sastry <rnsastry@linux.ibm.com> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Jarkko Sakkinen <jarkko@kernel.org>
-
Thomas Weißschuh authored
The append operation was introduced in commit b1a1a1a0 ("kbuild: lto: postpone objtool") when the command was created from two parts. In commit 850ded46 ("kbuild: Fix TRIM_UNUSED_KSYMS with LTO_CLANG") however the first part was removed again, making the append operation unnecessary. To keep this command definition aligned with all other command definitions, remove the append again. Signed-off-by:
Thomas Weißschuh <linux@weissschuh.net> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Cache expression values to avoid recalculating them repeatedly. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Currently, every expression in Kconfig files produces a new abstract syntax tree (AST), even if it is identical to a previously encountered one. Consider the following code: config FOO bool "FOO" depends on (A || B) && C config BAR bool "BAR" depends on (A || B) && C config BAZ bool "BAZ" depends on A || B The "depends on" lines are similar, but currently a separate AST is allocated for each one. The current data structure looks like this: FOO->dep ==> AND BAR->dep ==> AND BAZ->dep ==> OR / \ / \ / \ OR C OR C A B / \ / \ A B A B This is redundant; FOO->dep and BAR->dep have identical ASTs but different memory instances. We can optimize this; FOO->dep and BAR->dep can share the same AST, and BAZ->dep can reference its sub tree. The optimized data structure looks like this: FOO->dep, BAR->dep ==> AND / \ BAZ->dep ==> OR C / \ A B This commit introduces a hash table to keep track of allocated expressions. If an identical expression is found, it is reused. This does not necessarily result in memory savings, as menu_finalize() transforms expressions without freeing up stale ones. This will be addressed later. One optimization that can be easily implemented is caching the expression's value. Once FOO's dependency, (A || B) && C, is calculated, it can be cached, eliminating the need to recalculate it for BAR. This commit also reverts commit e983b7b1 ("kconfig/menu.c: fix multiple references to expressions in menu_add_prop()"). Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Currently, expr_eliminate_dups() passes two identical pointers down to expr_eliminate_dups1(), which later skips processing identical leaves. This approach is somewhat tricky and, more importantly, it will not work with the refactoring made in the next commit. This commit slightly changes the recursion logic; it deduplicates both the left and right arms, and then passes them to expr_eliminate_dups1(). expr_eliminate_dups() should produce the same result. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Provide explanations for complex transformations. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
This clarifies the behavior of these functions. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
This function was originally added by commit 8af27e1d ("fixdep: use hash table instead of a single array"). Move it to scripts/include/ so that other host programs can use it. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
Change the 'overflow' variable to bool. Also, remove unnecessary parentheses. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
After commit 64e16609 ("kallsyms: get rid of code for absolute, kallsyms"), there is only one call site for output_address(). Squash it. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Kris Van Hees authored
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by:
Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by:
Nick Alcock <nick.alcock@oracle.com> Tested-by:
Sam James <sam@gentoo.org> Reviewed-by:
Sami Tolvanen <samitolvanen@google.com> Tested-by:
Sami Tolvanen <samitolvanen@google.com> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Kris Van Hees authored
The modules.builtin.ranges offset range data for builtin modules is generated at compile time based on the list of built-in modules and the vmlinux.map and vmlinux.o.map linker maps. This data can be used to determine whether a symbol at a particular address belongs to module code that was configured to be compiled into the kernel proper as a built-in module (rather than as a standalone module). This patch adds a script that uses the generated modules.builtin.ranges data to annotate the symbols in the System.map with module names if their address falls within a range that belongs to one or more built-in modules. It then processes the vmlinux.map (and if needed, vmlinux.o.map) to verify the annotation: - For each top-level section: - For each object in the section: - Determine whether the object is part of a built-in module (using modules.builtin and the .*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by:
Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by:
Nick Alcock <nick.alcock@oracle.com> Reviewed-by:
Alan Maguire <alan.maguire@oracle.com> Tested-by:
Sam James <sam@gentoo.org> Reviewed-by:
Sami Tolvanen <samitolvanen@google.com> Tested-by:
Sami Tolvanen <samitolvanen@google.com> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Kris Van Hees authored
Create file module.builtin.ranges that can be used to find where built-in modules are located by their addresses. This will be useful for tracing tools to find what functions are for various built-in modules. The offset range data for builtin modules is generated using: - modules.builtin: associates object files with module names - vmlinux.map: provides load order of sections and offset of first member per section - vmlinux.o.map: provides offset of object file content per section - .*.cmd: build cmd file with KBUILD_MODFILE The generated data will look like: .text 00000000-00000000 = _text .text 0000baf0-0000cb10 amd_uncore .text 0009bd10-0009c8e0 iosf_mbi ... .text 00b9f080-00ba011a intel_skl_int3472_discrete .text 00ba0120-00ba03c0 intel_skl_int3472_discrete intel_skl_int3472_tps68470 .text 00ba03c0-00ba08d6 intel_skl_int3472_tps68470 ... .data 00000000-00000000 = _sdata .data 0000f020-0000f680 amd_uncore For each ELF section, it lists the offset of the first symbol. This can be used to determine the base address of the section at runtime. Next, it lists (in strict ascending order) offset ranges in that section that cover the symbols of one or more builtin modules. Multiple ranges can apply to a single module, and ranges can be shared between modules. The CONFIG_BUILTIN_MODULE_RANGES option controls whether offset range data is generated for kernel modules that are built into the kernel image. How it works: 1. The modules.builtin file is parsed to obtain a list of built-in module names and their associated object names (the .ko file that the module would be in if it were a loadable module, hereafter referred to as <kmodfile>). This object name can be used to identify objects in the kernel compile because any C or assembler code that ends up into a built-in module will have the option -DKBUILD_MODFILE=<kmodfile> present in its build command, and those can be found in the .<obj>.cmd file in the kernel build tree. If an object is part of multiple modules, they will all be listed in the KBUILD_MODFILE option argument. This allows us to conclusively determine whether an object in the kernel build belong to any modules, and which. 2. The vmlinux.map is parsed next to determine the base address of each top level section so that all addresses into the section can be turned into offsets. This makes it possible to handle sections getting loaded at different addresses at system boot. We also determine an 'anchor' symbol at the beginning of each section to make it possible to calculate the true base address of a section at runtime (i.e. symbol address - symbol offset). We collect start addresses of sections that are included in the top level section. This is used when vmlinux is linked using vmlinux.o, because in that case, we need to look at the vmlinux.o linker map to know what object a symbol is found in. And finally, we process each symbol that is listed in vmlinux.map (or vmlinux.o.map) based on the following structure: vmlinux linked from vmlinux.a: vmlinux.map: <top level section> <included section> -- might be same as top level section) <object> -- built-in association known <symbol> -- belongs to module(s) object belongs to ... vmlinux linked from vmlinux.o: vmlinux.map: <top level section> <included section> -- might be same as top level section) vmlinux.o -- need to use vmlinux.o.map <symbol> -- ignored ... vmlinux.o.map: <section> <object> -- built-in association known <symbol> -- belongs to module(s) object belongs to ... 3. As sections, objects, and symbols are processed, offset ranges are constructed in a straight-forward way: - If the symbol belongs to one or more built-in modules: - If we were working on the same module(s), extend the range to include this object - If we were working on another module(s), close that range, and start the new one - If the symbol does not belong to any built-in modules: - If we were working on a module(s) range, close that range Signed-off-by:
Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by:
Nick Alcock <nick.alcock@oracle.com> Reviewed-by:
Alan Maguire <alan.maguire@oracle.com> Reviewed-by:
Steven Rostedt (Google) <rostedt@goodmis.org> Tested-by:
Sam James <sam@gentoo.org> Reviewed-by:
Sami Tolvanen <samitolvanen@google.com> Tested-by:
Sami Tolvanen <samitolvanen@google.com> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Sep 16, 2024
-
-
Matthew Maurer authored
Rust supports KASAN via LLVM, but prior to this patch, the flags aren't set properly. Suggested-by:
Miguel Ojeda <ojeda@kernel.org> Signed-off-by:
Matthew Maurer <mmaurer@google.com> Reviewed-by:
Andrey Konovalov <andreyknvl@gmail.com> Link: https://lore.kernel.org/r/20240820194910.187826-4-mmaurer@google.com [ Applied "SW_TAGS KASAN" nit. - Miguel ] Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
Matthew Maurer authored
Creates flag probe macro variants for `rustc`. These are helpful because: 1. The kernel now supports a minimum `rustc` version rather than a single version. 2. `rustc` links against a range of LLVM revisions, occasionally even ones without an official release number. Since the availability of some Rust flags depends on which LLVM it has been linked against, probing is necessary. Signed-off-by:
Matthew Maurer <mmaurer@google.com> Link: https://github.com/Rust-for-Linux/linux/pull/1087 Link: https://lore.kernel.org/r/20240820194910.187826-2-mmaurer@google.com Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
Andrey Konovalov authored
When KASAN support was being added to the Linux kernel, GCC did not yet support all of the KASAN-related compiler options. Thus, the KASAN Makefile had to probe the compiler for supported options. Nowadays, the Linux kernel GCC version requirement is 5.1+, and thus we don't need the probing of the -fasan-shadow-offset parameter: it exists in all 5.1+ GCCs. Simplify the KASAN Makefile to drop CFLAGS_KASAN_MINIMAL. Also add a few more comments and unify the indentation. Signed-off-by:
Andrey Konovalov <andreyknvl@gmail.com> Acked-by:
Marco Elver <elver@google.com> Link: https://lore.kernel.org/r/20240814161052.10374-1-andrey.konovalov@linux.dev Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
Matthew Maurer authored
Make it possible to use the Control Flow Integrity (CFI) sanitizer when Rust is enabled. Enabling CFI with Rust requires that CFI is configured to normalize integer types so that all integer types of the same size and signedness are compatible under CFI. Rust and C use the same LLVM backend for code generation, so Rust KCFI is compatible with the KCFI used in the kernel for C. In the case of FineIBT, CFI also depends on -Zpatchable-function-entry for rewriting the function prologue, so we set that flag for Rust as well. The flag for FineIBT requires rustc 1.80.0 or later, so include a Kconfig requirement for that. Enabling Rust will select CFI_ICALL_NORMALIZE_INTEGERS because the flag is required to use Rust with CFI. Using select rather than `depends on` avoids the case where Rust is not visible in menuconfig due to CFI_ICALL_NORMALIZE_INTEGERS not being enabled. One disadvantage of select is that RUST must `depends on` all of the things that CFI_ICALL_NORMALIZE_INTEGERS depends on to avoid invalid configurations. Alice has been using KCFI on her phone for several months, so it is reasonably well tested on arm64. Signed-off-by:
Matthew Maurer <mmaurer@google.com> Co-developed-by:
Alice Ryhl <aliceryhl@google.com> Signed-off-by:
Alice Ryhl <aliceryhl@google.com> Reviewed-by:
Sami Tolvanen <samitolvanen@google.com> Tested-by:
Gatlin Newhouse <gatlin.newhouse@gmail.com> Acked-by:
Kees Cook <kees@kernel.org> Acked-by:
Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20240801-kcfi-v2-2-c93caed3d121@google.com [ Replaced `!FINEIBT` requirement with `!CALL_PADDING` to prevent a build error on older Rust compilers. Fixed typo. - Miguel ] Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
- Sep 14, 2024
-
-
Masahiro Yamada authored
When DEBUG_INFO_DWARF5 is selected, pahole 1.21+ is required to enable DEBUG_INFO_BTF. When DEBUG_INFO_DWARF4 or DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is selected, DEBUG_INFO_BTF can be enabled without pahole installed, but a build error will occur in scripts/link-vmlinux.sh: LD .tmp_vmlinux1 BTF: .tmp_vmlinux1: pahole (pahole) is not available Failed to generate BTF for vmlinux Try to disable CONFIG_DEBUG_INFO_BTF We did not guard DEBUG_INFO_BTF by PAHOLE_VERSION when previously discussed [1]. However, commit 613fe169 ("kbuild: Add CONFIG_PAHOLE_VERSION") added CONFIG_PAHOLE_VERSION after all. Now several CONFIG options, as well as the combination of DEBUG_INFO_BTF and DEBUG_INFO_DWARF5, are guarded by PAHOLE_VERSION. The remaining compile-time check in scripts/link-vmlinux.sh now appears to be an awkward inconsistency. This commit adopts Nathan's original work. [1]: https://lore.kernel.org/lkml/20210111180609.713998-1-natechancellor@gmail.com/ Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Alan Maguire <alan.maguire@oracle.com> Acked-by:
Andrii Nakryiko <andrii@kernel.org> Reviewed-by:
Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20240913173759.1316390-2-masahiroy@kernel.org Signed-off-by:
Alexei Starovoitov <ast@kernel.org>
-
Masahiro Yamada authored
CONFIG_DEBUG_INFO_BTF depends on CONFIG_BPF_SYSCALL, which in turn selects CONFIG_BPF. When CONFIG_DEBUG_INFO_BTF=y, CONFIG_BPF=y is always met. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Alan Maguire <alan.maguire@oracle.com> Acked-by:
Andrii Nakryiko <andrii@kernel.org> Reviewed-by:
Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20240913173759.1316390-1-masahiroy@kernel.org Signed-off-by:
Alexei Starovoitov <ast@kernel.org>
-