<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/loongarch/include/asm, 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: 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: 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: 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 section mismatch due to acpi_os_ioremap()</title>
<updated>2022-09-03T10:01:27Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-09-02T14:33:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e0fba87c854347007fb9fc873e890b686cc61302'/>
<id>urn:sha1:e0fba87c854347007fb9fc873e890b686cc61302</id>
<content type='text'>
Now acpi_os_ioremap() is marked with __init because it calls memblock_
is_memory() which is also marked with __init in the !ARCH_KEEP_MEMBLOCK
case. However, acpi_os_ioremap() is called by ordinary functions such
as acpi_os_{read, write}_memory() and causes section mismatch warnings:

WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_read_memory (section: .text) -&gt; acpi_os_ioremap (section: .init.text)
WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_write_memory (section: .text) -&gt; acpi_os_ioremap (section: .init.text)

Fix these warnings by selecting ARCH_KEEP_MEMBLOCK unconditionally and
removing the __init modifier of acpi_os_ioremap(). This can also give a
chance to track "memory" and "reserved" memblocks after early boot.

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Add subword xchg/cmpxchg emulation</title>
<updated>2022-08-25T11:34:59Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-08-25T11:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=720dc7ab252bbdf404cab7b909e26b31e602bf7e'/>
<id>urn:sha1:720dc7ab252bbdf404cab7b909e26b31e602bf7e</id>
<content type='text'>
LoongArch only support 32-bit/64-bit xchg/cmpxchg in native. But percpu
operation, qspinlock and some drivers need 8-bit/16-bit xchg/cmpxchg. We
add subword xchg/cmpxchg emulation in this patch because the emulation
has better performance than the generic implementation (on NUMA system),
and it can fix some build errors meanwhile [1].

LoongArch's guarantee for forward progress (avoid many ll/sc happening
at the same time and no one succeeds):

We have the "exclusive access (with timeout) of ll" feature to avoid
simultaneous ll (which also blocks other memory load/store on the same
address), and the "random delay of sc" feature to avoid simultaneous
sc. It is a mandatory requirement for multi-core LoongArch processors
to implement such features, only except those single-core and dual-core
processors (they also don't support multi-chip interconnection).

Feature bits are introduced in CPUCFG3, bit 3 and bit 4 [2].

[1] https://lore.kernel.org/loongarch/CAAhV-H6vvkuOzy8OemWdYK3taj5Jn3bFX0ZTwE=twM8ywpBUYA@mail.gmail.com/T/#t
[2] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg

Reported-by: Sudip Mukherjee (Codethink) &lt;sudipm.mukherjee@gmail.com&gt;
Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Rui Wang &lt;wangrui@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Cleanup headers to avoid circular dependency</title>
<updated>2022-08-25T11:34:59Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-08-25T11:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=092e9ebe52a664f9f58e2d24136ae791fe71c6db'/>
<id>urn:sha1:092e9ebe52a664f9f58e2d24136ae791fe71c6db</id>
<content type='text'>
When enable GENERIC_IOREMAP, there will be circular dependency to cause
build errors. The root cause is that pgtable.h shouldn't include io.h
but pgtable.h need some macros defined in io.h. So cleanup those macros
and remove the unnecessary inclusions, as other architectures do.

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Cleanup reset routines with new API</title>
<updated>2022-08-25T11:34:59Z</updated>
<author>
<name>Huacai Chen</name>
</author>
<published>2022-08-25T11:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da48b67cfb6b4f115ae652dd5995c56fe2a2cf9b'/>
<id>urn:sha1:da48b67cfb6b4f115ae652dd5995c56fe2a2cf9b</id>
<content type='text'>
Cleanup reset routines by using new do_kernel_power_off() instead of old
pm_power_off(), and then simplify the whole file (reset.c) organization
by inlining some functions. This cleanup also fix a poweroff error if EFI
runtime is disabled.

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>Merge tag 'irqchip-fixes-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent</title>
<updated>2022-08-18T15:37:22Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2022-08-18T15:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57646d6769f13f9484ffc6869c493e25a6568073'/>
<id>urn:sha1:57646d6769f13f9484ffc6869c493e25a6568073</id>
<content type='text'>
Pull irqchip fixes from Marc Zyngier:

  - A bunch of small fixes for the recently merged LoongArch drivers

  - A leftover from the non-SMP IRQ affinity rework affecting
    the Hyper-V IOMMU code

Link: https://lore.kernel.org/r/20220812125910.2227338-1-maz@kernel.org
</content>
</entry>
<entry>
<title>Merge tag 'loongarch-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson</title>
<updated>2022-08-12T16:44:23Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2022-08-12T16:44:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=999324f58c41262f5b64d04b7ac54e8f79b019fd'/>
<id>urn:sha1:999324f58c41262f5b64d04b7ac54e8f79b019fd</id>
<content type='text'>
Pull LoongArch updates from Huacai Chen:

 - Optimise getcpu() with vDSO

 - PCI enablement on top of pci &amp; irqchip changes

 - Stack unwinder and stack trace support

 - Some bug fixes and build error fixes

 - Update the default config file

* tag 'loongarch-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  docs/zh_CN/LoongArch: Add I14 description
  docs/LoongArch: Add I14 description
  LoongArch: Update Loongson-3 default config file
  LoongArch: Add USER_STACKTRACE support
  LoongArch: Add STACKTRACE support
  LoongArch: Add prologue unwinder support
  LoongArch: Add guess unwinder support
  LoongArch: Add vDSO syscall __vdso_getcpu()
  LoongArch: Add PCI controller support
  LoongArch: Parse MADT to get multi-processor information
  LoongArch: Jump to the link address before enable PG
  LoongArch: Requires __force attributes for any casts
  LoongArch: Fix unsigned comparison with less than zero
  LoongArch: Adjust arch/loongarch/Kconfig
  LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
</content>
</entry>
<entry>
<title>LoongArch: Add USER_STACKTRACE support</title>
<updated>2022-08-12T05:10:11Z</updated>
<author>
<name>Qing Zhang</name>
</author>
<published>2022-08-06T08:10:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d7bf939df08218e682f7a42952eee3bad4dceb7'/>
<id>urn:sha1:4d7bf939df08218e682f7a42952eee3bad4dceb7</id>
<content type='text'>
To get the best stacktrace output, you can compile your userspace
programs with frame pointers (at least glibc + the app you are tracing).

1, export "CC = gcc -fno-omit-frame-pointer";
2, compile your programs with "CC";
3, use uprobe to get stacktrace output.

...
     echo 'p:malloc /usr/lib64/libc.so.6:0x0a4704 size=%r4:u64' &gt; uprobe_events
     echo 'p:free /usr/lib64/libc.so.6:0x0a4d50 ptr=%r4:x64' &gt;&gt; uprobe_events
     echo 'comm == "demo"' &gt; ./events/uprobes/malloc/filter
     echo 'comm == "demo"' &gt; ./events/uprobes/free/filter
     echo 1 &gt; ./options/userstacktrace
     echo 1 &gt; ./options/sym-userobj
...

Signed-off-by: Qing Zhang &lt;zhangqing@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
</feed>
