<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/loongarch, branch linux-6.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-12-14T10:40:47Z</updated>
<entry>
<title>LoongArch: Fix unsigned comparison with less than zero</title>
<updated>2022-12-14T10:40:47Z</updated>
<author>
<name>KaiLong Wang</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=773494a9aab439e3fa56223bf53ac8de6cb2e585'/>
<id>urn:sha1:773494a9aab439e3fa56223bf53ac8de6cb2e585</id>
<content type='text'>
[ Upstream commit b96e74bb439f096168c78ba3ba1599e0b85cfd73 ]

Eliminate the following coccicheck warning:

./arch/loongarch/kernel/unwind_prologue.c:84:5-13: WARNING: Unsigned
expression compared with zero: frame_ra &lt; 0

Signed-off-by: KaiLong Wang &lt;wangkailong@jari.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite()</title>
<updated>2022-12-14T10:40:47Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e887672ab158c34ff8fbbea251a0aed1f752b1fd'/>
<id>urn:sha1:e887672ab158c34ff8fbbea251a0aed1f752b1fd</id>
<content type='text'>
[ Upstream commit 54e6cd42a183b602e3627ad3aaeeed44f7443e67 ]

Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite().
Otherwise, _PAGE_DIRTY silences the TLB modify exception and make us
have no chance to mark a pmd/pte dirty (_PAGE_MODIFIED) for software.

Reviewed-by: Guo Ren &lt;guoren@kernel.org&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Combine acpi_boot_table_init() and acpi_boot_init()</title>
<updated>2022-12-14T10:40:47Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa67e6bfcea554d7186894e2b532d8ce7f886fba'/>
<id>urn:sha1:fa67e6bfcea554d7186894e2b532d8ce7f886fba</id>
<content type='text'>
[ Upstream commit 538eafc6deae12fbac5f277b89aa139b812bca49 ]

Combine acpi_boot_table_init() and acpi_boot_init() since they are very
simple, and we don't need to check the return value of acpi_boot_init().

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Makefile: Use "grep -E" instead of "egrep"</title>
<updated>2022-12-14T10:40:47Z</updated>
<author>
<name>Tiezhu Yang</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ef1edb864a8cea4bb29d84e7b240e9ec41f19be'/>
<id>urn:sha1:7ef1edb864a8cea4bb29d84e7b240e9ec41f19be</id>
<content type='text'>
[ Upstream commit 83f638bca0ccd94942bc3c4eb9bcec24dd8a1cf9 ]

The latest version of grep claims the egrep is now obsolete so the build
now contains warnings that look like:
	egrep: warning: egrep is obsolescent; using grep -E

Fix this up by changing the LoongArch Makefile to use "grep -E" instead.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Set _PAGE_DIRTY only if _PAGE_WRITE is set in {pmd,pte}_mkdirty()</title>
<updated>2022-12-02T16:43:13Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e19b63d000d0760163d3f625358e56434e7ad0e0'/>
<id>urn:sha1:e19b63d000d0760163d3f625358e56434e7ad0e0</id>
<content type='text'>
commit bf2f34a506e66e2979de6b17c337c5d4b25b4d2c upstream.

Now {pmd,pte}_mkdirty() set _PAGE_DIRTY bit unconditionally, this causes
random segmentation fault after commit 0ccf7f168e17bb7e ("mm/thp: carry
over dirty bit when thp splits on pmd").

The reason is: when fork(), parent process use pmd_wrprotect() to clear
huge page's _PAGE_WRITE and _PAGE_DIRTY (for COW); then pte_mkdirty() set
_PAGE_DIRTY as well as _PAGE_MODIFIED while splitting dirty huge pages;
once _PAGE_DIRTY is set, there will be no tlb modify exception so the COW
machanism fails; and at last memory corruption occurred between parent
and child processes.

So, we should set _PAGE_DIRTY only when _PAGE_WRITE is set in {pmd,pte}_
mkdirty().

Cc: stable@vger.kernel.org
Cc: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Clear FPU/SIMD thread info flags for kernel thread</title>
<updated>2022-12-02T16:43:13Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-11-21T11:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1c7b0c49084f7adc05bc9b015ef46933ec95c44'/>
<id>urn:sha1:a1c7b0c49084f7adc05bc9b015ef46933ec95c44</id>
<content type='text'>
commit e428e9613531d1ef6bd0d91352899712b29134fb upstream.

If a kernel thread is created by a user thread, it may carry FPU/SIMD
thread info flags (TIF_USEDFPU, TIF_USEDSIMD, etc.). Then it will be
considered as a fpu owner and kernel try to save its FPU/SIMD context
and cause such errors:

[   41.518931] do_fpu invoked from kernel context![#1]:
[   41.523933] CPU: 1 PID: 395 Comm: iou-wrk-394 Not tainted 6.1.0-rc5+ #217
[   41.530757] Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.pre-beta8 08/18/2022
[   41.544064] $ 0   : 0000000000000000 90000000011e9468 9000000106c7c000 9000000106c7fcf0
[   41.552101] $ 4   : 9000000106305d40 9000000106689800 9000000106c7fd08 0000000003995818
[   41.560138] $ 8   : 0000000000000001 90000000009a72e4 0000000000000020 fffffffffffffffc
[   41.568174] $12   : 0000000000000000 0000000000000000 0000000000000020 00000009aab7e130
[   41.576211] $16   : 00000000000001ff 0000000000000407 0000000000000001 0000000000000000
[   41.584247] $20   : 0000000000000000 0000000000000001 9000000106c7fd70 90000001002f0400
[   41.592284] $24   : 0000000000000000 900000000178f740 90000000011e9834 90000001063057c0
[   41.600320] $28   : 0000000000000000 0000000000000001 9000000006826b40 9000000106305140
[   41.608356] era   : 9000000000228848 _save_fp+0x0/0xd8
[   41.613542] ra    : 90000000011e9468 __schedule+0x568/0x8d0
[   41.619160] CSR crmd: 000000b0
[   41.619163] CSR prmd: 00000000
[   41.622359] CSR euen: 00000000
[   41.625558] CSR ecfg: 00071c1c
[   41.628756] CSR estat: 000f0000
[   41.635239] ExcCode : f (SubCode 0)
[   41.638783] PrId  : 0014c010 (Loongson-64bit)
[   41.643191] Modules linked in: acpi_ipmi vfat fat ipmi_si ipmi_devintf cfg80211 ipmi_msghandler rfkill fuse efivarfs
[   41.653734] Process iou-wrk-394 (pid: 395, threadinfo=0000000004ebe913, task=00000000636fa1be)
[   41.662375] Stack : 00000000ffff0875 9000000006800ec0 9000000006800ec0 90000000002d57e0
[   41.670412]         0000000000000001 0000000000000000 9000000106535880 0000000000000001
[   41.678450]         9000000105291800 0000000000000000 9000000105291838 900000000178e000
[   41.686487]         9000000106c7fd90 9000000106305140 0000000000000001 90000000011e9834
[   41.694523]         00000000ffff0875 90000000011f034c 9000000105291838 9000000105291830
[   41.702561]         0000000000000000 9000000006801440 00000000ffff0875 90000000002d48c0
[   41.710597]         9000000128800001 9000000106305140 9000000105291838 9000000105291838
[   41.718634]         9000000105291830 9000000107811740 9000000105291848 90000000009bf1e0
[   41.726672]         9000000105291830 9000000107811748 2d6b72772d756f69 0000000000343933
[   41.734708]         0000000000000000 0000000000000000 0000000000000000 0000000000000000
[   41.742745]         ...
[   41.745252] Call Trace:
[   42.197868] [&lt;9000000000228848&gt;] _save_fp+0x0/0xd8
[   42.205214] [&lt;90000000011ed468&gt;] __schedule+0x568/0x8d0
[   42.210485] [&lt;90000000011ed834&gt;] schedule+0x64/0xd4
[   42.215411] [&lt;90000000011f434c&gt;] schedule_timeout+0x88/0x188
[   42.221115] [&lt;90000000009c36d0&gt;] io_wqe_worker+0x184/0x350
[   42.226645] [&lt;9000000000221cf0&gt;] ret_from_kernel_thread+0xc/0x9c

This can be easily triggered by ltp testcase syscalls/io_uring02 and it
can also be easily fixed by clearing the FPU/SIMD thread info flags for
kernel threads in copy_thread().

Cc: stable@vger.kernel.org
Reported-by: Qi Hu &lt;huqi@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>LoongArch: Clean up loongson3_smp_ops declaration</title>
<updated>2022-09-29T02:15:00Z</updated>
<author>
<name>Yanteng Si</name>
</author>
<published>2022-09-27T04:34:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f196cb64b693c64f8f981432b1ff326b7ea1c28'/>
<id>urn:sha1:4f196cb64b693c64f8f981432b1ff326b7ea1c28</id>
<content type='text'>
Since loongson3_smp_ops is not used in LoongArch anymore, let's remove
it for cleanup.

Fixes: f2ac457a6138 ("LoongArch: Add CPU definition headers")
Signed-off-by: Yanteng Si &lt;siyanteng@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Fix and cleanup csr_era handling in do_ri()</title>
<updated>2022-09-29T02:15:00Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-09-26T14:33:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06e76acec70d1381b9a96e6014d5587d84201f82'/>
<id>urn:sha1:06e76acec70d1381b9a96e6014d5587d84201f82</id>
<content type='text'>
We don't emulate reserved instructions and just send a signal to the
current process now. So we don't need to call compute_return_era() to
add 4 (point to the next instruction) to csr_era in pt_regs. RA/ERA's
backup/restore is cleaned up as well.

Signed-off-by: Jun Yi &lt;yijun@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Align the address of kernel_entry to 4KB</title>
<updated>2022-09-29T02:15:00Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-09-26T14:25:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2938431e9338bf4e8d434513d3a5832d64c0fa8b'/>
<id>urn:sha1:2938431e9338bf4e8d434513d3a5832d64c0fa8b</id>
<content type='text'>
Align the address of kernel_entry to 4KB, to avoid early tlb miss
exception in case the entry code crosses page boundary.

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: mm: Remove the unneeded result variable</title>
<updated>2022-09-03T10:01:27Z</updated>
<author>
<name>ye xingchen</name>
</author>
<published>2022-08-26T07:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac9284db6b7b4af150940186b633a233d4ca2bed'/>
<id>urn:sha1:ac9284db6b7b4af150940186b633a233d4ca2bed</id>
<content type='text'>
Return the value pa_to_nid() directly instead of storing it in another
redundant variable.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
</feed>
