<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/Documentation/features, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'docs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linux</title>
<updated>2026-10-21T00:38:38+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-10-21T00:38:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=14c897740388216acd59477a382de327d5e27ba4'/>
<id>14c897740388216acd59477a382de327d5e27ba4</id>
<content type='text'>
Pull documentation updates from Jonathan Corbet:
 "It was a reasonably busy cycle for docs; changes include:

   - Add the AGENTS.md symbolic link into the top-level directory in the
     hopes that LLMs will read it and produce better work

   - The removal of the Assisted-by requirement, as concluded at the
     Maintainer Summit

   - A new "testdocs" make target to run the documentation unit tests

   - Lots of work on the Portuguese, and Chinese translations; there is
     now maintenance for the traditional Chinese translations as well

  ...and the usual pile of minor fixes, documentation updates, etc"

* tag 'docs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linux: (125 commits)
  docs: add AGENTS.md as a symlink to README
  docs: kernel-parameters: adjust reserve_mem build option
  docs: kernel-parameters: don't mix cmdline options &amp; build options
  docs/ja_JP: translate submitting-patches.rst (review and report tags)
  docs: remove Assisted-by references
  Revert "docs: landlock: fix ENOMSG condition in create_ruleset kernel-doc"
  docs: kdoc: parse context_lock_struct() as struct declaration
  docs: timers: hpet: Document userspace API and ioctl commands
  docs: timers: hpet: Modernize file references
  Documentation: sched-preemption: Add a SPDX license identifier
  docs: ABI: sysfs-driver-xdata: use literal blocks for console commands
  docs: ABI: sysfs-class-firmware-attributes: use literal blocks for console commands
  ABI: sysfs-bus-usb: use literal block for console commands
  docs/ABI: testing: aspeed-uart-routing: use literal block for console commands
  docs: kernel-parameters: fix a truncated sentence for preempt=lazy
  sched/doc: add a preemption model overview
  docs: ABI: TMR manager: use literal blocks for console I/O
  Documentation/ABI: IFS: use literal blocks for commands
  ABI: sysfs-bus-pci: use literal blocks for commands
  docs: translations: pt_BR: add debugging index
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull documentation updates from Jonathan Corbet:
 "It was a reasonably busy cycle for docs; changes include:

   - Add the AGENTS.md symbolic link into the top-level directory in the
     hopes that LLMs will read it and produce better work

   - The removal of the Assisted-by requirement, as concluded at the
     Maintainer Summit

   - A new "testdocs" make target to run the documentation unit tests

   - Lots of work on the Portuguese, and Chinese translations; there is
     now maintenance for the traditional Chinese translations as well

  ...and the usual pile of minor fixes, documentation updates, etc"

* tag 'docs-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/docs/linux: (125 commits)
  docs: add AGENTS.md as a symlink to README
  docs: kernel-parameters: adjust reserve_mem build option
  docs: kernel-parameters: don't mix cmdline options &amp; build options
  docs/ja_JP: translate submitting-patches.rst (review and report tags)
  docs: remove Assisted-by references
  Revert "docs: landlock: fix ENOMSG condition in create_ruleset kernel-doc"
  docs: kdoc: parse context_lock_struct() as struct declaration
  docs: timers: hpet: Document userspace API and ioctl commands
  docs: timers: hpet: Modernize file references
  Documentation: sched-preemption: Add a SPDX license identifier
  docs: ABI: sysfs-driver-xdata: use literal blocks for console commands
  docs: ABI: sysfs-class-firmware-attributes: use literal blocks for console commands
  ABI: sysfs-bus-usb: use literal block for console commands
  docs/ABI: testing: aspeed-uart-routing: use literal block for console commands
  docs: kernel-parameters: fix a truncated sentence for preempt=lazy
  sched/doc: add a preemption model overview
  docs: ABI: TMR manager: use literal blocks for console I/O
  Documentation/ABI: IFS: use literal blocks for commands
  ABI: sysfs-bus-pci: use literal blocks for commands
  docs: translations: pt_BR: add debugging index
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: add HAVE_PERF_REGS and HAVE_PERF_USER_STACK_DUMP support</title>
<updated>2026-10-18T18:09:29+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-10-18T14:22:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9280e99d87ddd8c6c7fd83f9ea1585967b3dcd60'/>
<id>9280e99d87ddd8c6c7fd83f9ea1585967b3dcd60</id>
<content type='text'>
Let perf sample registers and dump the user stack, which is what the
perf tool needs for --call-graph dwarf.

The register indices follow the hardware numbering, so r0-r30 map
directly to DWARF register numbers, with pc after them. r9-r15
are callee-saved and live in switch_stack rather than pt_regs, so they
cannot be sampled. Without r15 an unwinder cannot recover the CFA of a
first frame that uses $15 as its frame pointer.

sp is not in pt_regs either: for user frames it comes from
user_stack_pointer(), and for kernel frames (PERF_SAMPLE_REGS_INTR) it
is the end of the trap frame, as in stacktrace.c.

Software events such as context switches and tracepoints hand perf a
per-CPU pt_regs filled in by perf_fetch_caller_regs() instead of a
trap frame. It is not on the stack and has no room for sp, so report
sp as 0 there rather than the address of the per-CPU buffer.

Assisted-by: Claude:claude-opus-5-5
Acked-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Link: https://lore.kernel.org/r/20261018-alpha-perf-regs-v3-v3-4-52be85332c57@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let perf sample registers and dump the user stack, which is what the
perf tool needs for --call-graph dwarf.

The register indices follow the hardware numbering, so r0-r30 map
directly to DWARF register numbers, with pc after them. r9-r15
are callee-saved and live in switch_stack rather than pt_regs, so they
cannot be sampled. Without r15 an unwinder cannot recover the CFA of a
first frame that uses $15 as its frame pointer.

sp is not in pt_regs either: for user frames it comes from
user_stack_pointer(), and for kernel frames (PERF_SAMPLE_REGS_INTR) it
is the end of the trap frame, as in stacktrace.c.

Software events such as context switches and tracepoints hand perf a
per-CPU pt_regs filled in by perf_fetch_caller_regs() instead of a
trap frame. It is not on the stack and has no room for sp, so report
sp as 0 there rather than the address of the per-CPU buffer.

Assisted-by: Claude:claude-opus-5-5
Acked-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Link: https://lore.kernel.org/r/20261018-alpha-perf-regs-v3-v3-4-52be85332c57@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: select ARCH_HAS_DEBUG_VM_PGTABLE</title>
<updated>2026-10-17T22:44:42+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-09-05T19:29:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=533d4a1ef9da12dd820c7a04bb6024df528a54b0'/>
<id>533d4a1ef9da12dd820c7a04bb6024df528a54b0</id>
<content type='text'>
CONFIG_DEBUG_VM_PGTABLE runs a boot-time self test over the page table
helpers: the protection bit accessors, pte_modify(), the swap entry
encoding including the exclusive marker, and, where the architecture
supports them, the huge page helpers.  Alpha implements everything the
test needs for a three-level page table without huge page support.

Also mark Alpha as "ok" in the debug-vm-pgtable feature matrix.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-14-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CONFIG_DEBUG_VM_PGTABLE runs a boot-time self test over the page table
helpers: the protection bit accessors, pte_modify(), the swap entry
encoding including the exclusive marker, and, where the architecture
supports them, the huge page helpers.  Alpha implements everything the
test needs for a three-level page table without huge page support.

Also mark Alpha as "ok" in the debug-vm-pgtable feature matrix.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-14-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: add ARCH_HAS_PTE_SPECIAL support</title>
<updated>2026-10-17T22:44:41+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-09-05T19:29:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7ab5de838dfcb39322417253e69a7be67bae9e68'/>
<id>7ab5de838dfcb39322417253e69a7be67bae9e68</id>
<content type='text'>
Add _PAGE_SPECIAL using bit 19 (0x80000), which is unused in the Alpha
PTE layout. This enables pte_special()/pte_mkspecial() for marking PTEs
that are not backed by struct page (VDSO mappings, zero page,
io_remap_pfn_range, etc.).

Include _PAGE_SPECIAL in _PAGE_CHG_MASK so it is preserved across
pte_modify() calls.

Also mark Alpha as "ok" in the pte_special feature matrix.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-12-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add _PAGE_SPECIAL using bit 19 (0x80000), which is unused in the Alpha
PTE layout. This enables pte_special()/pte_mkspecial() for marking PTEs
that are not backed by struct page (VDSO mappings, zero page,
io_remap_pfn_range, etc.).

Include _PAGE_SPECIAL in _PAGE_CHG_MASK so it is preserved across
pte_modify() calls.

Also mark Alpha as "ok" in the pte_special feature matrix.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-12-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: select HAVE_DEBUG_KMEMLEAK</title>
<updated>2026-09-11T14:29:02+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-09-05T19:29:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2b41fbab67ef7ccdb48c7a5a69c38dfadba610e8'/>
<id>2b41fbab67ef7ccdb48c7a5a69c38dfadba610e8</id>
<content type='text'>
Kmemleak needs no architecture support beyond the standard linker script
symbols for the data and bss sections, which Alpha already provides, and
a scan of the kernel stacks, which is done generically.

Also mark Alpha as "ok" in the kmemleak feature matrix.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-4-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Kmemleak needs no architecture support beyond the standard linker script
symbols for the data and bss sections, which Alpha already provides, and
a scan of the kernel stacks, which is done generically.

Also mark Alpha as "ok" in the kmemleak feature matrix.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-4-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: select ARCH_HAS_GCOV_PROFILE_ALL</title>
<updated>2026-09-11T14:28:40+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2026-09-05T19:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=278de0f04816c97f701456b72af4f59d36440249'/>
<id>278de0f04816c97f701456b72af4f59d36440249</id>
<content type='text'>
GCC's gcov instrumentation (-fprofile-arcs -ftest-coverage) has no
architecture-specific runtime requirements. Enable GCOV_PROFILE_ALL
support for Alpha to allow whole-kernel code coverage analysis.

Also mark Alpha as "ok" in the gcov-profile-all feature matrix.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-3-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC's gcov instrumentation (-fprofile-arcs -ftest-coverage) has no
architecture-specific runtime requirements. Enable GCOV_PROFILE_ALL
support for Alpha to allow whole-kernel code coverage analysis.

Also mark Alpha as "ok" in the gcov-profile-all feature matrix.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Reviewed-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-3-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Documentation/features: Mark cmpxchg-local as supported on loongarch</title>
<updated>2026-09-07T15:44:42+00:00</updated>
<author>
<name>Karl Mehltretter</name>
<email>kmehltretter@gmail.com</email>
</author>
<published>2026-09-05T09:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0c4c9abbf68b862a53ca47acb5a8664200af8e6d'/>
<id>0c4c9abbf68b862a53ca47acb5a8664200af8e6d</id>
<content type='text'>
arch/loongarch/Kconfig has selected CONFIG_HAVE_CMPXCHG_LOCAL since
commit 07d5798aadfa ("LoongArch: Select HAVE_CMPXCHG_LOCAL in Kconfig"),
but the feature matrix still lists loongarch as TODO. This is the only
cell in Documentation/features that tools/docs/features-refresh.sh
changes on today's tree.

Mark it ok.

Fixes: 07d5798aadfa ("LoongArch: Select HAVE_CMPXCHG_LOCAL in Kconfig")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter &lt;kmehltretter@gmail.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Message-ID: &lt;20260905091743.41006-1-kmehltretter@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
arch/loongarch/Kconfig has selected CONFIG_HAVE_CMPXCHG_LOCAL since
commit 07d5798aadfa ("LoongArch: Select HAVE_CMPXCHG_LOCAL in Kconfig"),
but the feature matrix still lists loongarch as TODO. This is the only
cell in Documentation/features that tools/docs/features-refresh.sh
changes on today's tree.

Mark it ok.

Fixes: 07d5798aadfa ("LoongArch: Select HAVE_CMPXCHG_LOCAL in Kconfig")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter &lt;kmehltretter@gmail.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Message-ID: &lt;20260905091743.41006-1-kmehltretter@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: enable lockdep hardirq state tracking</title>
<updated>2026-07-19T11:16:26+00:00</updated>
<author>
<name>Magnus Lindholm</name>
<email>linmag7@gmail.com</email>
</author>
<published>2026-07-06T16:56:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d1ee975398a357be8f56836a87ae55c51770e4f0'/>
<id>d1ee975398a357be8f56836a87ae55c51770e4f0</id>
<content type='text'>
Alpha masks interrupts through the PAL IPL state, so lockdep cannot infer
hardirq state transitions from generic code alone. Add explicit
hardirq on/off annotations to the low-level entry and return paths so
lockdep's IRQ state follows the hardware IPL state.

Annotate the PAL IPL transitions and the shared return-to-user/kernel
paths where interrupts become enabled or disabled.  With the preceding
irqflags, raw-lock, sysfs, and ftrace return-address preparations in
place, select LOCKDEP_SUPPORT and TRACE_IRQFLAGS_SUPPORT for Alpha.

This keeps CONFIG_PROVE_LOCKING usable on Alpha instead of disabling
debug_locks due to IRQ-state mismatches.

Reviewed-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Matt Turner &lt;mattst88@gmail.com&gt;
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260706170019.2941459-7-linmag7@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Alpha masks interrupts through the PAL IPL state, so lockdep cannot infer
hardirq state transitions from generic code alone. Add explicit
hardirq on/off annotations to the low-level entry and return paths so
lockdep's IRQ state follows the hardware IPL state.

Annotate the PAL IPL transitions and the shared return-to-user/kernel
paths where interrupts become enabled or disabled.  With the preceding
irqflags, raw-lock, sysfs, and ftrace return-address preparations in
place, select LOCKDEP_SUPPORT and TRACE_IRQFLAGS_SUPPORT for Alpha.

This keeps CONFIG_PROVE_LOCKING usable on Alpha instead of disabling
debug_locks due to IRQ-state mismatches.

Reviewed-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Matt Turner &lt;mattst88@gmail.com&gt;
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260706170019.2941459-7-linmag7@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>alpha: enable regset-based ptrace and core dumps</title>
<updated>2026-07-19T11:15:40+00:00</updated>
<author>
<name>Magnus Lindholm</name>
<email>linmag7@gmail.com</email>
</author>
<published>2026-07-06T16:56:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a2857bc2b3039eef6c15900b00424417a2293e8'/>
<id>8a2857bc2b3039eef6c15900b00424417a2293e8</id>
<content type='text'>
Add a user_regset_view for Alpha and switch ELF core dumping to
CORE_DUMP_USE_REGSET.  General-purpose registers are exported in
ELF gregs layout, including callee-saved registers and a correct
user stack pointer.

The user stack pointer is not preserved in pt_regs on Alpha, so expose
it from the PCB, or via rdusp() for the current task, when building the
ELF register image.  This makes the user stack pointer consistent for
core dumps, ptrace regsets, and PTRACE_GET_SYSCALL_INFO.

Implement regset get/set callbacks for both NT_PRSTATUS and NT_PRFPREG.
The callbacks translate between Alpha's pt_regs/thread state and the
ELF-visible register layouts, while the common ptrace regset code handles
PTRACE_GETREGSET and PTRACE_SETREGSET iovec semantics.  This avoids
duplicating subtle short-buffer and oversized-buffer behavior in
arch_ptrace().

With these changes Alpha satisfies the requirements for
HAVE_ARCH_TRACEHOOK and selects it, enabling generic tracehook and
ptrace syscall-info code paths without changing the existing syscall
entry ABI.

Reviewed-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Matt Turner &lt;mattst88@gmail.com&gt;
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260706170019.2941459-2-linmag7@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a user_regset_view for Alpha and switch ELF core dumping to
CORE_DUMP_USE_REGSET.  General-purpose registers are exported in
ELF gregs layout, including callee-saved registers and a correct
user stack pointer.

The user stack pointer is not preserved in pt_regs on Alpha, so expose
it from the PCB, or via rdusp() for the current task, when building the
ELF register image.  This makes the user stack pointer consistent for
core dumps, ptrace regsets, and PTRACE_GET_SYSCALL_INFO.

Implement regset get/set callbacks for both NT_PRSTATUS and NT_PRFPREG.
The callbacks translate between Alpha's pt_regs/thread state and the
ELF-visible register layouts, while the common ptrace regset code handles
PTRACE_GETREGSET and PTRACE_SETREGSET iovec semantics.  This avoids
duplicating subtle short-buffer and oversized-buffer behavior in
arch_ptrace().

With these changes Alpha satisfies the requirements for
HAVE_ARCH_TRACEHOOK and selects it, enabling generic tracehook and
ptrace syscall-info code paths without changing the existing syscall
entry ABI.

Reviewed-by: Matt Turner &lt;mattst88@gmail.com&gt;
Tested-by: Matt Turner &lt;mattst88@gmail.com&gt;
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
Link: https://lore.kernel.org/r/20260706170019.2941459-2-linmag7@gmail.com
Signed-off-by: Magnus Lindholm &lt;linmag7@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Add THREAD_INFO_IN_TASK implementation</title>
<updated>2026-06-25T05:03:47+00:00</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2026-06-25T05:03:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b5944d6ed369e43aeaf37beba9f89f7fb6c633b'/>
<id>7b5944d6ed369e43aeaf37beba9f89f7fb6c633b</id>
<content type='text'>
Like other architectures such as x86, arm64, riscv, powerpc and s390,
select THREAD_INFO_IN_TASK for LoongArch to move thread_info off the
stack into task_struct. This follows modern kernel standards and also
makes the system more secure.

With this patch, thread_info is included in task_struct at an offset
of 0 instead of being placed at the bottom of the kernel stack. Thus,
the $tp register points to both thread_info and task_struct.

To support this, introduce a per-CPU variable cpu_tasks to store the
pointer to the current task_struct. This decouples the recovery	of the
$tp register from the stack pointer during exception entry.

Then initialize cpu_tasks for the primary and secondary CPUs during
arch-specific setup and SMP boot paths. To eliminate the dangerous
windows during the early initialization where the cpu_tasks remains
uninitialized, set_current() is invoked as early as possible in both
setup_arch() and start_secondary(). This ensures the $tp recovery
barrier is armed in case any early boot exceptions or kernel panics
occur.

Modify SAVE_SOME and handle_syscall to restore the $tp register from
cpu_tasks, and also use the la_abs absolute addressing for cpu_tasks
access in assembly to bypass the relocation limits within exception
handling sections. By advancing the preservation of u0 in SAVE_SOME,
we reuse the PERCPU_BASE_KS value in u0 for the cpu_tasks calculation,
effectively eliminating a duplicate csrrd instruction execution on SMP
platforms.

Update &lt;asm/switch_to.h&gt; and &lt;kernel/switch.S&gt; to fully support the
CONFIG_THREAD_INFO_IN_TASK feature.

Remove the obsolete next_ti argument from __switch_to(), which shifts
the remaining arguments ahead in the calling convention (sched_ra from
a3 to a2, and sched_cfa from a4 to a3). Under the new configuration,
__switch_to() now directly derives the thread pointer ($tp) from the
next task_struct pointer in a1.

To preserve the optimal and clean "move tp, a1" path for 64-bit kernels,
the thread pointer ($tp) is assigned directly from a1 in the core path.
For 32-bit kernels, where a1 carries a 2000-byte structural pointer bias
at entry, an explicit adjustment "PTR_ADDI tp, tp, -TASK_STRUCT_OFFSET"
is introduced at the function exit.

In the context of __switch_to(), local interrupts are disabled, and the
kernel is in a critical switching phase where handling any synchronous
exception is practically impossible and prohibited.

If any synchronous exception or watchpoint does trigger in this narrow
window, it constitutes a fatal double fault and the kernel is expected
to die/panic immediately anyway. Therefore, the temporary biased value
in $tp is safe and acceptable here.

Additionally, evaluate the stack lookup as a single load instruction
"LONG_LPTR t0, a1, (TASK_STACK - TASK_STRUCT_OFFSET)", this perfectly
satisfies both 32-bit and 64-bit kernels. Using the "next" pointer in
a1 as the base register, rather than $tp, effectively unchains the data
dependency (RAW hazard) from the preceding move instruction, maximizing
the instruction-level parallelism and superscalar execution efficiency
while naturally adapting the structural shift.

With CONFIG_THREAD_INFO_IN_TASK enabled, the kernel stack life cycle is
decoupled from task_struct and can be freed concurrently.

Currently, show_stacktrace() reads raw stack data via __get_addr() and
subsequently calls show_backtrace() to unwind the frame, without holding
any reference to the target task's stack. If show_stacktrace() is called
on a concurrently exiting task, it could attempt to read from a freed or
reallocated kernel stack. This introduces a severe use-after-free (UAF)
read risk or kernel panics.

Wrap the entire stack inspection process inside show_stacktrace() with
a try_get_task_stack() and put_task_stack() pair. This ensures the task
stack remains pinned safely during both the raw stack data dump loop and
the subsequent stack unwinding phase.

Also, ensure that the task pointer is initialized to "current" early if
it is NULL, so that try_get_task_stack() always operates on a valid task
reference.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Like other architectures such as x86, arm64, riscv, powerpc and s390,
select THREAD_INFO_IN_TASK for LoongArch to move thread_info off the
stack into task_struct. This follows modern kernel standards and also
makes the system more secure.

With this patch, thread_info is included in task_struct at an offset
of 0 instead of being placed at the bottom of the kernel stack. Thus,
the $tp register points to both thread_info and task_struct.

To support this, introduce a per-CPU variable cpu_tasks to store the
pointer to the current task_struct. This decouples the recovery	of the
$tp register from the stack pointer during exception entry.

Then initialize cpu_tasks for the primary and secondary CPUs during
arch-specific setup and SMP boot paths. To eliminate the dangerous
windows during the early initialization where the cpu_tasks remains
uninitialized, set_current() is invoked as early as possible in both
setup_arch() and start_secondary(). This ensures the $tp recovery
barrier is armed in case any early boot exceptions or kernel panics
occur.

Modify SAVE_SOME and handle_syscall to restore the $tp register from
cpu_tasks, and also use the la_abs absolute addressing for cpu_tasks
access in assembly to bypass the relocation limits within exception
handling sections. By advancing the preservation of u0 in SAVE_SOME,
we reuse the PERCPU_BASE_KS value in u0 for the cpu_tasks calculation,
effectively eliminating a duplicate csrrd instruction execution on SMP
platforms.

Update &lt;asm/switch_to.h&gt; and &lt;kernel/switch.S&gt; to fully support the
CONFIG_THREAD_INFO_IN_TASK feature.

Remove the obsolete next_ti argument from __switch_to(), which shifts
the remaining arguments ahead in the calling convention (sched_ra from
a3 to a2, and sched_cfa from a4 to a3). Under the new configuration,
__switch_to() now directly derives the thread pointer ($tp) from the
next task_struct pointer in a1.

To preserve the optimal and clean "move tp, a1" path for 64-bit kernels,
the thread pointer ($tp) is assigned directly from a1 in the core path.
For 32-bit kernels, where a1 carries a 2000-byte structural pointer bias
at entry, an explicit adjustment "PTR_ADDI tp, tp, -TASK_STRUCT_OFFSET"
is introduced at the function exit.

In the context of __switch_to(), local interrupts are disabled, and the
kernel is in a critical switching phase where handling any synchronous
exception is practically impossible and prohibited.

If any synchronous exception or watchpoint does trigger in this narrow
window, it constitutes a fatal double fault and the kernel is expected
to die/panic immediately anyway. Therefore, the temporary biased value
in $tp is safe and acceptable here.

Additionally, evaluate the stack lookup as a single load instruction
"LONG_LPTR t0, a1, (TASK_STACK - TASK_STRUCT_OFFSET)", this perfectly
satisfies both 32-bit and 64-bit kernels. Using the "next" pointer in
a1 as the base register, rather than $tp, effectively unchains the data
dependency (RAW hazard) from the preceding move instruction, maximizing
the instruction-level parallelism and superscalar execution efficiency
while naturally adapting the structural shift.

With CONFIG_THREAD_INFO_IN_TASK enabled, the kernel stack life cycle is
decoupled from task_struct and can be freed concurrently.

Currently, show_stacktrace() reads raw stack data via __get_addr() and
subsequently calls show_backtrace() to unwind the frame, without holding
any reference to the target task's stack. If show_stacktrace() is called
on a concurrently exiting task, it could attempt to read from a freed or
reallocated kernel stack. This introduces a severe use-after-free (UAF)
read risk or kernel panics.

Wrap the entire stack inspection process inside show_stacktrace() with
a try_get_task_stack() and put_task_stack() pair. This ensures the task
stack remains pinned safely during both the raw stack data dump loop and
the subsequent stack unwinding phase.

Also, ensure that the task pointer is initialized to "current" early if
it is NULL, so that try_get_task_stack() always operates on a valid task
reference.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</pre>
</div>
</content>
</entry>
</feed>
