<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/objtool, branch for-next</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=for-next</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=for-next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-12-29T18:07:40Z</updated>
<entry>
<title>Merge tag 'objtool-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2024-12-29T18:07:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-12-29T18:07:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bcfac5530a7880c762fd4fe6c86e3c79710fa454'/>
<id>urn:sha1:bcfac5530a7880c762fd4fe6c86e3c79710fa454</id>
<content type='text'>
Pull objtool fix from Ingo Molnar:
 "Fix false positive objtool build warning related to a noreturn
  function in the bcachefs code"

* tag 'objtool-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool: Add bch2_trans_unlocked_error() to bcachefs noreturns
</content>
</entry>
<entry>
<title>objtool: Add bch2_trans_unlocked_error() to bcachefs noreturns</title>
<updated>2024-12-29T08:52:21Z</updated>
<author>
<name>chenchangcheng</name>
<email>ccc194101@163.com</email>
</author>
<published>2024-12-20T07:48:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=31ad36a271290648e7c2288a03d7b933d20254d6'/>
<id>urn:sha1:31ad36a271290648e7c2288a03d7b933d20254d6</id>
<content type='text'>
Fix the following objtool warning during build time:

    fs/bcachefs/btree_trans_commit.o: warning: objtool: bch2_trans_commit_write_locked.isra.0() falls through to next function do_bch2_trans_commit.isra.0()
    fs/bcachefs/btree_trans_commit.o: warning: objtool: .text: unexpected end of section
......
    fs/bcachefs/btree_update.o: warning: objtool: bch2_trans_update_get_key_cache() falls through to next function flush_new_cached_update()
    fs/bcachefs/btree_update.o: warning: objtool: flush_new_cached_update() falls through to next function bch2_trans_update_by_path()

bch2_trans_unlocked_error() is an Obviously Correct (tm) panic() wrapper,
add it to the list of known noreturns.

[ mingo: Improved the changelog ]

Fixes: fd104e2967b7 ("bcachefs: bch2_trans_verify_not_unlocked()")
Signed-off-by: chenchangcheng &lt;chenchangcheng@kylinos.cn&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Link: https://lkml.kernel.org/r/20241220074847.3418134-1-ccc194101@163.com
</content>
</entry>
<entry>
<title>objtool/x86: allow syscall instruction</title>
<updated>2024-12-13T08:28:21Z</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2024-11-29T14:47:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dda014ba59331dee4f3b773a020e109932f4bd24'/>
<id>urn:sha1:dda014ba59331dee4f3b773a020e109932f4bd24</id>
<content type='text'>
The syscall instruction is used in Xen PV mode for doing hypercalls.
Allow syscall to be used in the kernel in case it is tagged with an
unwind hint for objtool.

This is part of XSA-466 / CVE-2024-53241.

Reported-by: Andrew Cooper &lt;andrew.cooper3@citrix.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Co-developed-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kbuild-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild</title>
<updated>2024-11-30T21:41:50Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-30T21:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a34dfa15d6edf7e78b8118d862d2db0889cf669'/>
<id>urn:sha1:6a34dfa15d6edf7e78b8118d862d2db0889cf669</id>
<content type='text'>
Pull Kbuild updates from Masahiro Yamada:

 - Add generic support for built-in boot DTB files

 - Enable TAB cycling for dialog buttons in nconfig

 - Fix issues in streamline_config.pl

 - Refactor Kconfig

 - Add support for Clang's AutoFDO (Automatic Feedback-Directed
   Optimization)

 - Add support for Clang's Propeller, a profile-guided optimization.

 - Change the working directory to the external module directory for M=
   builds

 - Support building external modules in a separate output directory

 - Enable objtool for *.mod.o and additional kernel objects

 - Use lz4 instead of deprecated lz4c

 - Work around a performance issue with "git describe"

 - Refactor modpost

* tag 'kbuild-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (85 commits)
  kbuild: rename .tmp_vmlinux.kallsyms0.syms to .tmp_vmlinux0.syms
  gitignore: Don't ignore 'tags' directory
  kbuild: add dependency from vmlinux to resolve_btfids
  modpost: replace tdb_hash() with hash_str()
  kbuild: deb-pkg: add python3:native to build dependency
  genksyms: reduce indentation in export_symbol()
  modpost: improve error messages in device_id_check()
  modpost: rename alias symbol for MODULE_DEVICE_TABLE()
  modpost: rename variables in handle_moddevtable()
  modpost: move strstarts() to modpost.h
  modpost: convert do_usb_table() to a generic handler
  modpost: convert do_of_table() to a generic handler
  modpost: convert do_pnp_device_entry() to a generic handler
  modpost: convert do_pnp_card_entries() to a generic handler
  modpost: call module_alias_printf() from all do_*_entry() functions
  modpost: pass (struct module *) to do_*_entry() functions
  modpost: remove DEF_FIELD_ADDR_VAR() macro
  modpost: deduplicate MODULE_ALIAS() for all drivers
  modpost: introduce module_alias_printf() helper
  modpost: remove unnecessary check in do_acpi_entry()
  ...
</content>
</entry>
<entry>
<title>kbuild: Add Propeller configuration for kernel build</title>
<updated>2024-11-27T00:38:27Z</updated>
<author>
<name>Rong Xu</name>
<email>xur@google.com</email>
</author>
<published>2024-11-02T17:51:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5dc95836147f2e25b134c0ca3a0bc1a5867ea29'/>
<id>urn:sha1:d5dc95836147f2e25b134c0ca3a0bc1a5867ea29</id>
<content type='text'>
Add the build support for using Clang's Propeller optimizer. Like
AutoFDO, Propeller uses hardware sampling to gather information
about the frequency of execution of different code paths within a
binary. This information is then used to guide the compiler's
optimization decisions, resulting in a more efficient binary.

The support requires a Clang compiler LLVM 19 or later, and the
create_llvm_prof tool
(https://github.com/google/autofdo/releases/tag/v0.30.1). This
commit is limited to x86 platforms that support PMU features
like LBR on Intel machines and AMD Zen3 BRS.

Here is an example workflow for building an AutoFDO+Propeller
optimized kernel:

1) Build the kernel on the host machine, with AutoFDO and Propeller
   build config
      CONFIG_AUTOFDO_CLANG=y
      CONFIG_PROPELLER_CLANG=y
   then
      $ make LLVM=1 CLANG_AUTOFDO_PROFILE=&lt;autofdo_profile&gt;

“&lt;autofdo_profile&gt;” is the profile collected when doing a non-Propeller
AutoFDO build. This step builds a kernel that has the same optimization
level as AutoFDO, plus a metadata section that records basic block
information. This kernel image runs as fast as an AutoFDO optimized
kernel.

2) Install the kernel on test/production machines.

3) Run the load tests. The '-c' option in perf specifies the sample
   event period. We suggest using a suitable prime number,
   like 500009, for this purpose.
   For Intel platforms:
      $ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c &lt;count&gt; \
        -o &lt;perf_file&gt; -- &lt;loadtest&gt;
   For AMD platforms:
      The supported system are: Zen3 with BRS, or Zen4 with amd_lbr_v2
      # To see if Zen3 support LBR:
      $ cat proc/cpuinfo | grep " brs"
      # To see if Zen4 support LBR:
      $ cat proc/cpuinfo | grep amd_lbr_v2
      # If the result is yes, then collect the profile using:
      $ perf record --pfm-events RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a \
        -N -b -c &lt;count&gt; -o &lt;perf_file&gt; -- &lt;loadtest&gt;

4) (Optional) Download the raw perf file to the host machine.

5) Generate Propeller profile:
   $ create_llvm_prof --binary=&lt;vmlinux&gt; --profile=&lt;perf_file&gt; \
     --format=propeller --propeller_output_module_name \
     --out=&lt;propeller_profile_prefix&gt;_cc_profile.txt \
     --propeller_symorder=&lt;propeller_profile_prefix&gt;_ld_profile.txt

   “create_llvm_prof” is the profile conversion tool, and a prebuilt
   binary for linux can be found on
   https://github.com/google/autofdo/releases/tag/v0.30.1 (can also build
   from source).

   "&lt;propeller_profile_prefix&gt;" can be something like
   "/home/user/dir/any_string".

   This command generates a pair of Propeller profiles:
   "&lt;propeller_profile_prefix&gt;_cc_profile.txt" and
   "&lt;propeller_profile_prefix&gt;_ld_profile.txt".

6) Rebuild the kernel using the AutoFDO and Propeller profile files.
      CONFIG_AUTOFDO_CLANG=y
      CONFIG_PROPELLER_CLANG=y
   and
      $ make LLVM=1 CLANG_AUTOFDO_PROFILE=&lt;autofdo_profile&gt; \
        CLANG_PROPELLER_PROFILE_PREFIX=&lt;propeller_profile_prefix&gt;

Co-developed-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Rong Xu &lt;xur@google.com&gt;
Suggested-by: Sriraman Tallam &lt;tmsriram@google.com&gt;
Suggested-by: Krzysztof Pszeniczny &lt;kpszeniczny@google.com&gt;
Suggested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Suggested-by: Stephane Eranian &lt;eranian@google.com&gt;
Tested-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'reiserfs_delete' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs</title>
<updated>2024-11-21T17:50:18Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-21T17:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c01f664e4ca210823b7594b50669bbd9b0a3c3b0'/>
<id>urn:sha1:c01f664e4ca210823b7594b50669bbd9b0a3c3b0</id>
<content type='text'>
Pull reiserfs removal from Jan Kara:
 "The deprecation period of reiserfs is ending at the end of this year
  so it is time to remove it"

* tag 'reiserfs_delete' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  reiserfs: The last commit
</content>
</entry>
<entry>
<title>objtool: Exclude __tracepoints data from ENDBR checks</title>
<updated>2024-11-11T10:49:42Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2024-11-08T09:32:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5173f7537505315557d8580e3a648f07f17deda'/>
<id>urn:sha1:d5173f7537505315557d8580e3a648f07f17deda</id>
<content type='text'>
For some, as of yet unexplained reason, Clang-19, but not GCC,
generates and endless stream of:

drivers/iio/imu/bno055/bno055_ser.o: warning: objtool: __tracepoint_send_chunk+0x20: data relocation to !ENDBR: __SCT__tp_func_send_chunk+0x0
drivers/iio/imu/bno055/bno055_ser.o: warning: objtool: __tracepoint_cmd_retry+0x20: data relocation to !ENDBR: __SCT__tp_func_cmd_retry+0x0
drivers/iio/imu/bno055/bno055_ser.o: warning: objtool: __tracepoint_write_reg+0x20: data relocation to !ENDBR: __SCT__tp_func_write_reg+0x0
drivers/iio/imu/bno055/bno055_ser.o: warning: objtool: __tracepoint_read_reg+0x20: data relocation to !ENDBR: __SCT__tp_func_read_reg+0x0
drivers/iio/imu/bno055/bno055_ser.o: warning: objtool: __tracepoint_recv+0x20: data relocation to !ENDBR: __SCT__tp_func_recv+0x0

Which is entirely correct, but harmless. Add the __tracepoints section
to the exclusion list.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20241108184618.GG38786@noisy.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>objtool: Fix unreachable instruction warnings for weak functions</title>
<updated>2024-11-06T13:41:10Z</updated>
<author>
<name>Rong Xu</name>
<email>xur@google.com</email>
</author>
<published>2024-11-02T17:51:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18e885099f1c52755f054202525cb60d3edcda44'/>
<id>urn:sha1:18e885099f1c52755f054202525cb60d3edcda44</id>
<content type='text'>
In the presence of both weak and strong function definitions, the
linker drops the weak symbol in favor of a strong symbol, but
leaves the code in place. Code in ignore_unreachable_insn() has
some heuristics to suppress the warning, but it does not work when
-ffunction-sections is enabled.

Suppose function foo has both strong and weak definitions.
Case 1: The strong definition has an annotated section name,
like .init.text. Only the weak definition will be placed into
.text.foo. But since the section has no symbols, there will be no
"hole" in the section.

Case 2: Both sections are without an annotated section name.
Both will be placed into .text.foo section, but there will be only one
symbol (the strong one). If the weak code is before the strong code,
there is no "hole" as it fails to find the right-most symbol before
the offset.

The fix is to use the first node to compute the hole if hole.sym
is empty. If there is no symbol in the section, the first node
will be NULL, in which case, -1 is returned to skip the whole
section.

Co-developed-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Rong Xu &lt;xur@google.com&gt;
Suggested-by: Sriraman Tallam &lt;tmsriram@google.com&gt;
Suggested-by: Krzysztof Pszeniczny &lt;kpszeniczny@google.com&gt;
Tested-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Tested-by: Yabin Cui &lt;yabinc@google.com&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Acked-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kbuild: Add AutoFDO support for Clang build</title>
<updated>2024-11-06T13:41:09Z</updated>
<author>
<name>Rong Xu</name>
<email>xur@google.com</email>
</author>
<published>2024-11-02T17:51:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=315ad8780a129e82e2c5c65ee6e970d91a577acb'/>
<id>urn:sha1:315ad8780a129e82e2c5c65ee6e970d91a577acb</id>
<content type='text'>
Add the build support for using Clang's AutoFDO. Building the kernel
with AutoFDO does not reduce the optimization level from the
compiler. AutoFDO uses hardware sampling to gather information about
the frequency of execution of different code paths within a binary.
This information is then used to guide the compiler's optimization
decisions, resulting in a more efficient binary. Experiments
showed that the kernel can improve up to 10% in latency.

The support requires a Clang compiler after LLVM 17. This submission
is limited to x86 platforms that support PMU features like LBR on
Intel machines and AMD Zen3 BRS. Support for SPE on ARM 1,
 and BRBE on ARM 1 is part of planned future work.

Here is an example workflow for AutoFDO kernel:

1) Build the kernel on the host machine with LLVM enabled, for example,
       $ make menuconfig LLVM=1
    Turn on AutoFDO build config:
      CONFIG_AUTOFDO_CLANG=y
    With a configuration that has LLVM enabled, use the following
    command:
       scripts/config -e AUTOFDO_CLANG
    After getting the config, build with
      $ make LLVM=1

2) Install the kernel on the test machine.

3) Run the load tests. The '-c' option in perf specifies the sample
   event period. We suggest     using a suitable prime number,
   like 500009, for this purpose.
   For Intel platforms:
      $ perf record -e BR_INST_RETIRED.NEAR_TAKEN:k -a -N -b -c &lt;count&gt; \
        -o &lt;perf_file&gt; -- &lt;loadtest&gt;
   For AMD platforms:
      The supported system are: Zen3 with BRS, or Zen4 with amd_lbr_v2
     For Zen3:
      $ cat proc/cpuinfo | grep " brs"
      For Zen4:
      $ cat proc/cpuinfo | grep amd_lbr_v2
      $ perf record --pfm-events RETIRED_TAKEN_BRANCH_INSTRUCTIONS:k -a \
        -N -b -c &lt;count&gt; -o &lt;perf_file&gt; -- &lt;loadtest&gt;

4) (Optional) Download the raw perf file to the host machine.

5) To generate an AutoFDO profile, two offline tools are available:
   create_llvm_prof and llvm_profgen. The create_llvm_prof tool is part
   of the AutoFDO project and can be found on GitHub
   (https://github.com/google/autofdo), version v0.30.1 or later. The
   llvm_profgen tool is included in the LLVM compiler itself. It's
   important to note that the version of llvm_profgen doesn't need to
   match the version of Clang. It needs to be the LLVM 19 release or
   later, or from the LLVM trunk.
      $ llvm-profgen --kernel --binary=&lt;vmlinux&gt; --perfdata=&lt;perf_file&gt; \
        -o &lt;profile_file&gt;
   or
      $ create_llvm_prof --binary=&lt;vmlinux&gt; --profile=&lt;perf_file&gt; \
        --format=extbinary --out=&lt;profile_file&gt;

   Note that multiple AutoFDO profile files can be merged into one via:
      $ llvm-profdata merge -o &lt;profile_file&gt;  &lt;profile_1&gt; ... &lt;profile_n&gt;

6) Rebuild the kernel using the AutoFDO profile file with the same config
   as step 1, (Note CONFIG_AUTOFDO_CLANG needs to be enabled):
      $ make LLVM=1 CLANG_AUTOFDO_PROFILE=&lt;profile_file&gt;

Co-developed-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Han Shen &lt;shenhan@google.com&gt;
Signed-off-by: Rong Xu &lt;xur@google.com&gt;
Suggested-by: Sriraman Tallam &lt;tmsriram@google.com&gt;
Suggested-by: Krzysztof Pszeniczny &lt;kpszeniczny@google.com&gt;
Suggested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Suggested-by: Stephane Eranian &lt;eranian@google.com&gt;
Tested-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Tested-by: Yabin Cui &lt;yabinc@google.com&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Tested-by: Peter Jung &lt;ptr1337@cachyos.org&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>reiserfs: The last commit</title>
<updated>2024-10-21T14:29:38Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2024-10-17T10:28:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb6f20ecb121cef4d7946f834a6ee867c4e21b4a'/>
<id>urn:sha1:fb6f20ecb121cef4d7946f834a6ee867c4e21b4a</id>
<content type='text'>
Deprecation period of reiserfs ends with the end of this year so it is
time to remove it from the kernel.

Acked-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Acked-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
</feed>
