<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/arch/riscv/kernel, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>riscv: probes: save original sp in rethook trampoline</title>
<updated>2026-07-01T00:46:54+00:00</updated>
<author>
<name>Martin Kaiser</name>
<email>martin@kaiser.cx</email>
</author>
<published>2026-06-30T19:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bc7b086a45521a986a49045907f017e3e46c763e'/>
<id>bc7b086a45521a986a49045907f017e3e46c763e</id>
<content type='text'>
Reading a word from the stack in a kretprobe crashes a risc-v kernel.

$ cd /sys/kernel/tracing/
$ echo 'r n_tty_write $stack0' &gt; dynamic_events
$ echo 1 &gt; events/kprobes/enable
Unable to handle kernel paging request at virtual address 0000000200000128
...
[&lt;ffffffff80016d16&gt;] regs_get_kernel_stack_nth+0x26/0x38
[&lt;ffffffff80177196&gt;] process_fetch_insn+0x3ee/0x760
[&lt;ffffffff80177836&gt;] kretprobe_trace_func+0x116/0x1f0
[&lt;ffffffff8017795a&gt;] kretprobe_dispatcher+0x4a/0x58
[&lt;ffffffff8013572e&gt;] kretprobe_rethook_handler+0x5e/0x90
[&lt;ffffffff80180838&gt;] rethook_trampoline_handler+0x70/0x108
[&lt;ffffffff8001ba32&gt;] arch_rethook_trampoline_callback+0x12/0x1c
[&lt;ffffffff8001ba84&gt;] arch_rethook_trampoline+0x48/0x94
[&lt;ffffffff8067872a&gt;] tty_write+0x1a/0x30

In regs_get_kernel_stack_nth, regs-&gt;sp contains an arbitrary value.

arch_rethook_trampoline saves the registers from the probed function in a
struct pt_regs. sp is not saved. Instead, sp is decremented for
arch_rethook_trampoline's local stack.

Fix this crash and save the original sp along with the other registers.
Use a0 as a temporary register, it is overwritten anyway.

Cc: stable@vger.kernel.org
Fixes: c22b0bcb1dd02 ("riscv: Add kprobes supported")
Signed-off-by: Martin Kaiser &lt;martin@kaiser.cx&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Link: https://patch.msgid.link/20260630194010.1824039-1-martin@kaiser.cx
[pjw@kernel.org: added Fixes tag; cc'ed stable]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reading a word from the stack in a kretprobe crashes a risc-v kernel.

$ cd /sys/kernel/tracing/
$ echo 'r n_tty_write $stack0' &gt; dynamic_events
$ echo 1 &gt; events/kprobes/enable
Unable to handle kernel paging request at virtual address 0000000200000128
...
[&lt;ffffffff80016d16&gt;] regs_get_kernel_stack_nth+0x26/0x38
[&lt;ffffffff80177196&gt;] process_fetch_insn+0x3ee/0x760
[&lt;ffffffff80177836&gt;] kretprobe_trace_func+0x116/0x1f0
[&lt;ffffffff8017795a&gt;] kretprobe_dispatcher+0x4a/0x58
[&lt;ffffffff8013572e&gt;] kretprobe_rethook_handler+0x5e/0x90
[&lt;ffffffff80180838&gt;] rethook_trampoline_handler+0x70/0x108
[&lt;ffffffff8001ba32&gt;] arch_rethook_trampoline_callback+0x12/0x1c
[&lt;ffffffff8001ba84&gt;] arch_rethook_trampoline+0x48/0x94
[&lt;ffffffff8067872a&gt;] tty_write+0x1a/0x30

In regs_get_kernel_stack_nth, regs-&gt;sp contains an arbitrary value.

arch_rethook_trampoline saves the registers from the probed function in a
struct pt_regs. sp is not saved. Instead, sp is decremented for
arch_rethook_trampoline's local stack.

Fix this crash and save the original sp along with the other registers.
Use a0 as a temporary register, it is overwritten anyway.

Cc: stable@vger.kernel.org
Fixes: c22b0bcb1dd02 ("riscv: Add kprobes supported")
Signed-off-by: Martin Kaiser &lt;martin@kaiser.cx&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Link: https://patch.msgid.link/20260630194010.1824039-1-martin@kaiser.cx
[pjw@kernel.org: added Fixes tag; cc'ed stable]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: Fix 32-bit call_on_irq_stack() frame pointer ABI</title>
<updated>2026-06-25T19:44:27+00:00</updated>
<author>
<name>Samuel Holland</name>
<email>samuel.holland@sifive.com</email>
</author>
<published>2026-06-24T11:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c4c7756a81b5baef286bf9be1ea404f3e4dd7a3c'/>
<id>c4c7756a81b5baef286bf9be1ea404f3e4dd7a3c</id>
<content type='text'>
call_on_irq_stack() uses struct member offsets to set up its link in the
frame record list. On riscv32, struct stackframe is the wrong size to
maintain stack pointer alignment, so STACKFRAME_SIZE_ON_STACK includes
padding. However, the ABI requires the frame record to be placed
immediately below the address stored in s0, so the padding must come
before the struct members.

Fix the layout by making STACKFRAME_FP and STACKFRAME_RA the negative
offsets from s0, instead of the positive offsets from sp.

Fixes: 82982fdd5133 ("riscv: Deduplicate IRQ stack switching")
Signed-off-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Reviewed-by: Matthew Bystrin &lt;dev.mbstr@gmail.com&gt;
Signed-off-by: Rui Qi &lt;qirui.001@bytedance.com&gt;
Link: https://lore.kernel.org/all/20240530001733.1407654-2-samuel.holland@sifive.com/
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/20260624113148.3723541-1-qirui.001@bytedance.com
[pjw@kernel.org: cleaned up the patch tags and added Matthew's Reviewed-by]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
call_on_irq_stack() uses struct member offsets to set up its link in the
frame record list. On riscv32, struct stackframe is the wrong size to
maintain stack pointer alignment, so STACKFRAME_SIZE_ON_STACK includes
padding. However, the ABI requires the frame record to be placed
immediately below the address stored in s0, so the padding must come
before the struct members.

Fix the layout by making STACKFRAME_FP and STACKFRAME_RA the negative
offsets from s0, instead of the positive offsets from sp.

Fixes: 82982fdd5133 ("riscv: Deduplicate IRQ stack switching")
Signed-off-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Reviewed-by: Matthew Bystrin &lt;dev.mbstr@gmail.com&gt;
Signed-off-by: Rui Qi &lt;qirui.001@bytedance.com&gt;
Link: https://lore.kernel.org/all/20240530001733.1407654-2-samuel.holland@sifive.com/
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/20260624113148.3723541-1-qirui.001@bytedance.com
[pjw@kernel.org: cleaned up the patch tags and added Matthew's Reviewed-by]
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: smp: use secs_to_jiffies in __cpu_up</title>
<updated>2026-06-25T18:24:25+00:00</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@linux.dev</email>
</author>
<published>2026-06-11T23:25:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=68fb3c026bec6f5dbd8ed5f2e57ef6535ec13341'/>
<id>68fb3c026bec6f5dbd8ed5f2e57ef6535ec13341</id>
<content type='text'>
Use secs_to_jiffies() to simplify the code. Drop the redundant zero
initialization while at it.

Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Link: https://patch.msgid.link/20260611232537.467398-3-thorsten.blum@linux.dev
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use secs_to_jiffies() to simplify the code. Drop the redundant zero
initialization while at it.

Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Link: https://patch.msgid.link/20260611232537.467398-3-thorsten.blum@linux.dev
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: Add build salt to the vDSO</title>
<updated>2026-06-25T18:05:05+00:00</updated>
<author>
<name>Bastian Blank</name>
<email>waldi@debian.org</email>
</author>
<published>2026-06-18T16:12:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c8c5a7835f5c9e34c8a15190519a2cc9ecb9b5b5'/>
<id>c8c5a7835f5c9e34c8a15190519a2cc9ecb9b5b5</id>
<content type='text'>
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.

Signed-off-by: Bastian Blank &lt;waldi@debian.org&gt;
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/ajQY7n0an0YwQ--j@steamhammer.waldi.eu.org
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The vDSO needs to have a unique build id in a similar manner
to the kernel and modules. Use the build salt macro.

Signed-off-by: Bastian Blank &lt;waldi@debian.org&gt;
Reviewed-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/ajQY7n0an0YwQ--j@steamhammer.waldi.eu.org
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'mm-nonmm-stable-2026-06-21-10-22' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm</title>
<updated>2026-06-21T20:20:19+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-06-21T20:20:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2e05544060b9fef5d4d0e0172944e6956c55080f'/>
<id>2e05544060b9fef5d4d0e0172944e6956c55080f</id>
<content type='text'>
Pull non-MM updates from Andrew Morton:

 - "taskstats: fix TGID dead-thread stat retention" (Yiyang Chen)

   Fix a taskstats TGID aggregation bug where fields added in the TGID
   query path were not preserved after thread exit, and adds a kselftest
   covering the regression.

 - "lib/tests: string_helpers: Slight improvements" (Andy Shevchenko)

   Improve lib/tests/string_helpers_kunit.c a little

 - "lib/base64: decode fixes" (Josh Law)

   Address minor issues in lib/base64.c

 - "selftests/filelock: Make output more kselftestish" (Mark Brown)

   Make the output from the ofdlocks test a bit easier for tooling to
   work with. Also ignore the generated file

 - "uaccess: unify inline vs outline copy_{from,to}_user() selection"
   (Yury Norov)

   Simplify the usercopy code by removing the selectability of inlining
   copy_{from,to}_user().

 - "ocfs2: validate inline xattr header consumers" (ZhengYuan Huang)

   Fix a number of possible issues in the ocfs2 xattr code

 - "lib and lib/cmdline enhancements" (Dmitry Antipov)

   Provide additional robustness checking in the cmdline handling code
   and its in-kernel testing and selftests

 - "cleanup the RAID6 P/Q library" (Christoph Hellwig)

   Clean up the RAID6 P/Q library to match the recent updates to the
   RAID 5 XOR library and other CRC/crypto libraries

 - "ocfs2: harden inode validators against forged metadata" (Michael
   Bommarito)

   Add three structural checks to OCFS2 dinode validation so malformed
   on-disk fields are rejected before ocfs2_populate_inode() copies them
   into the in-core inode

 - "lib/raid: replace __get_free_pages() call with kmalloc()" (Mike
   Rapoport)

   Clean up the lib/raid code by using kmalloc() in more places

* tag 'mm-nonmm-stable-2026-06-21-10-22' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (108 commits)
  ocfs2: fix circular locking dependency in ocfs2_dio_end_io_write
  ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits
  lib: interval_tree_test: validate benchmark parameters
  ocfs2: avoid moving extents to occupied clusters
  treewide: fix transposed "sign" typos and update spelling.txt
  ocfs2: fix UBSAN array-index-out-of-bounds in ocfs2_sum_rightmost_rec
  fat: reject BPB volumes whose data area starts beyond total sectors
  selftests/uevent: increase __UEVENT_BUFFER_SIZE to avoid ENOBUFS on busy systems
  lib/test_firmware: allocate the configured into_buf size
  fs: efs: remove unneeded debug prints
  checkpatch: cuppress warnings when Reported-by: is followed by Link:
  MAINTAINERS: add Alexander as a kcov reviewer
  mailmap: update Alexander Sverdlin's Email addresses
  fs: fat: inode: replace sprintf() with scnprintf()
  ocfs2: fix out-of-bounds write in ocfs2_remove_refcount_extent
  ocfs2: fix race between ocfs2_control_install_private() and ocfs2_control_release()
  ocfs2/dlm: require a ref for locking_state debugfs open
  ocfs2: reject FITRIM ranges shorter than a cluster
  ocfs2: validate fast symlink target during inode read
  ocfs2: add journal NULL check in ocfs2_checkpoint_inode()
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull non-MM updates from Andrew Morton:

 - "taskstats: fix TGID dead-thread stat retention" (Yiyang Chen)

   Fix a taskstats TGID aggregation bug where fields added in the TGID
   query path were not preserved after thread exit, and adds a kselftest
   covering the regression.

 - "lib/tests: string_helpers: Slight improvements" (Andy Shevchenko)

   Improve lib/tests/string_helpers_kunit.c a little

 - "lib/base64: decode fixes" (Josh Law)

   Address minor issues in lib/base64.c

 - "selftests/filelock: Make output more kselftestish" (Mark Brown)

   Make the output from the ofdlocks test a bit easier for tooling to
   work with. Also ignore the generated file

 - "uaccess: unify inline vs outline copy_{from,to}_user() selection"
   (Yury Norov)

   Simplify the usercopy code by removing the selectability of inlining
   copy_{from,to}_user().

 - "ocfs2: validate inline xattr header consumers" (ZhengYuan Huang)

   Fix a number of possible issues in the ocfs2 xattr code

 - "lib and lib/cmdline enhancements" (Dmitry Antipov)

   Provide additional robustness checking in the cmdline handling code
   and its in-kernel testing and selftests

 - "cleanup the RAID6 P/Q library" (Christoph Hellwig)

   Clean up the RAID6 P/Q library to match the recent updates to the
   RAID 5 XOR library and other CRC/crypto libraries

 - "ocfs2: harden inode validators against forged metadata" (Michael
   Bommarito)

   Add three structural checks to OCFS2 dinode validation so malformed
   on-disk fields are rejected before ocfs2_populate_inode() copies them
   into the in-core inode

 - "lib/raid: replace __get_free_pages() call with kmalloc()" (Mike
   Rapoport)

   Clean up the lib/raid code by using kmalloc() in more places

* tag 'mm-nonmm-stable-2026-06-21-10-22' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (108 commits)
  ocfs2: fix circular locking dependency in ocfs2_dio_end_io_write
  ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits
  lib: interval_tree_test: validate benchmark parameters
  ocfs2: avoid moving extents to occupied clusters
  treewide: fix transposed "sign" typos and update spelling.txt
  ocfs2: fix UBSAN array-index-out-of-bounds in ocfs2_sum_rightmost_rec
  fat: reject BPB volumes whose data area starts beyond total sectors
  selftests/uevent: increase __UEVENT_BUFFER_SIZE to avoid ENOBUFS on busy systems
  lib/test_firmware: allocate the configured into_buf size
  fs: efs: remove unneeded debug prints
  checkpatch: cuppress warnings when Reported-by: is followed by Link:
  MAINTAINERS: add Alexander as a kcov reviewer
  mailmap: update Alexander Sverdlin's Email addresses
  fs: fat: inode: replace sprintf() with scnprintf()
  ocfs2: fix out-of-bounds write in ocfs2_remove_refcount_extent
  ocfs2: fix race between ocfs2_control_install_private() and ocfs2_control_release()
  ocfs2/dlm: require a ref for locking_state debugfs open
  ocfs2: reject FITRIM ranges shorter than a cluster
  ocfs2: validate fast symlink target during inode read
  ocfs2: add journal NULL check in ocfs2_checkpoint_inode()
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'riscv-for-linus-7.2-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux</title>
<updated>2026-06-19T04:55:24+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-06-19T04:55:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f32a375eccb7b27bccc57dee45befff6e3b3d4b2'/>
<id>f32a375eccb7b27bccc57dee45befff6e3b3d4b2</id>
<content type='text'>
Pull RISC-V updates from Paul Walmsley:

 - Prevent get_free_mem_region() from returning regions that are
   unmappable in certain circumstances by defining
   DIRECT_MAP_PHYSMEM_END for RISC-V

 - Fix an early boot problem with kexec_file when the amount of
   installed physical memory installed on the system exceeds the direct
   map size, which is possible in certain RISC-V virtual memory modes

 - Unconditionally sfence.vma in the new vmalloc area handling code in
   the page fault handler, since even the presence of Svvptc doesn't
   guarantee that the CPU won't immediately fault again after the
   exception handler completes and subsequently crash

 - Fix ftrace_graph_ret_addr() to use the correct task pointer (aligning
   with what other architectures do)

 - Fix the misaligned access performance checking code in cases when
   performance is specified on the kernel command line and when CPUs
   have been brought offline and back online

 - Get rid of a bogus address offset in the non-frame-pointer version of
   walk_stackframe(), aligning it with the frame pointer-based code

 - Fix a RISC-V kfence issue causing bogus use-after-free warnings

 - Add ARCH_HAS_CC_CAN_LINK for RISC-V, which needs different compiler
   command line flags than other architectures

 - Implement _THIS_IP_ using RISC-V-specific assembly, which seems to be
   less brittle (from a compiler point of view) than taking the address
   of a label

 - Reduce kernel startup overhead by defining
   HAVE_BUILDTIME_MCOUNT_SORT, since arch/riscv meets all the
   requirements

 - Patch the CFI vDSO during alternatives processing, not only the
   standard vDSO

 - Fix a potential memory leak in the cacheinfo code

 - Clean up kernel/setup.c:add_resource() to pass along the return value
   from insert_resource() and to improve the display of resource ranges

 - Clean up our purgatory.[ch] by aligning our purgatory() prototype to
   what's in arch/x86, and by cleaning up verify_sha256_digest()

 - Clean up cpu_is_stopped() to align its function a little more closely
   to its name

 - Replace some unbounded string function usage in get_early_cmdline()
   and the ptdump code with strscpy()

 - Replace sprintf() with sysfs_emit() in cpu_show_ghostwrite() for
   safer bounds checking

 - Standardize how compiler output flags are specified in the RISC-V
   kselftests, aligning them with what other architectures do

 - Use the Linux-generic cmp_int() macro in place of an open-coded
   "cmp_3way()" macro in kernel/module-sections.c

 - Panic early in boot if IRQ handler stacks can't be allocated rather
   than pretending to continue normally

 - Add support for Eswin SoCs in the RISC-V defconfig

 - Remove some unnecessary conditionals in sbi_hsm_hart_{start,stop}()

 - Clean up some Kconfig infelicities found by Kconfirm

 - Replace an open-coded version of min() in the kexec_elf code with
   the standard min() function

* tag 'riscv-for-linus-7.2-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (36 commits)
  riscv: traps_misaligned: Avoid redundant unaligned access speed probe
  riscv: misaligned: Fix fast_unaligned_access_speed_key init
  riscv: also select ARCH_KEEP_MEMBLOCK if kexec is selected
  riscv: alternative: Also patch the CFI vDSO
  riscv: alternative: Pass vDSO start as parameter to apply_vdso_alternatives()
  riscv: alternative: Use IS_ENABLED() over ifdeffery for apply_vdso_alternatives()
  riscv: vdso: Always declare vdso_start symbols
  riscv: kexec: use min to simplify riscv_kexec_elf_load
  riscv: panic if IRQ handler stacks cannot be allocated
  riscv: mm: Unconditionally sfence.vma for spurious fault
  riscv: mm: Use the bitmap API for new_valid_map_cpus
  riscv: mm: Rename new_vmalloc into new_valid_map_cpus
  riscv: kfence: Call mark_new_valid_map() for kfence_unprotect()
  riscv: mm: Extract helper mark_new_valid_map()
  riscv: stacktrace: Remove bogus -0x4 offset in non-FP walk_stackframe
  riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
  riscv: kexec_file: Constrain segment placement to direct map
  riscv: mm: Define DIRECT_MAP_PHYSMEM_END
  riscv: defconfig: Enable Eswin SoCs
  riscv: cpu_ops_sbi: No need to be bothered to check ret.error
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull RISC-V updates from Paul Walmsley:

 - Prevent get_free_mem_region() from returning regions that are
   unmappable in certain circumstances by defining
   DIRECT_MAP_PHYSMEM_END for RISC-V

 - Fix an early boot problem with kexec_file when the amount of
   installed physical memory installed on the system exceeds the direct
   map size, which is possible in certain RISC-V virtual memory modes

 - Unconditionally sfence.vma in the new vmalloc area handling code in
   the page fault handler, since even the presence of Svvptc doesn't
   guarantee that the CPU won't immediately fault again after the
   exception handler completes and subsequently crash

 - Fix ftrace_graph_ret_addr() to use the correct task pointer (aligning
   with what other architectures do)

 - Fix the misaligned access performance checking code in cases when
   performance is specified on the kernel command line and when CPUs
   have been brought offline and back online

 - Get rid of a bogus address offset in the non-frame-pointer version of
   walk_stackframe(), aligning it with the frame pointer-based code

 - Fix a RISC-V kfence issue causing bogus use-after-free warnings

 - Add ARCH_HAS_CC_CAN_LINK for RISC-V, which needs different compiler
   command line flags than other architectures

 - Implement _THIS_IP_ using RISC-V-specific assembly, which seems to be
   less brittle (from a compiler point of view) than taking the address
   of a label

 - Reduce kernel startup overhead by defining
   HAVE_BUILDTIME_MCOUNT_SORT, since arch/riscv meets all the
   requirements

 - Patch the CFI vDSO during alternatives processing, not only the
   standard vDSO

 - Fix a potential memory leak in the cacheinfo code

 - Clean up kernel/setup.c:add_resource() to pass along the return value
   from insert_resource() and to improve the display of resource ranges

 - Clean up our purgatory.[ch] by aligning our purgatory() prototype to
   what's in arch/x86, and by cleaning up verify_sha256_digest()

 - Clean up cpu_is_stopped() to align its function a little more closely
   to its name

 - Replace some unbounded string function usage in get_early_cmdline()
   and the ptdump code with strscpy()

 - Replace sprintf() with sysfs_emit() in cpu_show_ghostwrite() for
   safer bounds checking

 - Standardize how compiler output flags are specified in the RISC-V
   kselftests, aligning them with what other architectures do

 - Use the Linux-generic cmp_int() macro in place of an open-coded
   "cmp_3way()" macro in kernel/module-sections.c

 - Panic early in boot if IRQ handler stacks can't be allocated rather
   than pretending to continue normally

 - Add support for Eswin SoCs in the RISC-V defconfig

 - Remove some unnecessary conditionals in sbi_hsm_hart_{start,stop}()

 - Clean up some Kconfig infelicities found by Kconfirm

 - Replace an open-coded version of min() in the kexec_elf code with
   the standard min() function

* tag 'riscv-for-linus-7.2-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (36 commits)
  riscv: traps_misaligned: Avoid redundant unaligned access speed probe
  riscv: misaligned: Fix fast_unaligned_access_speed_key init
  riscv: also select ARCH_KEEP_MEMBLOCK if kexec is selected
  riscv: alternative: Also patch the CFI vDSO
  riscv: alternative: Pass vDSO start as parameter to apply_vdso_alternatives()
  riscv: alternative: Use IS_ENABLED() over ifdeffery for apply_vdso_alternatives()
  riscv: vdso: Always declare vdso_start symbols
  riscv: kexec: use min to simplify riscv_kexec_elf_load
  riscv: panic if IRQ handler stacks cannot be allocated
  riscv: mm: Unconditionally sfence.vma for spurious fault
  riscv: mm: Use the bitmap API for new_valid_map_cpus
  riscv: mm: Rename new_vmalloc into new_valid_map_cpus
  riscv: kfence: Call mark_new_valid_map() for kfence_unprotect()
  riscv: mm: Extract helper mark_new_valid_map()
  riscv: stacktrace: Remove bogus -0x4 offset in non-FP walk_stackframe
  riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
  riscv: kexec_file: Constrain segment placement to direct map
  riscv: mm: Define DIRECT_MAP_PHYSMEM_END
  riscv: defconfig: Enable Eswin SoCs
  riscv: cpu_ops_sbi: No need to be bothered to check ret.error
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip</title>
<updated>2026-06-15T07:49:41+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-06-15T07:49:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=13e1a6d6a17eb4bca350e5bf59a89a3056c834ca'/>
<id>13e1a6d6a17eb4bca350e5bf59a89a3056c834ca</id>
<content type='text'>
Pull interrupt core updates from Thomas Gleixner:

  - Rework of /proc/interrupt handling:

    /proc/interrupts was subject to micro optimizations for a long time,
    but most of the low hanging fruit was left on the table. This rework
    addresses the major time consuming issues:

      - Printing a long series of zeros one by one via a format string
        instead of counting subsequent zeros and emitting a string
        constant.

      - Simplify and cache the conditions whether interrupts should be
        printed

      - Use a proper iteration over the interrupt descriptor xarray
        instead of walking and testing one by one.

      - Provide helper functions for the architecture code to emit the
        architecture specific counters

      - Convert the counter structure in x86 to an array, which
        simplifies the output and add mechanisms to suppress unused
        architecture interrupts, which just occupy space for nothing.
        Adopt the new core mechanisms.

    This adjusts the gdb scripts related to interrupt counter statistics
    to work with the new mechanisms.

  - Prevent a string overflow in the /proc/irq/$N/ directory name
    creation code.

* tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Add missing 's' back to thermal event printout
  genirq/proc: Speed up /proc/interrupts iteration
  genirq/proc: Runtime size the chip name
  genirq: Expose irq_find_desc_at_or_after() in core code
  genirq: Add rcuref count to struct irq_desc
  genirq/proc: Increase default interrupt number precision to four
  genirq: Calculate precision only when required
  genirq: Cache the condition for /proc/interrupts exposure
  genirq/manage: Make NMI cleanup RT safe
  genirq: Expose nr_irqs in core code
  scripts/gdb: Update x86 interrupts to the array based storage
  x86/irq: Move IOAPIC misrouted and PIC/APIC error counts into irq_stats
  x86/irq: Suppress unlikely interrupt stats by default
  x86/irq: Make irqstats array based
  genirq/proc: Utilize irq_desc::tot_count to avoid evaluation
  genirq/proc: Avoid formatting zero counts in /proc/interrupts
  x86/irq: Optimize interrupts decimals printing
  genirq/proc: Size interrupt directory names for 10-digit interrupt numbers
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull interrupt core updates from Thomas Gleixner:

  - Rework of /proc/interrupt handling:

    /proc/interrupts was subject to micro optimizations for a long time,
    but most of the low hanging fruit was left on the table. This rework
    addresses the major time consuming issues:

      - Printing a long series of zeros one by one via a format string
        instead of counting subsequent zeros and emitting a string
        constant.

      - Simplify and cache the conditions whether interrupts should be
        printed

      - Use a proper iteration over the interrupt descriptor xarray
        instead of walking and testing one by one.

      - Provide helper functions for the architecture code to emit the
        architecture specific counters

      - Convert the counter structure in x86 to an array, which
        simplifies the output and add mechanisms to suppress unused
        architecture interrupts, which just occupy space for nothing.
        Adopt the new core mechanisms.

    This adjusts the gdb scripts related to interrupt counter statistics
    to work with the new mechanisms.

  - Prevent a string overflow in the /proc/irq/$N/ directory name
    creation code.

* tag 'irq-core-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Add missing 's' back to thermal event printout
  genirq/proc: Speed up /proc/interrupts iteration
  genirq/proc: Runtime size the chip name
  genirq: Expose irq_find_desc_at_or_after() in core code
  genirq: Add rcuref count to struct irq_desc
  genirq/proc: Increase default interrupt number precision to four
  genirq: Calculate precision only when required
  genirq: Cache the condition for /proc/interrupts exposure
  genirq/manage: Make NMI cleanup RT safe
  genirq: Expose nr_irqs in core code
  scripts/gdb: Update x86 interrupts to the array based storage
  x86/irq: Move IOAPIC misrouted and PIC/APIC error counts into irq_stats
  x86/irq: Suppress unlikely interrupt stats by default
  x86/irq: Make irqstats array based
  genirq/proc: Utilize irq_desc::tot_count to avoid evaluation
  genirq/proc: Avoid formatting zero counts in /proc/interrupts
  x86/irq: Optimize interrupts decimals printing
  genirq/proc: Size interrupt directory names for 10-digit interrupt numbers
</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: traps_misaligned: Avoid redundant unaligned access speed probe</title>
<updated>2026-06-08T16:47:22+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcao@linutronix.de</email>
</author>
<published>2026-05-28T21:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=319fafd9a3743b617b8547d81c41c99fb67857b1'/>
<id>319fafd9a3743b617b8547d81c41c99fb67857b1</id>
<content type='text'>
When a CPU is taken offline and then is brought back online, unaligned
access speed probe always runs even though the unaligned access speed is
already known, wasting CPU cycles.

This is because when a CPU becomes online, the following happen:

  1. check_unaligned_access_emulated() is called, which clears
     misaligned_access_speed if there is no emulation.

  2. check_unaligned_access() is called because misaligned_access_speed is
     cleared, wasting CPU cycles determining something already previous
     known.

Avoid the redundant access speed probe by stop clearing
misaligned_access_speed in (1). If access speed is already known, just
reuse it.

On my Visionfive 2, this reduces CPU bring-up time from 26ms to 0.8ms.

Signed-off-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/aa5755142537d462a9e3d2074d82ad4eef6774ba.1780002199.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a CPU is taken offline and then is brought back online, unaligned
access speed probe always runs even though the unaligned access speed is
already known, wasting CPU cycles.

This is because when a CPU becomes online, the following happen:

  1. check_unaligned_access_emulated() is called, which clears
     misaligned_access_speed if there is no emulation.

  2. check_unaligned_access() is called because misaligned_access_speed is
     cleared, wasting CPU cycles determining something already previous
     known.

Avoid the redundant access speed probe by stop clearing
misaligned_access_speed in (1). If access speed is already known, just
reuse it.

On my Visionfive 2, this reduces CPU bring-up time from 26ms to 0.8ms.

Signed-off-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/aa5755142537d462a9e3d2074d82ad4eef6774ba.1780002199.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: misaligned: Fix fast_unaligned_access_speed_key init</title>
<updated>2026-06-08T16:47:22+00:00</updated>
<author>
<name>Nam Cao</name>
<email>namcao@linutronix.de</email>
</author>
<published>2026-05-28T21:12:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d585018a9258efed01514bae369ab3d4f21e7b1a'/>
<id>d585018a9258efed01514bae369ab3d4f21e7b1a</id>
<content type='text'>
When booting with unaligned_scalar_speed=fast,
fast_unaligned_access_speed_key is initialized incorrectly.

The key is currently derived from the fast_misaligned_access cpumask, but
that mask is only populated when the unaligned access speed probe runs.
Specifying unaligned_scalar_speed=fast skips the probe entirely, leaving
the mask uninitialized.

The information tracked by fast_misaligned_access is already available in
the misaligned_access_speed per-CPU variable. Use that to initialize
fast_unaligned_access_speed_key instead and remove the redundant cpumask.

Signed-off-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/2468816ceb433394099a00d7822f819745276b49.1780002199.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When booting with unaligned_scalar_speed=fast,
fast_unaligned_access_speed_key is initialized incorrectly.

The key is currently derived from the fast_misaligned_access cpumask, but
that mask is only populated when the unaligned access speed probe runs.
Specifying unaligned_scalar_speed=fast skips the probe entirely, leaving
the mask uninitialized.

The information tracked by fast_misaligned_access is already available in
the misaligned_access_speed per-CPU variable. Use that to initialize
fast_unaligned_access_speed_key instead and remove the redundant cpumask.

Signed-off-by: Nam Cao &lt;namcao@linutronix.de&gt;
Link: https://patch.msgid.link/2468816ceb433394099a00d7822f819745276b49.1780002199.git.namcao@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: alternative: Also patch the CFI vDSO</title>
<updated>2026-06-07T07:56:28+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2026-05-04T06:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d3e0634787a234b40a740b9c398fd320a68db81c'/>
<id>d3e0634787a234b40a740b9c398fd320a68db81c</id>
<content type='text'>
The dedicated vDSO for CFI-enabled userspace can also contain
alternative entries.

Patch those, too.

Fixes: ccad8c1336b6 ("arch/riscv: add dual vdso creation logic and select vdso based on hw")
Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Link: https://patch.msgid.link/20260504-riscv-cfi-vdso-alternative-v1-4-bcdf3d37f62e@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dedicated vDSO for CFI-enabled userspace can also contain
alternative entries.

Patch those, too.

Fixes: ccad8c1336b6 ("arch/riscv: add dual vdso creation logic and select vdso based on hw")
Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Link: https://patch.msgid.link/20260504-riscv-cfi-vdso-alternative-v1-4-bcdf3d37f62e@linutronix.de
Signed-off-by: Paul Walmsley &lt;pjw@kernel.org&gt;</pre>
</div>
</content>
</entry>
</feed>
