1. 21 8月, 2022 1 次提交
    • M
      kbuild: fix the modules order between drivers and libs · 11314751
      Masahiro Yamada 提交于
      Commit b2c88554 ("kbuild: update modules.order only when contained
      modules are updated") accidentally changed the modules order.
      
      Prior to that commit, the modules order was determined based on
      vmlinux-dirs, which lists core-y/m, drivers-y/m, libs-y/m, in this order.
      
      Now, subdir-modorder lists them in a different order: core-y/m, libs-y/m,
      drivers-y/m.
      
      Presumably, there was no practical issue because the modules in drivers
      and libs are orthogonal, but there is no reason to have this distortion.
      
      Get back to the original order.
      
      Fixes: b2c88554 ("kbuild: update modules.order only when contained modules are updated")
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      11314751
  2. 15 8月, 2022 1 次提交
  3. 11 8月, 2022 1 次提交
  4. 01 8月, 2022 1 次提交
  5. 31 7月, 2022 1 次提交
  6. 27 7月, 2022 3 次提交
  7. 25 7月, 2022 2 次提交
  8. 18 7月, 2022 1 次提交
  9. 12 7月, 2022 1 次提交
  10. 11 7月, 2022 1 次提交
  11. 04 7月, 2022 1 次提交
  12. 27 6月, 2022 1 次提交
  13. 26 6月, 2022 1 次提交
  14. 20 6月, 2022 1 次提交
  15. 13 6月, 2022 1 次提交
  16. 10 6月, 2022 2 次提交
    • L
      gcc-12: disable '-Warray-bounds' universally for now · f0be87c4
      Linus Torvalds 提交于
      In commit 8b202ee2 ("s390: disable -Warray-bounds") the s390 people
      disabled the '-Warray-bounds' warning for gcc-12, because the new logic
      in gcc would cause warnings for their use of the S390_lowcore macro,
      which accesses absolute pointers.
      
      It turns out gcc-12 has many other issues in this area, so this takes
      that s390 warning disable logic, and turns it into a kernel build config
      entry instead.
      
      Part of the intent is that we can make this all much more targeted, and
      use this conflig flag to disable it in only particular configurations
      that cause problems, with the s390 case as an example:
      
              select GCC12_NO_ARRAY_BOUNDS
      
      and we could do that for other configuration cases that cause issues.
      
      Or we could possibly use the CONFIG_CC_NO_ARRAY_BOUNDS thing in a more
      targeted way, and disable the warning only for particular uses: again
      the s390 case as an example:
      
        KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)
      
      but this ends up just doing it globally in the top-level Makefile, since
      the current issues are spread fairly widely all over:
      
        KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
      
      We'll try to limit this later, since the gcc-12 problems are rare enough
      that *much* of the kernel can be built with it without disabling this
      warning.
      
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f0be87c4
    • L
      gcc-12: disable '-Wdangling-pointer' warning for now · 49beadbd
      Linus Torvalds 提交于
      While the concept of checking for dangling pointers to local variables
      at function exit is really interesting, the gcc-12 implementation is not
      compatible with reality, and results in false positives.
      
      For example, gcc sees us putting things on a local list head allocated
      on the stack, which involves exactly those kinds of pointers to the
      local stack entry:
      
        In function ‘__list_add’,
            inlined from ‘list_add_tail’ at include/linux/list.h:102:2,
            inlined from ‘rebuild_snap_realms’ at fs/ceph/snap.c:434:2:
        include/linux/list.h:74:19: warning: storing the address of local variable ‘realm_queue’ in ‘*&realm_27(D)->rebuild_item.prev’ [-Wdangling-pointer=]
           74 |         new->prev = prev;
              |         ~~~~~~~~~~^~~~~~
      
      But then gcc - understandably - doesn't really understand the big
      picture how the doubly linked list works, so doesn't see how we then end
      up emptying said list head in a loop and the pointer we added has been
      removed.
      
      Gcc also complains about us (intentionally) using this as a way to store
      a kind of fake stack trace, eg
      
        drivers/acpi/acpica/utdebug.c:40:38: warning: storing the address of local variable ‘current_sp’ in ‘acpi_gbl_entry_stack_pointer’ [-Wdangling-pointer=]
           40 |         acpi_gbl_entry_stack_pointer = &current_sp;
              |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      
      which is entirely reasonable from a compiler standpoint, and we may want
      to change those kinds of patterns, but not not.
      
      So this is one of those "it would be lovely if the compiler were to
      complain about us leaving dangling pointers to the stack", but not this
      way.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49beadbd
  17. 06 6月, 2022 1 次提交
  18. 05 6月, 2022 1 次提交
    • M
      kbuild: clean .tmp_* pattern by make clean · b0d6207b
      Masahiro Yamada 提交于
      Change the "make clean" rule to remove all the .tmp_* files.
      
      .tmp_objdiff is the only exception, which should be removed by
      "make mrproper".
      
      Rename the record directory of objdiff, .tmp_objdiff to .objdiff to
      avoid the removal by "make clean".
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM-14 (x86-64)
      b0d6207b
  19. 23 5月, 2022 1 次提交
  20. 16 5月, 2022 1 次提交
  21. 11 5月, 2022 1 次提交
  22. 09 5月, 2022 1 次提交
  23. 08 5月, 2022 5 次提交
  24. 02 5月, 2022 1 次提交
  25. 25 4月, 2022 1 次提交
  26. 22 4月, 2022 1 次提交
  27. 18 4月, 2022 1 次提交
  28. 11 4月, 2022 1 次提交
  29. 05 4月, 2022 1 次提交
  30. 04 4月, 2022 1 次提交
  31. 01 4月, 2022 1 次提交
    • N
      kbuild: Remove '-mno-global-merge' · cf300b83
      Nathan Chancellor 提交于
      This flag is specific to clang, where it is only used by the 32-bit and
      64-bit ARM backends. In certain situations, the presence of this flag
      will cause a warning, as shown by commit 6580c5c1 ("um: clang: Strip
      out -mno-global-merge from USER_CFLAGS").
      
      Since commit 61163efa ("kbuild: LLVMLinux: Add Kbuild support for
      building kernel with Clang") that added this flag back in 2014, there
      have been quite a few changes to the GlobalMerge pass in LLVM. Building
      several different ARCH=arm and ARCH=arm64 configurations with LLVM 11
      (minimum) and 15 (current main version) with this flag removed (i.e.,
      with the default of '-mglobal-merge') reveals no modpost warnings, so it
      is likely that the issue noted in the comment is no longer relevant due
      to changes in LLVM or modpost, meaning this flag can be removed.
      
      If any new warnings show up that are a result of the removal of this
      flag, it can be added back under arch/arm{,64}/Makefile to avoid
      warnings on other architectures.
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Tested-by: NDavid Gow <davidgow@google.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      Reviewed-by: NSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      cf300b83
  32. 31 3月, 2022 1 次提交
    • N
      kbuild: Make $(LLVM) more flexible · e9c28192
      Nathan Chancellor 提交于
      The LLVM make variable allows a developer to quickly switch between the
      GNU and LLVM tools. However, it does not handle versioned binaries, such
      as the ones shipped by Debian, as LLVM=1 just defines the tool variables
      with the unversioned binaries.
      
      There was some discussion during the review of the patch that introduces
      LLVM=1 around versioned binaries, ultimately coming to the conclusion
      that developers can just add the folder that contains the unversioned
      binaries to their PATH, as Debian's versioned suffixed binaries are
      really just symlinks to the unversioned binaries in /usr/lib/llvm-#/bin:
      
      $ realpath /usr/bin/clang-14
      /usr/lib/llvm-14/bin/clang
      
      $ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1
      
      However, that can be cumbersome to developers who are constantly testing
      series with different toolchains and versions. It is simple enough to
      support these versioned binaries directly in the Kbuild system by
      allowing the developer to specify the version suffix with LLVM=, which
      is shorter than the above suggestion:
      
      $ make ... LLVM=-14
      
      It does not change the meaning of LLVM=1 (which will continue to use
      unversioned binaries) and it does not add too much additional complexity
      to the existing $(LLVM) code, while allowing developers to quickly test
      their series with different versions of the whole LLVM suite of tools.
      
      Some developers may build LLVM from source but not add the binaries to
      their PATH, as they may not want to use that toolchain systemwide.
      Support those developers by allowing them to supply the directory that
      the LLVM tools are available in, as it is no more complex to support
      than the version suffix change above.
      
      $ make ... LLVM=/path/to/llvm/
      
      Update and reorder the documentation to reflect these new additions.
      At the same time, notate that LLVM=0 is not the same as just omitting it
      altogether, which has confused people in the past.
      
      Link: https://lore.kernel.org/r/20200317215515.226917-1-ndesaulniers@google.com/
      Link: https://lore.kernel.org/r/20220224151322.072632223@infradead.org/Suggested-by: NMasahiro Yamada <masahiroy@kernel.org>
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      e9c28192