- 01 2月, 2021 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 25 1月, 2021 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 18 1月, 2021 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 11 1月, 2021 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 04 1月, 2021 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 28 12月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 21 12月, 2020 1 次提交
-
-
由 Dominique Martinet 提交于
depmod is not guaranteed to be in /sbin, just let make look for it in the path like all the other invoked programs Signed-off-by: NDominique Martinet <asmadeus@codewreck.org> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 14 12月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 07 12月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 01 12月, 2020 1 次提交
-
-
由 Nathan Chancellor 提交于
Currently, '--orphan-handling=warn' is spread out across four different architectures in their respective Makefiles, which makes it a little unruly to deal with in case it needs to be disabled for a specific linker version (in this case, ld.lld 10.0.1). To make it easier to control this, hoist this warning into Kconfig and the main Makefile so that disabling it is simpler, as the warning will only be enabled in a couple places (main Makefile and a couple of compressed boot folders that blow away LDFLAGS_vmlinx) and making it conditional is easier due to Kconfig syntax. One small additional benefit of this is saving a call to ld-option on incremental builds because we will have already evaluated it for CONFIG_LD_ORPHAN_WARN. To keep the list of supported architectures the same, introduce CONFIG_ARCH_WANT_LD_ORPHAN_WARN, which an architecture can select to gain this automatically after all of the sections are specified and size asserted. A special thanks to Kees Cook for the help text on this config. Link: https://github.com/ClangBuiltLinux/linux/issues/1187Acked-by: NKees Cook <keescook@chromium.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by: NNick Desaulniers <ndesaulniers@google.com> Tested-by: NNick Desaulniers <ndesaulniers@google.com> Signed-off-by: NNathan Chancellor <natechancellor@gmail.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 30 11月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 25 11月, 2020 2 次提交
-
-
由 Nick Desaulniers 提交于
Clang's integrated assembler produces the warning for assembly files: warning: DWARF2 only supports one section per compilation unit If -Wa,-gdwarf-* is unspecified, then debug info is not emitted for assembly sources (it is still emitted for C sources). This will be re-enabled for newer DWARF versions in a follow up patch. Enables defconfig+CONFIG_DEBUG_INFO to build cleanly with LLVM=1 LLVM_IAS=1 for x86_64 and arm64. Cc: <stable@vger.kernel.org> Link: https://github.com/ClangBuiltLinux/linux/issues/716Reported-by: NDmitry Golovin <dima@golovin.in> Reported-by: NNathan Chancellor <natechancellor@gmail.com> Suggested-by: NDmitry Golovin <dima@golovin.in> Suggested-by: NNathan Chancellor <natechancellor@gmail.com> Suggested-by: NSedat Dilek <sedat.dilek@gmail.com> Reviewed-by: NFangrui Song <maskray@google.com> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com> Signed-off-by: NNick Desaulniers <ndesaulniers@google.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Denys Zagorui 提交于
Follow-up to commit a73619a8 ("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path"). Assembler sources also use __FILE__ macro so this flag should be also applied to those sources. Signed-off-by: NDenys Zagorui <dzagorui@cisco.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 23 11月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 16 11月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 09 11月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 02 11月, 2020 2 次提交
-
-
由 Vasily Gorbik 提交于
The "size" tool has been solely used by s390 to enforce .bss section usage restrictions in early startup code. Since commit 980d5f9a ("s390/boot: enable .bss section for compressed kernel") and commit 2e83e0eb ("s390: clean .bss before running uncompressed kernel") these restrictions have been lifted for the decompressor and uncompressed kernel and the size tool is now unused. Signed-off-by: NVasily Gorbik <gor@linux.ibm.com> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Linus Torvalds 提交于
-
- 26 10月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 20 10月, 2020 1 次提交
-
-
由 Mark Wielaard 提交于
Some old GCC versions between 4.5.0 and 4.9.1 might miscompile code with -fvar-tracking-assingments (which is enabled by default with -g -O2). Commit 2062afb4 ("Fix gcc-4.9.0 miscompilation of load_balance() in scheduler") added -fno-var-tracking-assignments unconditionally to work around this. But newer versions of GCC no longer have this bug, so only add it for versions of GCC before 5.0. This allows various tools such as a perf probe or gdb debuggers or systemtap to resolve variable locations using dwarf locations in more code. Signed-off-by: NMark Wielaard <mark@klomp.org> Acked-by: NIan Rogers <irogers@google.com> Reviewed-by: NAndi Kleen <andi@firstfloor.org> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 14 10月, 2020 1 次提交
-
-
由 Nick Desaulniers 提交于
This reverts commit 87e0d4f0. -fno-merge-all-constants has been the default since clang-6; the minimum supported version of clang in the kernel is clang-10 (10.0.1). Suggested-by: NNathan Chancellor <natechancellor@gmail.com> Signed-off-by: NNick Desaulniers <ndesaulniers@google.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Tested-by: NSedat Dilek <sedat.dilek@gmail.com> Reviewed-by: NFangrui Song <maskray@google.com> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com> Reviewed-by: NSedat Dilek <sedat.dilek@gmail.com> Reviewed-by: NKees Cook <keescook@chromium.org> Cc: Andrey Konovalov <andreyknvl@google.com> Cc: Marco Elver <elver@google.com> Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lkml.kernel.org/r/20200902225911.209899-3-ndesaulniers@google.com Link: https://reviews.llvm.org/rL329300. Link: https://github.com/ClangBuiltLinux/linux/issues/9Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 12 10月, 2020 3 次提交
-
-
由 Olaf Hering 提交于
Catch errors which at least gcc tolerates by default: warning: 'return' with no value, in function returning non-void [-Wreturn-type] Signed-off-by: NOlaf Hering <olaf@aepfle.de> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Linus Torvalds 提交于
-
由 Jacob Keller 提交于
namespace.pl is intended to help locate symbols which are defined but are not used externally. The goal is to avoid bloat of the namespace in the resulting kernel image. The script relies on object data, and only finds unused symbols for the configuration used to generate that object data. This results in a lot of false positive warnings such as symbols only used by a single architecture, or symbols which are used externally only under certain configurations. Running namespace.pl using allyesconfig, allmodconfig, and x86_64_defconfig yields the following results: * allmodconfig * 11122 unique symbol names with no external reference * 1194 symbols listed as multiply defined * 214 symbols it can't resolve * allyesconfig * 10997 unique symbol names with no external reference * 1194 symbols listed as multiply defined * 214 symbols it can't resolve * x86_64_defconfig * 5757 unique symbol names with no external reference * 528 symbols listed as multiply defined * 154 symbols it can't resolve The script also has no way to easily limit the scope of the checks to a given subset of the kernel, such as only checking for symbols defined within a module or subsystem. Discussion on public mailing lists seems to indicate that many view the tool output as suspect or not very useful (see discussions at [1] and [2] for further context). As described by Masahiro Yamada at [2], namespace.pl provides 3 types of checks: listing multiply defined symbols, resolving external symbols, and warnings about symbols with no reference. The first category of issues is easily caught by the linker as any set of multiply defined symbols should fail to link. The second category of issues is also caught by linking, as undefined symbols would cause issues. Even with modules, these types of issues where a module relies on an external symbol are caught by modpost. The remaining category of issues reported is the list of symbols with no external reference, and is the primary motivation of this script. However, it ought to be clear from the above examples that the output is difficult to sort through. Even allyesconfig has ~10000 entries. The current submit-checklist indicates that patches ought to go through namespacecheck and fix any new issues arising. But that itself presents problems. As described at [1], many cases of reports are due to configuration where a function is used externally by some configuration settings. Prominent maintainers appear to dislike changes modify code such that symbols become static based on CONFIG_* flags ([3], and [4]) One possible solution is to adjust the advice and indicate that we only care about the output of namespacecheck on allyesconfig or allmodconfig builds... However, given the discussion at [2], I suspect that few people are actively using this tool. It doesn't have a maintainer in the MAINTAINERS flie, and it produces so many warnings for unused symbols that it is difficult to use effectively. Thus, I propose we simply remove it. [1] https://lore.kernel.org/netdev/20200708164812.384ae8ea@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ [2] https://lore.kernel.org/lkml/20190129204319.15238-1-jacob.e.keller@intel.com/ [3] https://lore.kernel.org/netdev/20190828.154744.2058157956381129672.davem@davemloft.net/ [4] https://lore.kernel.org/netdev/20190827210928.576c5fef@cakuba.netronome.com/Signed-off-by: NJacob Keller <jacob.e.keller@intel.com> Acked-by: NRandy Dunlap <rdunlap@infradead.org> Acked-by: NJakub Kicinski <kuba@kernel.org> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 09 10月, 2020 1 次提交
-
-
由 Bill Wendling 提交于
ld's --build-id defaults to "sha1" style, while lld defaults to "fast". The build IDs are very different between the two, which may confuse programs that reference them. Signed-off-by: NBill Wendling <morbo@google.com> Acked-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
- 05 10月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 28 9月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 24 9月, 2020 7 次提交
-
-
由 Masahiro Yamada 提交于
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/xvjcMaSigned-off-by: NMasahiro Yamada <masahiroy@kernel.org> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com> Acked-by: NWill Deacon <will@kernel.org>
-
由 Masahiro Yamada 提交于
The minimal compiler version, GCC 4.9 supports this flag. Nathan Chancellor pointed out: "This flag is technically ignored by clang (see commit 05b0798916f01690b5903302e51f3136274e291f) but that obviously does not matter for the sake of this." Here is the godbolt: https://godbolt.org/z/59cK6oSigned-off-by: NMasahiro Yamada <masahiroy@kernel.org> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com>
-
由 Masahiro Yamada 提交于
The minimal compiler versions, GCC 4.9 and Clang 10 support this flag. Here is the godbolt: https://godbolt.org/z/odq8h9Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> Reviewed-by: NNathan Chancellor <natechancellor@gmail.com> Acked-by: NWill Deacon <will@kernel.org>
-
由 Masahiro Yamada 提交于
Move CFLAGS_KASAN*, CFLAGS_UBSAN, CFLAGS_KCSAN to Makefile.kasan, Makefile.ubsan, Makefile.kcsan, respectively. This commit also avoids the same -fsanitize=* flags being added to CFLAGS_UBSAN multiple times. Prior to this commit, the ubsan flags were appended by the '+=' operator, without any initialization. Some build targets such as 'make bindeb-pkg' recurses to the top Makefile, and ended up with adding the same flags to CFLAGS_UBSAN twice. Clear CFLAGS_UBSAN with ':=' to make it a simply expanded variable. This is better than a recursively expanded variable, which evaluates $(call cc-option, ...) multiple times before Kbuild starts descending to subdirectories. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> Acked-by: NMarco Elver <elver@google.com>
-
由 Masahiro Yamada 提交于
'make M=/path/to/your/external/module' creates a pointless built-in.a in the top of the external module directory because KBUILD_BUILTIN is set to 1. Clear KBUILD_BUILTIN when we are building external modules so that 'make M=...' and 'make M=... modules' work equivalently. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-
由 Masahiro Yamada 提交于
There was a request to preprocess the module linker script like we do for the vmlinux one. (https://lkml.org/lkml/2020/8/21/512) The difference between vmlinux.lds and module.lds is that the latter is needed for external module builds, thus must be cleaned up by 'make mrproper' instead of 'make clean'. Also, it must be created by 'make modules_prepare'. You cannot put it in arch/$(SRCARCH)/kernel/, which is cleaned up by 'make clean'. I moved arch/$(SRCARCH)/kernel/module.lds to arch/$(SRCARCH)/include/asm/module.lds.h, which is included from scripts/module.lds.S. scripts/module.lds is fine because 'make clean' keeps all the build artifacts under scripts/. You can add arch-specific sections in <asm/module.lds.h>. Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org> Tested-by: NJessica Yu <jeyu@kernel.org> Acked-by: NWill Deacon <will@kernel.org> Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org> Acked-by: NPalmer Dabbelt <palmerdabbelt@google.com> Reviewed-by: NKees Cook <keescook@chromium.org> Acked-by: NJessica Yu <jeyu@kernel.org>
-
由 Jiri Olsa 提交于
Currently all the resolve_btfids 'users' are under CONFIG_BPF code, so if we have CONFIG_BPF disabled, resolve_btfids will fail, because there's no data to resolve. Disabling resolve_btfids if there's CONFIG_BPF disabled, so we won't fail such builds. Suggested-by: NAndrii Nakryiko <andriin@fb.com> Signed-off-by: NJiri Olsa <jolsa@kernel.org> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Acked-by: NAndrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200923185735.3048198-1-jolsa@kernel.org
-
- 21 9月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 14 9月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 07 9月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 03 9月, 2020 1 次提交
-
-
由 Josh Poimboeuf 提交于
Use of the new -flive-patching flag was introduced with the following commit: 43bd3a95 ("kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled") This flag has several drawbacks: - It disables some optimizations, so it can have a negative effect on performance. - According to the GCC documentation it's not compatible with LTO, which will become a compatibility issue as LTO support gets upstreamed in the kernel. - It was intended to be used for source-based patch generation tooling, as opposed to binary-based patch generation tooling (e.g., kpatch-build). It probably should have at least been behind a separate config option so as not to negatively affect other livepatch users. - Clang doesn't have the flag, so as far as I can tell, this method of generating patches is incompatible with Clang, which like LTO is becoming more mainstream. - It breaks GCC's implicit noreturn detection for local functions. This is the cause of several "unreachable instruction" objtool warnings. - The broken noreturn detection is an obvious GCC regression, but we haven't yet gotten GCC developers to acknowledge that, which doesn't inspire confidence in their willingness to keep the feature working as optimizations are added or changed going forward. - While there *is* a distro which relies on this flag for their distro livepatch module builds, there's not a publicly documented way to create safe livepatch modules with it. Its use seems to be based on tribal knowledge. It serves no benefit to those who don't know how to use it. (In fact, I believe the current livepatch documentation and samples are misleading and dangerous, and should be corrected. Or at least amended with a disclaimer. But I don't feel qualified to make such changes.) Also, we have an idea for using objtool to detect function changes, which could potentially obsolete the need for this flag anyway. At this point the flag has no benefits for upstream which would counteract the above drawbacks. Revert it until it becomes more ready. This reverts commit 43bd3a95. Fixes: 43bd3a95 ("kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled") Reported-by: NRandy Dunlap <rdunlap@infradead.org> Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com> Acked-by: NMiroslav Benes <mbenes@suse.cz> Signed-off-by: NPetr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/696262e997359666afa053fe7d1a9fb2bb373964.1595010490.git.jpoimboe@redhat.com
-
- 31 8月, 2020 1 次提交
-
-
由 Linus Torvalds 提交于
-
- 26 8月, 2020 1 次提交
-
-
由 Nathan Huckleberry 提交于
This patch adds clang-tidy and the clang static-analyzer as make targets. The goal of this patch is to make static analysis tools usable and extendable by any developer or researcher who is familiar with basic c++. The current static analysis tools require intimate knowledge of the internal workings of the static analysis. Clang-tidy and the clang static analyzers expose an easy to use api and allow users unfamiliar with clang to write new checks with relative ease. ===Clang-tidy=== Clang-tidy is an easily extendable 'linter' that runs on the AST. Clang-tidy checks are easy to write and understand. A check consists of two parts, a matcher and a checker. The matcher is created using a domain specific language that acts on the AST (https://clang.llvm.org/docs/LibASTMatchersReference.html). When AST nodes are found by the matcher a callback is made to the checker. The checker can then execute additional checks and issue warnings. Here is an example clang-tidy check to report functions that have calls to local_irq_disable without calls to local_irq_enable and vice-versa. Functions flagged with __attribute((annotation("ignore_irq_balancing"))) are ignored for analysis. (https://reviews.llvm.org/D65828) ===Clang static analyzer=== The clang static analyzer is a more powerful static analysis tool that uses symbolic execution to find bugs. Currently there is a check that looks for potential security bugs from invalid uses of kmalloc and kfree. There are several more general purpose checks that are useful for the kernel. The clang static analyzer is well documented and designed to be extensible. (https://clang-analyzer.llvm.org/checker_dev_manual.html) (https://github.com/haoNoQ/clang-analyzer-guide/releases/download/v0.1/clang-analyzer-guide-v0.1.pdf) The main draw of the clang tools is how accessible they are. The clang documentation is very nice and these tools are built specifically to be easily extendable by any developer. They provide an accessible method of bug-finding and research to people who are not overly familiar with the kernel codebase. Signed-off-by: NNathan Huckleberry <nhuck@google.com> Reviewed-by: NNick Desaulniers <ndesaulniers@google.com> Tested-by: NNick Desaulniers <ndesaulniers@google.com> Tested-by: NLukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
-