Skip to content
Snippets Groups Projects
  1. Apr 26, 2022
    • Masami Hiramatsu's avatar
      bootconfig: Support embedding a bootconfig file in kernel · a2a9d67a
      Masami Hiramatsu authored
      This allows kernel developer to embed a default bootconfig file in
      the kernel instead of embedding it in the initrd. This will be good
      for who are using the kernel without initrd, or who needs a default
      bootconfigs.
      This needs to set two kconfigs: CONFIG_BOOT_CONFIG_EMBED=y and set
      the file path to CONFIG_BOOT_CONFIG_EMBED_FILE.
      
      Note that you still need 'bootconfig' command line option to load the
      embedded bootconfig. Also if you boot using an initrd with a different
      bootconfig, the kernel will use the bootconfig in the initrd, instead
      of the default bootconfig.
      
      Link: https://lkml.kernel.org/r/164921227943.1090670.14035119557571329218.stgit@devnote2
      
      
      
      Cc: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      a2a9d67a
  2. Nov 06, 2021
  3. Oct 27, 2021
  4. Oct 26, 2021
  5. Oct 11, 2021
  6. Sep 14, 2021
    • Linus Torvalds's avatar
      memblock: introduce saner 'memblock_free_ptr()' interface · 77e02cf5
      Linus Torvalds authored
      The boot-time allocation interface for memblock is a mess, with
      'memblock_alloc()' returning a virtual pointer, but then you are
      supposed to free it with 'memblock_free()' that takes a _physical_
      address.
      
      Not only is that all kinds of strange and illogical, but it actually
      causes bugs, when people then use it like a normal allocation function,
      and it fails spectacularly on a NULL pointer:
      
         https://lore.kernel.org/all/20210912140820.GD25450@xsang-OptiPlex-9020/
      
      or just random memory corruption if the debug checks don't catch it:
      
         https://lore.kernel.org/all/61ab2d0c-3313-aaab-514c-e15b7aa054a0@suse.cz/
      
      
      
      I really don't want to apply patches that treat the symptoms, when the
      fundamental cause is this horribly confusing interface.
      
      I started out looking at just automating a sane replacement sequence,
      but because of this mix or virtual and physical addresses, and because
      people have used the "__pa()" macro that can take either a regular
      kernel pointer, or just the raw "unsigned long" address, it's all quite
      messy.
      
      So this just introduces a new saner interface for freeing a virtual
      address that was allocated using 'memblock_alloc()', and that was kept
      as a regular kernel pointer.  And then it converts a couple of users
      that are obvious and easy to test, including the 'xbc_nodes' case in
      lib/bootconfig.c that caused problems.
      
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Fixes: 40caa127 ("init: bootconfig: Remove all bootconfig data when the init memory is removed")
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      77e02cf5
  7. Sep 09, 2021
  8. Jun 10, 2021
  9. Nov 18, 2020
  10. Sep 22, 2020
  11. Aug 24, 2020
    • Gustavo A. R. Silva's avatar
      lib: Revert use of fallthrough pseudo-keyword in lib/ · 6a9dc5fd
      Gustavo A. R. Silva authored
      
      The following build error for powerpc64 was reported by Nathan Chancellor:
      
        "$ scripts/config --file arch/powerpc/configs/powernv_defconfig -e KERNEL_XZ
      
         $ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- distclean powernv_defconfig zImage
         ...
         In file included from arch/powerpc/boot/../../../lib/decompress_unxz.c:234,
                          from arch/powerpc/boot/decompress.c:38:
         arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c: In function 'dec_main':
         arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c:586:4: error: 'fallthrough' undeclared (first use in this function)
           586 |    fallthrough;
               |    ^~~~~~~~~~~
      
         This will end up affecting distribution configurations such as Debian
         and OpenSUSE according to my testing. I am not sure what the solution
         is, the PowerPC wrapper does not set -D__KERNEL__ so I am not sure
         that compiler_attributes.h can be safely included."
      
      In order to avoid these sort of problems, it seems that the best
      solution is to use /* fall through */ comments instead of the
      fallthrough pseudo-keyword macro in lib/, for now.
      
      Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Fixes: df561f66 ("treewide: Use fallthrough pseudo-keyword")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-and-tested-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6a9dc5fd
  12. Aug 23, 2020
  13. Aug 03, 2020
  14. Mar 03, 2020
  15. Feb 21, 2020
  16. Feb 20, 2020
  17. Feb 10, 2020
  18. Feb 05, 2020
  19. Jan 13, 2020
Loading