1. 22 1月, 2021 1 次提交
    • M
      lockdep: report broken irq restoration · 997acaf6
      Mark Rutland 提交于
      We generally expect local_irq_save() and local_irq_restore() to be
      paired and sanely nested, and so local_irq_restore() expects to be
      called with irqs disabled. Thus, within local_irq_restore() we only
      trace irq flag changes when unmasking irqs.
      
      This means that a sequence such as:
      
      | local_irq_disable();
      | local_irq_save(flags);
      | local_irq_enable();
      | local_irq_restore(flags);
      
      ... is liable to break things, as the local_irq_restore() would mask
      irqs without tracing this change. Similar problems may exist for
      architectures whose arch_irq_restore() function depends on being called
      with irqs disabled.
      
      We don't consider such sequences to be a good idea, so let's define
      those as forbidden, and add tooling to detect such broken cases.
      
      This patch adds debug code to WARN() when raw_local_irq_restore() is
      called with irqs enabled. As raw_local_irq_restore() is expected to pair
      with raw_local_irq_save(), it should never be called with irqs enabled.
      
      To avoid the possibility of circular header dependencies between
      irqflags.h and bug.h, the warning is handled in a separate C file.
      
      The new code is all conditional on a new CONFIG_DEBUG_IRQFLAGS symbol
      which is independent of CONFIG_TRACE_IRQFLAGS. As noted above such cases
      will confuse lockdep, so CONFIG_DEBUG_LOCKDEP now selects
      CONFIG_DEBUG_IRQFLAGS.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20210111153707.10071-1-mark.rutland@arm.com
      997acaf6
  2. 16 12月, 2020 1 次提交
  3. 12 12月, 2020 1 次提交
  4. 02 12月, 2020 1 次提交
  5. 24 11月, 2020 2 次提交
  6. 18 11月, 2020 1 次提交
  7. 13 11月, 2020 1 次提交
  8. 11 11月, 2020 1 次提交
    • A
      kbuild: Build kernel module BTFs if BTF is enabled and pahole supports it · 5f9ae91f
      Andrii Nakryiko 提交于
      Detect if pahole supports split BTF generation, and generate BTF for each
      selected kernel module, if it does. This is exposed to Makefiles and C code as
      CONFIG_DEBUG_INFO_BTF_MODULES flag.
      
      Kernel module BTF has to be re-generated if either vmlinux's BTF changes or
      module's .ko changes. To achieve that, I needed a helper similar to
      if_changed, but that would allow to filter out vmlinux from the list of
      updated dependencies for .ko building. I've put it next to the only place that
      uses and needs it, but it might be a better idea to just add it along the
      other if_changed variants into scripts/Kbuild.include.
      
      Each kernel module's BTF deduplication is pretty fast, as it does only
      incremental BTF deduplication on top of already deduplicated vmlinux BTF. To
      show the added build time, I've first ran make only just built kernel (to
      establish the baseline) and then forced only BTF re-generation, without
      regenerating .ko files. The build was performed with -j60 parallelization on
      56-core machine. The final time also includes bzImage building, so it's not
      a pure BTF overhead.
      
      $ time make -j60
      ...
      make -j60  27.65s user 10.96s system 782% cpu 4.933 total
      $ touch ~/linux-build/default/vmlinux && time make -j60
      ...
      make -j60  123.69s user 27.85s system 1566% cpu 9.675 total
      
      So 4.6 seconds real time, with noticeable part spent in compressed vmlinux and
      bzImage building.
      
      To show size savings, I've built my kernel configuration with about 700 kernel
      modules with full BTF per each kernel module (without deduplicating against
      vmlinux) and with split BTF against deduplicated vmlinux (approach in this
      patch). Below are top 10 modules with biggest BTF sizes. And total size of BTF
      data across all kernel modules.
      
      It shows that split BTF "compresses" 115MB down to 5MB total. And the biggest
      kernel modules get a downsize from 500-570KB down to 200-300KB.
      
      FULL BTF
      ========
      
      $ for f in $(find . -name '*.ko'); do size -A -d $f | grep BTF | awk '{print $2}'; done | awk '{ s += $1 } END { print s }'
      115710691
      
      $ for f in $(find . -name '*.ko'); do printf "%s %d\n" $f $(size -A -d $f | grep BTF | awk '{print $2}'); done | sort -nr -k2 | head -n10
      ./drivers/gpu/drm/i915/i915.ko 570570
      ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko 520240
      ./drivers/gpu/drm/radeon/radeon.ko 503849
      ./drivers/infiniband/hw/mlx5/mlx5_ib.ko 491777
      ./fs/xfs/xfs.ko 411544
      ./drivers/net/ethernet/intel/i40e/i40e.ko 403904
      ./drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko 398754
      ./drivers/infiniband/core/ib_core.ko 397224
      ./fs/cifs/cifs.ko 386249
      ./fs/nfsd/nfsd.ko 379738
      
      SPLIT BTF
      =========
      
      $ for f in $(find . -name '*.ko'); do size -A -d $f | grep BTF | awk '{print $2}'; done | awk '{ s += $1 } END { print s }'
      5194047
      
      $ for f in $(find . -name '*.ko'); do printf "%s %d\n" $f $(size -A -d $f | grep BTF | awk '{print $2}'); done | sort -nr -k2 | head -n10
      ./drivers/gpu/drm/i915/i915.ko 293206
      ./drivers/gpu/drm/radeon/radeon.ko 282103
      ./fs/xfs/xfs.ko 222150
      ./drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko 198503
      ./drivers/infiniband/hw/mlx5/mlx5_ib.ko 198356
      ./drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko 113444
      ./fs/cifs/cifs.ko 109379
      ./arch/x86/kvm/kvm.ko 100225
      ./drivers/gpu/drm/drm.ko 94827
      ./drivers/infiniband/core/ib_core.ko 91188
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20201110011932.3201430-4-andrii@kernel.org
      5f9ae91f
  9. 03 11月, 2020 1 次提交
    • A
      net: add kcov handle to skb extensions · 6370cc3b
      Aleksandr Nogikh 提交于
      Remote KCOV coverage collection enables coverage-guided fuzzing of the
      code that is not reachable during normal system call execution. It is
      especially helpful for fuzzing networking subsystems, where it is
      common to perform packet handling in separate work queues even for the
      packets that originated directly from the user space.
      
      Enable coverage-guided frame injection by adding kcov remote handle to
      skb extensions. Default initialization in __alloc_skb and
      __build_skb_around ensures that no socket buffer that was generated
      during a system call will be missed.
      
      Code that is of interest and that performs packet processing should be
      annotated with kcov_remote_start()/kcov_remote_stop().
      
      An alternative approach is to determine kcov_handle solely on the
      basis of the device/interface that received the specific socket
      buffer. However, in this case it would be impossible to distinguish
      between packets that originated during normal background network
      processes or were intentionally injected from the user space.
      Signed-off-by: NAleksandr Nogikh <nogikh@google.com>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      6370cc3b
  10. 30 10月, 2020 1 次提交
  11. 17 10月, 2020 1 次提交
  12. 14 10月, 2020 2 次提交
  13. 20 9月, 2020 1 次提交
  14. 05 9月, 2020 1 次提交
  15. 26 8月, 2020 1 次提交
  16. 25 8月, 2020 1 次提交
  17. 13 8月, 2020 5 次提交
  18. 29 7月, 2020 1 次提交
  19. 27 7月, 2020 1 次提交
    • P
      locking/lockdep: Fix TRACE_IRQFLAGS vs. NMIs · ed004953
      peterz@infradead.org 提交于
      Prior to commit:
      
        859d069e ("lockdep: Prepare for NMI IRQ state tracking")
      
      IRQ state tracking was disabled in NMIs due to nmi_enter()
      doing lockdep_off() -- with the obvious requirement that NMI entry
      call nmi_enter() before trace_hardirqs_off().
      
      [ AFAICT, PowerPC and SH violate this order on their NMI entry ]
      
      However, that commit explicitly changed lockdep_hardirqs_*() to ignore
      lockdep_off() and breaks every architecture that has irq-tracing in
      it's NMI entry that hasn't been fixed up (x86 being the only fixed one
      at this point).
      
      The reason for this change is that by ignoring lockdep_off() we can:
      
        - get rid of 'current->lockdep_recursion' in lockdep_assert_irqs*()
          which was going to to give header-recursion issues with the
          seqlock rework.
      
        - allow these lockdep_assert_*() macros to function in NMI context.
      
      Restore the previous state of things and allow an architecture to
      opt-in to the NMI IRQ tracking support, however instead of relying on
      lockdep_off(), rely on in_nmi(), both are part of nmi_enter() and so
      over-all entry ordering doesn't need to change.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20200727124852.GK119549@hirez.programming.kicks-ass.net
      ed004953
  20. 23 7月, 2020 1 次提交
    • P
      debugfs: Add access restriction option · a24c6f7b
      Peter Enderborg 提交于
      Since debugfs include sensitive information it need to be treated
      carefully. But it also has many very useful debug functions for userspace.
      With this option we can have same configuration for system with
      need of debugfs and a way to turn it off. This gives a extra protection
      for exposure on systems where user-space services with system
      access are attacked.
      
      It is controlled by a configurable default value that can be override
      with a kernel command line parameter. (debugfs=)
      
      It can be on or off, but also internally on but not seen from user-space.
      This no-mount mode do not register a debugfs as filesystem, but client can
      register their parts in the internal structures. This data can be readed
      with a debugger or saved with a crashkernel. When it is off clients
      get EPERM error when accessing the functions for registering their
      components.
      Signed-off-by: NPeter Enderborg <peter.enderborg@sony.com>
      Link: https://lore.kernel.org/r/20200716071511.26864-3-peter.enderborg@sony.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a24c6f7b
  21. 03 7月, 2020 1 次提交
  22. 29 6月, 2020 1 次提交
    • P
      selftests/fpu: Add an FPU selftest · 4185b3b9
      Petteri Aimonen 提交于
      Add a selftest for the usage of FPU code in kernel mode.
      
      Currently only implemented for x86. In the future, kernel FPU testing
      could be unified between the different architectures supporting it.
      
       [ bp:
      
        - Split out from a conglomerate patch, put comments over statements.
        - run the test only on debugfs write.
        - Add bare-minimum run_test_fpu.sh, run 1000 iterations on all CPUs
          by default.
        - Add conditionally -msse2 so that clang doesn't generate library
          calls.
        - Use cc-option to detect gcc 7.1 not supporting -mpreferred-stack-boundary=3 (amluto).
        - Document stuff so that we don't forget.
        - Fix:
           ld: lib/test_fpu.o: in function `test_fpu_get':
           >> test_fpu.c:(.text+0x16e): undefined reference to `__sanitizer_cov_trace_cmpd'
           >> ld: test_fpu.c:(.text+0x1a7): undefined reference to `__sanitizer_cov_trace_cmpd'
           ld: test_fpu.c:(.text+0x1e0): undefined reference to `__sanitizer_cov_trace_cmpd'
        ]
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NPetteri Aimonen <jpa@git.mail.kapsi.fi>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Link: https://lkml.kernel.org/r/20200624114646.28953-3-bp@alien8.de
      4185b3b9
  23. 17 6月, 2020 1 次提交
    • M
      kconfig: unify cc-option and as-option · 4d0831e8
      Masahiro Yamada 提交于
      cc-option and as-option are almost the same; both pass the flag to
      $(CC). The main difference is the cc-option stops before the assemble
      stage (-S option) whereas as-option stops after (-c option).
      
      I chose -S because it is slightly faster, but $(cc-option,-gz=zlib)
      returns a wrong result (https://lkml.org/lkml/2020/6/9/1529).
      It has been fixed by commit 7b169944 ("Makefile: Improve compressed
      debug info support detection"), but the assembler should always be
      invoked for more reliable compiler option tests.
      
      However, you cannot simply replace -S with -c because the following
      code in lib/Kconfig.debug would break:
      
          depends on $(cc-option,-gsplit-dwarf)
      
      The combination of -c and -gsplit-dwarf does not accept /dev/null as
      output.
      
        $ cat /dev/null | gcc -gsplit-dwarf -S -x c - -o /dev/null
        $ echo $?
        0
      
        $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o /dev/null
        objcopy: Warning: '/dev/null' is not an ordinary file
        $ echo $?
        1
      
        $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o tmp.o
        $ echo $?
        0
      
      There is another flag that creates an separate file based on the
      object file path:
      
        $ cat /dev/null | gcc -ftest-coverage -c -x c - -o /dev/null
        <stdin>:1: error: cannot open /dev/null.gcno
      
      So, we cannot use /dev/null to sink the output.
      
      Align the cc-option implementation with scripts/Kbuild.include.
      
      With -c option used in cc-option, as-option is unneeded.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: NWill Deacon <will@kernel.org>
      4d0831e8
  24. 15 6月, 2020 1 次提交
    • A
      Makefile: Improve compressed debug info support detection · 7b169944
      Arvind Sankar 提交于
      Commit
        10e68b02 ("Makefile: support compressed debug info")
      added support for compressed debug sections.
      
      Support is detected by checking
      - does the compiler support -gz=zlib
      - does the assembler support --compressed-debug-sections=zlib
      - does the linker support --compressed-debug-sections=zlib
      
      However, the gcc driver's support for this option is somewhat
      convoluted. The driver's builtin specs are set based on the version of
      binutils that it was configured with. It reports an error if the
      configure-time linker/assembler (i.e., not necessarily the actual
      assembler that will be run) do not support the option, but only if the
      assembler (or linker) is actually invoked when -gz=zlib is passed.
      
      The cc-option check in scripts/Kconfig.include does not invoke the
      assembler, so the gcc driver reports success even if it does not support
      the option being passed to the assembler.
      
      Because the as-option check passes the option directly to the assembler
      via -Wa,--compressed-debug-sections=zlib, the gcc driver does not see
      this option and will never report an error.
      
      Combined with an installed version of binutils that is more recent than
      the one the compiler was built with, it is possible for all three tests
      to succeed, yet an actual compilation with -gz=zlib to fail.
      
      Moreover, it is unnecessary to explicitly pass
      --compressed-debug-sections=zlib to the assembler via -Wa, since the
      driver will do that automatically when it supports -gz=zlib.
      
      Convert the as-option to just -gz=zlib, simplifying it as well as
      performing a better test of the gcc driver's capabilities.
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NArvind Sankar <nivedita@alum.mit.edu>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      7b169944
  25. 14 6月, 2020 1 次提交
    • M
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada 提交于
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  26. 11 6月, 2020 1 次提交
  27. 09 6月, 2020 1 次提交
  28. 05 6月, 2020 3 次提交
    • J
      lib: make a test module with set/clear bit · c348c163
      Jesse Brandeburg 提交于
      Test some bit clears/sets to make sure assembly doesn't change, and that
      the set_bit and clear_bit functions work and don't cause sparse warnings.
      
      Instruct Kbuild to build this file with extra warning level -Wextra, to
      catch new issues, and also doesn't hurt to build with C=1.
      
      This was used to test changes to arch/x86/include/asm/bitops.h.
      
      In particular, sparse (C=1) was very concerned when the last bit before a
      natural boundary, like 7, or 31, was being tested, as this causes sign
      extension (0xffffff7f) for instance when clearing bit 7.
      
      Recommended usage:
      
        make defconfig
        scripts/config -m CONFIG_TEST_BITOPS
        make modules_prepare
        make C=1 W=1 lib/test_bitops.ko
        objdump -S -d lib/test_bitops.ko
        insmod lib/test_bitops.ko
        rmmod lib/test_bitops.ko
      
      <check dmesg>, there should be no compiler/sparse warnings and no
      error messages in log.
      
      Link: http://lkml.kernel.org/r/20200310221747.2848474-2-jesse.brandeburg@intel.comSigned-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      CcL Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wei Yang <richard.weiyang@gmail.com>
      Cc: Christian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c348c163
    • A
      mm/debug: add tests validating architecture page table helpers · 399145f9
      Anshuman Khandual 提交于
      This adds tests which will validate architecture page table helpers and
      other accessors in their compliance with expected generic MM semantics.
      This will help various architectures in validating changes to existing
      page table helpers or addition of new ones.
      
      This test covers basic page table entry transformations including but not
      limited to old, young, dirty, clean, write, write protect etc at various
      level along with populating intermediate entries with next page table page
      and validating them.
      
      Test page table pages are allocated from system memory with required size
      and alignments.  The mapped pfns at page table levels are derived from a
      real pfn representing a valid kernel text symbol.  This test gets called
      via late_initcall().
      
      This test gets built and run when CONFIG_DEBUG_VM_PGTABLE is selected.
      Any architecture, which is willing to subscribe this test will need to
      select ARCH_HAS_DEBUG_VM_PGTABLE.  For now this is limited to arc, arm64,
      x86, s390 and powerpc platforms where the test is known to build and run
      successfully Going forward, other architectures too can subscribe the test
      after fixing any build or runtime problems with their page table helpers.
      
      Folks interested in making sure that a given platform's page table helpers
      conform to expected generic MM semantics should enable the above config
      which will just trigger this test during boot.  Any non conformity here
      will be reported as an warning which would need to be fixed.  This test
      will help catch any changes to the agreed upon semantics expected from
      generic MM and enable platforms to accommodate it thereafter.
      
      [anshuman.khandual@arm.com: v17]
        Link: http://lkml.kernel.org/r/1587436495-22033-3-git-send-email-anshuman.khandual@arm.com
      [anshuman.khandual@arm.com: v18]
        Link: http://lkml.kernel.org/r/1588564865-31160-3-git-send-email-anshuman.khandual@arm.comSuggested-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NAnshuman Khandual <anshuman.khandual@arm.com>
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NQian Cai <cai@lca.pw>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Tested-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>	[s390]
      Tested-by: Christophe Leroy <christophe.leroy@c-s.fr>	[ppc32]
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Link: http://lkml.kernel.org/r/1583919272-24178-1-git-send-email-anshuman.khandual@arm.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      399145f9
    • A
      kcov: collect coverage from interrupts · 5ff3b30a
      Andrey Konovalov 提交于
      This change extends kcov remote coverage support to allow collecting
      coverage from soft interrupts in addition to kernel background threads.
      
      To collect coverage from code that is executed in softirq context, a part
      of that code has to be annotated with kcov_remote_start/stop() in a
      similar way as how it is done for global kernel background threads.  Then
      the handle used for the annotations has to be passed to the
      KCOV_REMOTE_ENABLE ioctl.
      
      Internally this patch adjusts the __sanitizer_cov_trace_pc() compiler
      inserted callback to not bail out when called from softirq context.
      kcov_remote_start/stop() are updated to save/restore the current per task
      kcov state in a per-cpu area (in case the softirq came when the kernel was
      already collecting coverage in task context).  Coverage from softirqs is
      collected into pre-allocated per-cpu areas, whose size is controlled by
      the new CONFIG_KCOV_IRQ_AREA_SIZE.
      
      [andreyknvl@google.com: turn current->kcov_softirq into unsigned int to fix objtool warning]
        Link: http://lkml.kernel.org/r/841c778aa3849c5cb8c3761f56b87ce653a88671.1585233617.git.andreyknvl@google.comSigned-off-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Marco Elver <elver@google.com>
      Link: http://lkml.kernel.org/r/469bd385c431d050bc38a593296eff4baae50666.1584655448.git.andreyknvl@google.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5ff3b30a
  29. 02 6月, 2020 1 次提交
  30. 29 5月, 2020 1 次提交
    • N
      Makefile: support compressed debug info · 10e68b02
      Nick Desaulniers 提交于
      As debug information gets larger and larger, it helps significantly save
      the size of vmlinux images to compress the information in the debug
      information sections. Note: this debug info is typically split off from
      the final compressed kernel image, which is why vmlinux is what's used
      in conjunction with GDB. Minimizing the debug info size should have no
      impact on boot times, or final compressed kernel image size.
      
      All of the debug sections will have a `C` flag set.
      $ readelf -S <object file>
      
      $ bloaty vmlinux.gcc75.compressed.dwarf4 -- \
          vmlinux.gcc75.uncompressed.dwarf4
      
          FILE SIZE        VM SIZE
       --------------  --------------
        +0.0%     +18  [ = ]       0    [Unmapped]
       -73.3%  -114Ki  [ = ]       0    .debug_aranges
       -76.2% -2.01Mi  [ = ]       0    .debug_frame
       -73.6% -2.89Mi  [ = ]       0    .debug_str
       -80.7% -4.66Mi  [ = ]       0    .debug_abbrev
       -82.9% -4.88Mi  [ = ]       0    .debug_ranges
       -70.5% -9.04Mi  [ = ]       0    .debug_line
       -79.3% -10.9Mi  [ = ]       0    .debug_loc
       -39.5% -88.6Mi  [ = ]       0    .debug_info
       -18.2%  -123Mi  [ = ]       0    TOTAL
      
      $ bloaty vmlinux.clang11.compressed.dwarf4 -- \
          vmlinux.clang11.uncompressed.dwarf4
      
          FILE SIZE        VM SIZE
       --------------  --------------
        +0.0%     +23  [ = ]       0    [Unmapped]
       -65.6%    -871  [ = ]       0    .debug_aranges
       -77.4% -1.84Mi  [ = ]       0    .debug_frame
       -82.9% -2.33Mi  [ = ]       0    .debug_abbrev
       -73.1% -2.43Mi  [ = ]       0    .debug_str
       -84.8% -3.07Mi  [ = ]       0    .debug_ranges
       -65.9% -8.62Mi  [ = ]       0    .debug_line
       -86.2% -40.0Mi  [ = ]       0    .debug_loc
       -42.0% -64.1Mi  [ = ]       0    .debug_info
       -22.1%  -122Mi  [ = ]       0    TOTAL
      
      For x86_64 defconfig + LLVM=1 (before):
      Elapsed (wall clock) time (h:mm:ss or m:ss): 3:22.03
      Maximum resident set size (kbytes): 43856
      
      For x86_64 defconfig + LLVM=1 (after):
      Elapsed (wall clock) time (h:mm:ss or m:ss): 3:32.52
      Maximum resident set size (kbytes): 1566776
      
      Thanks to:
      Nick Clifton helped us to provide the minimal binutils version.
      Sedat Dilek found an increase in size of debug .deb package.
      
      Cc: Nick Clifton <nickc@redhat.com>
      Suggested-by: NDavid Blaikie <blaikie@google.com>
      Reviewed-by: NFangrui Song <maskray@google.com>
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      10e68b02
  31. 20 5月, 2020 1 次提交
  32. 16 5月, 2020 1 次提交