Skip to content
Snippets Groups Projects
  1. Oct 06, 2024
  2. Oct 02, 2024
  3. Oct 01, 2024
  4. Sep 30, 2024
    • Masahiro Yamada's avatar
      kconfig: fix infinite loop in sym_calc_choice() · 4d46b5b6
      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: default avatarMarco Bonelli <marco@mebeim.net>
      Closes: https://lore.kernel.org/all/1763151587.3581913.1727224126288@privateemail.com/
      
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      4d46b5b6
    • Masahiro Yamada's avatar
      kbuild: move non-boot built-in DTBs to .rodata section · 7fb1d1e0
      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: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarRob Herring (Arm) <robh@kernel.org>
      7fb1d1e0
  5. Sep 28, 2024
  6. Sep 27, 2024
    • Al Viro's avatar
      [tree-wide] finally take no_llseek out · cb787f4a
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb787f4a
  7. Sep 20, 2024
  8. Sep 16, 2024
  9. Sep 14, 2024
Loading