<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/source/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in current.h</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>51cb1aa1250c36269474b8b6ca6b6319e170f5a5 - Merge tag &apos;loongarch-7.2&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson</title>
        <link>http://kernelsources.org:8080/source/history/linux/arch/loongarch/include/asm/current.h#51cb1aa1250c36269474b8b6ca6b6319e170f5a5</link>
        <description>Merge tag &apos;loongarch-7.2&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongsonPull LoongArch updates from Huacai Chen: - Add THREAD_INFO_IN_TASK implementation - Add build salt to the vDSO - Add some BPF JIT inline helpers - Update DTS for I2C clocks and clock-frequency - Some bug fixes and other small changes* tag &apos;loongarch-7.2&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:  selftests/bpf: Test jited inline of bpf_get_smp_processor_id() for LoongArch  selftests/bpf: Test jited inline of bpf_get_current_task() for LoongArch  selftests/bpf: Add __arch_loongarch to limit test cases for LoongArch  selftests/bpf: Add get_preempt_count() support for LoongArch  LoongArch: dts: Add i2c clocks and clock-frequency properties to LS2K2000  LoongArch: dts: Add i2c clocks and clock-frequency properties to LS2K1000  LoongArch: dts: Add i2c clocks and clock-frequency properties to LS2K0500  LoongArch: BPF: Inline bpf_get_smp_processor_id() helper  LoongArch: BPF: Inline bpf_get_current_task/_btf() helpers  LoongArch: BPF: Fix off-by-one error in tail call  LoongArch: BPF: Fix outdated tail call comments  LoongArch: Add build salt to the vDSO  LoongArch: Fix nr passing in set_direct_map_valid_noflush()  LoongArch: Fix missing dirty page tracking in {pte,pmd}_wrprotect()  LoongArch: Move struct kimage forward declaration before use  LoongArch: Report dying CPU to RCU in stop_this_cpu()  LoongArch: Add PIO for early access before ACPI PCI root register  LoongArch: Add THREAD_INFO_IN_TASK implementation

            List of files:
            /linux/arch/loongarch/include/asm/current.h</description>
        <pubDate>Fri, 26 Jun 2026 17:42:49 +0200</pubDate>
        <dc:creator>Linus Torvalds &lt;torvalds@linux-foundation.org&gt;</dc:creator>
    </item>
<item>
        <title>7b5944d6ed369e43aeaf37beba9f89f7fb6c633b - LoongArch: Add THREAD_INFO_IN_TASK implementation</title>
        <link>http://kernelsources.org:8080/source/history/linux/arch/loongarch/include/asm/current.h#7b5944d6ed369e43aeaf37beba9f89f7fb6c633b</link>
        <description>LoongArch: Add THREAD_INFO_IN_TASK implementationLike other architectures such as x86, arm64, riscv, powerpc and s390,select THREAD_INFO_IN_TASK for LoongArch to move thread_info off thestack into task_struct. This follows modern kernel standards and alsomakes the system more secure.With this patch, thread_info is included in task_struct at an offsetof 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 thepointer 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 duringarch-specific setup and SMP boot paths. To eliminate the dangerouswindows during the early initialization where the cpu_tasks remainsuninitialized, set_current() is invoked as early as possible in bothsetup_arch() and start_secondary(). This ensures the $tp recoverybarrier is armed in case any early boot exceptions or kernel panicsoccur.Modify SAVE_SOME and handle_syscall to restore the $tp register fromcpu_tasks, and also use the la_abs absolute addressing for cpu_tasksaccess in assembly to bypass the relocation limits within exceptionhandling 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 SMPplatforms.Update &lt;asm/switch_to.h&gt; and &lt;kernel/switch.S&gt; to fully support theCONFIG_THREAD_INFO_IN_TASK feature.Remove the obsolete next_ti argument from __switch_to(), which shiftsthe remaining arguments ahead in the calling convention (sched_ra froma3 to a2, and sched_cfa from a4 to a3). Under the new configuration,__switch_to() now directly derives the thread pointer ($tp) from thenext task_struct pointer in a1.To preserve the optimal and clean &quot;move tp, a1&quot; 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 biasat entry, an explicit adjustment &quot;PTR_ADDI tp, tp, -TASK_STRUCT_OFFSET&quot;is introduced at the function exit.In the context of __switch_to(), local interrupts are disabled, and thekernel is in a critical switching phase where handling any synchronousexception is practically impossible and prohibited.If any synchronous exception or watchpoint does trigger in this narrowwindow, it constitutes a fatal double fault and the kernel is expectedto die/panic immediately anyway. Therefore, the temporary biased valuein $tp is safe and acceptable here.Additionally, evaluate the stack lookup as a single load instruction&quot;LONG_LPTR t0, a1, (TASK_STACK - TASK_STRUCT_OFFSET)&quot;, this perfectlysatisfies both 32-bit and 64-bit kernels. Using the &quot;next&quot; pointer ina1 as the base register, rather than $tp, effectively unchains the datadependency (RAW hazard) from the preceding move instruction, maximizingthe instruction-level parallelism and superscalar execution efficiencywhile naturally adapting the structural shift.With CONFIG_THREAD_INFO_IN_TASK enabled, the kernel stack life cycle isdecoupled from task_struct and can be freed concurrently.Currently, show_stacktrace() reads raw stack data via __get_addr() andsubsequently calls show_backtrace() to unwind the frame, without holdingany reference to the target task&apos;s stack. If show_stacktrace() is calledon a concurrently exiting task, it could attempt to read from a freed orreallocated kernel stack. This introduces a severe use-after-free (UAF)read risk or kernel panics.Wrap the entire stack inspection process inside show_stacktrace() witha try_get_task_stack() and put_task_stack() pair. This ensures the taskstack remains pinned safely during both the raw stack data dump loop andthe subsequent stack unwinding phase.Also, ensure that the task pointer is initialized to &quot;current&quot; early ifit is NULL, so that try_get_task_stack() always operates on a valid taskreference.Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;

            List of files:
            /linux/arch/loongarch/include/asm/current.h</description>
        <pubDate>Thu, 25 Jun 2026 07:03:47 +0200</pubDate>
        <dc:creator>Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;</dc:creator>
    </item>
</channel>
</rss>
