<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/arch/loongarch, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/arch/loongarch?h=master</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/arch/loongarch?h=master'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2024-12-03T11:49:28Z</updated>
<entry>
<title>LoongArch: KVM: Protect kvm_io_bus_{read,write}() with SRCU</title>
<updated>2024-12-03T11:49:28Z</updated>
<author>
<name>Huacai Chen</name>
<email>chenhuacai@loongson.cn</email>
</author>
<published>2024-12-03T11:49:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7f71507851fc7764b36a3221839607d3a45c2025'/>
<id>urn:sha1:7f71507851fc7764b36a3221839607d3a45c2025</id>
<content type='text'>
When we enable lockdep we get such a warning:

 =============================
 WARNING: suspicious RCU usage
 6.12.0-rc7+ #1891 Tainted: G        W
 -----------------------------
 arch/loongarch/kvm/../../../virt/kvm/kvm_main.c:5945 suspicious rcu_dereference_check() usage!
 other info that might help us debug this:
 rcu_scheduler_active = 2, debug_locks = 1
 1 lock held by qemu-system-loo/948:
  #0: 90000001184a00a8 (&amp;vcpu-&gt;mutex){+.+.}-{4:4}, at: kvm_vcpu_ioctl+0xf4/0xe20 [kvm]
 stack backtrace:
 CPU: 2 UID: 0 PID: 948 Comm: qemu-system-loo Tainted: G        W          6.12.0-rc7+ #1891
 Tainted: [W]=WARN
 Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.0-prebeta9 10/21/2022
 Stack : 0000000000000089 9000000005a0db9c 90000000071519c8 900000012c578000
         900000012c57b940 0000000000000000 900000012c57b948 9000000007e53788
         900000000815bcc8 900000000815bcc0 900000012c57b7b0 0000000000000001
         0000000000000001 4b031894b9d6b725 0000000005dec000 9000000100427b00
         00000000000003d2 0000000000000001 000000000000002d 0000000000000003
         0000000000000030 00000000000003b4 0000000005dec000 0000000000000000
         900000000806d000 9000000007e53788 00000000000000b4 0000000000000004
         0000000000000004 0000000000000000 0000000000000000 9000000107baf600
         9000000008916000 9000000007e53788 9000000005924778 000000001fe001e5
         00000000000000b0 0000000000000007 0000000000000000 0000000000071c1d
         ...
 Call Trace:
 [&lt;9000000005924778&gt;] show_stack+0x38/0x180
 [&lt;90000000071519c4&gt;] dump_stack_lvl+0x94/0xe4
 [&lt;90000000059eb754&gt;] lockdep_rcu_suspicious+0x194/0x240
 [&lt;ffff80000221f47c&gt;] kvm_io_bus_read+0x19c/0x1e0 [kvm]
 [&lt;ffff800002225118&gt;] kvm_emu_mmio_read+0xd8/0x440 [kvm]
 [&lt;ffff8000022254bc&gt;] kvm_handle_read_fault+0x3c/0xe0 [kvm]
 [&lt;ffff80000222b3c8&gt;] kvm_handle_exit+0x228/0x480 [kvm]

Fix it by protecting kvm_io_bus_{read,write}() with SRCU.

Cc: stable@vger.kernel.org
Reviewed-by: Bibo Mao &lt;maobibo@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: KVM: Protect kvm_check_requests() with SRCU</title>
<updated>2024-12-02T08:42:10Z</updated>
<author>
<name>Huacai Chen</name>
<email>chenhuacai@loongson.cn</email>
</author>
<published>2024-12-02T08:42:10Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=589e6cc7597655bed7b8543b8286925f631f597c'/>
<id>urn:sha1:589e6cc7597655bed7b8543b8286925f631f597c</id>
<content type='text'>
When we enable lockdep we get such a warning:

 =============================
 WARNING: suspicious RCU usage
 6.12.0-rc7+ #1891 Tainted: G        W
 -----------------------------
 include/linux/kvm_host.h:1043 suspicious rcu_dereference_check() usage!
 other info that might help us debug this:
 rcu_scheduler_active = 2, debug_locks = 1
 1 lock held by qemu-system-loo/948:
  #0: 90000001184a00a8 (&amp;vcpu-&gt;mutex){+.+.}-{4:4}, at: kvm_vcpu_ioctl+0xf4/0xe20 [kvm]
 stack backtrace:
 CPU: 0 UID: 0 PID: 948 Comm: qemu-system-loo Tainted: G        W          6.12.0-rc7+ #1891
 Tainted: [W]=WARN
 Hardware name: Loongson Loongson-3A5000-7A1000-1w-CRB/Loongson-LS3A5000-7A1000-1w-CRB, BIOS vUDK2018-LoongArch-V2.0.0-prebeta9 10/21/2022
 Stack : 0000000000000089 9000000005a0db9c 90000000071519c8 900000012c578000
         900000012c57b920 0000000000000000 900000012c57b928 9000000007e53788
         900000000815bcc8 900000000815bcc0 900000012c57b790 0000000000000001
         0000000000000001 4b031894b9d6b725 0000000004dec000 90000001003299c0
         0000000000000414 0000000000000001 000000000000002d 0000000000000003
         0000000000000030 00000000000003b4 0000000004dec000 90000001184a0000
         900000000806d000 9000000007e53788 00000000000000b4 0000000000000004
         0000000000000004 0000000000000000 0000000000000000 9000000107baf600
         9000000008916000 9000000007e53788 9000000005924778 0000000010000044
         00000000000000b0 0000000000000004 0000000000000000 0000000000071c1d
         ...
 Call Trace:
 [&lt;9000000005924778&gt;] show_stack+0x38/0x180
 [&lt;90000000071519c4&gt;] dump_stack_lvl+0x94/0xe4
 [&lt;90000000059eb754&gt;] lockdep_rcu_suspicious+0x194/0x240
 [&lt;ffff8000022143bc&gt;] kvm_gfn_to_hva_cache_init+0xfc/0x120 [kvm]
 [&lt;ffff80000222ade4&gt;] kvm_pre_enter_guest+0x3a4/0x520 [kvm]
 [&lt;ffff80000222b3dc&gt;] kvm_handle_exit+0x23c/0x480 [kvm]

Fix it by protecting kvm_check_requests() with SRCU.

Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: BPF: Adjust the parameter of emit_jirl()</title>
<updated>2024-12-02T08:42:08Z</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2024-12-02T08:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c1474bb0b7cff4e8481095bd0618b8f6c2f0aeb4'/>
<id>urn:sha1:c1474bb0b7cff4e8481095bd0618b8f6c2f0aeb4</id>
<content type='text'>
The branch instructions beq, bne, blt, bge, bltu, bgeu and jirl belong
to the format reg2i16, but the sequence of oprand is different for the
instruction jirl. So adjust the parameter order of emit_jirl() to make
it more readable correspond with the Instruction Set Architecture manual.

Here are the instruction formats:

  beq     rj, rd, offs16
  bne     rj, rd, offs16
  blt     rj, rd, offs16
  bge     rj, rd, offs16
  bltu    rj, rd, offs16
  bgeu    rj, rd, offs16
  jirl    rd, rj, offs16

Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#branch-instructions
Suggested-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Add architecture specific huge_pte_clear()</title>
<updated>2024-12-02T08:42:08Z</updated>
<author>
<name>Bibo Mao</name>
<email>maobibo@loongson.cn</email>
</author>
<published>2024-12-02T08:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7cd1f5f77925ae905a57296932f0f9ef0dc364f8'/>
<id>urn:sha1:7cd1f5f77925ae905a57296932f0f9ef0dc364f8</id>
<content type='text'>
When executing mm selftests run_vmtests.sh, there is such an error:

 BUG: Bad page state in process uffd-unit-tests  pfn:00000
 page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x0
 flags: 0xffff0000002000(reserved|node=0|zone=0|lastcpupid=0xffff)
 raw: 00ffff0000002000 ffffbf0000000008 ffffbf0000000008 0000000000000000
 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
 page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set
 Modules linked in: snd_seq_dummy snd_seq snd_seq_device rfkill vfat fat
    virtio_balloon efi_pstore virtio_net pstore net_failover failover fuse
    nfnetlink virtio_scsi virtio_gpu virtio_dma_buf dm_multipath efivarfs
 CPU: 2 UID: 0 PID: 1913 Comm: uffd-unit-tests Not tainted 6.12.0 #184
 Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022
 Stack : 900000047c8ac000 0000000000000000 9000000000223a7c 900000047c8ac000
         900000047c8af690 900000047c8af698 0000000000000000 900000047c8af7d8
         900000047c8af7d0 900000047c8af7d0 900000047c8af5b0 0000000000000001
         0000000000000001 900000047c8af698 10b3c7d53da40d26 0000010000000000
         0000000000000022 0000000fffffffff fffffffffe000000 ffff800000000000
         000000000000002f 0000800000000000 000000017a6d4000 90000000028f8940
         0000000000000000 0000000000000000 90000000025aa5e0 9000000002905000
         0000000000000000 90000000028f8940 ffff800000000000 0000000000000000
         0000000000000000 0000000000000000 9000000000223a94 000000012001839c
         00000000000000b0 0000000000000004 0000000000000000 0000000000071c1d
         ...
 Call Trace:
 [&lt;9000000000223a94&gt;] show_stack+0x5c/0x180
 [&lt;9000000001c3fd64&gt;] dump_stack_lvl+0x6c/0xa0
 [&lt;900000000056aa08&gt;] bad_page+0x1a0/0x1f0
 [&lt;9000000000574978&gt;] free_unref_folios+0xbf0/0xd20
 [&lt;90000000004e65cc&gt;] folios_put_refs+0x1a4/0x2b8
 [&lt;9000000000599a0c&gt;] free_pages_and_swap_cache+0x164/0x260
 [&lt;9000000000547698&gt;] tlb_batch_pages_flush+0xa8/0x1c0
 [&lt;9000000000547f30&gt;] tlb_finish_mmu+0xa8/0x218
 [&lt;9000000000543cb8&gt;] exit_mmap+0x1a0/0x360
 [&lt;9000000000247658&gt;] __mmput+0x78/0x200
 [&lt;900000000025583c&gt;] do_exit+0x43c/0xde8
 [&lt;9000000000256490&gt;] do_group_exit+0x68/0x110
 [&lt;9000000000256554&gt;] sys_exit_group+0x1c/0x20
 [&lt;9000000001c413b4&gt;] do_syscall+0x94/0x130
 [&lt;90000000002216d8&gt;] handle_syscall+0xb8/0x158
 Disabling lock debugging due to kernel taint
 BUG: non-zero pgtables_bytes on freeing mm: -16384

On LoongArch system, invalid huge pte entry should be invalid_pte_table
or a single _PAGE_HUGE bit rather than a zero value. And it should be
the same with invalid pmd entry, since pmd_none() is called by function
free_pgd_range() and pmd_none() return 0 by huge_pte_clear(). So single
_PAGE_HUGE bit is also treated as a valid pte table and free_pte_range()
will be called in free_pmd_range().

  free_pmd_range()
        pmd = pmd_offset(pud, addr);
        do {
                next = pmd_addr_end(addr, end);
                if (pmd_none_or_clear_bad(pmd))
                        continue;
                free_pte_range(tlb, pmd, addr);
        } while (pmd++, addr = next, addr != end);

Here invalid_pte_table is used for both invalid huge pte entry and
pmd entry.

Cc: stable@vger.kernel.org
Fixes: 09cfefb7fa70 ("LoongArch: Add memory management")
Signed-off-by: Bibo Mao &lt;maobibo@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch/irq: Use seq_put_decimal_ull_width() for decimal values</title>
<updated>2024-12-02T08:42:08Z</updated>
<author>
<name>David Wang</name>
<email>00107082@163.com</email>
</author>
<published>2024-12-02T08:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=ad2a05a6d287aef7e069c06e329f1355756415c2'/>
<id>urn:sha1:ad2a05a6d287aef7e069c06e329f1355756415c2</id>
<content type='text'>
Performance improvement for reading /proc/interrupts on LoongArch.

On a system with n CPUs and m interrupts, there will be n*m decimal
values yielded via seq_printf(.."%10u "..) which is less efficient than
seq_put_decimal_ull_width(), stress reading /proc/interrupts indicates
~30% performance improvement with this patch (and its friends).

Signed-off-by: David Wang &lt;00107082@163.com&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: Fix reserving screen info memory for above-4G firmware</title>
<updated>2024-12-02T08:42:07Z</updated>
<author>
<name>Huacai Chen</name>
<email>chenhuacai@loongson.cn</email>
</author>
<published>2024-12-02T08:42:07Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=55dc2f8f263448f1e6c7ef135d08e640d5a4826e'/>
<id>urn:sha1:55dc2f8f263448f1e6c7ef135d08e640d5a4826e</id>
<content type='text'>
Since screen_info.lfb_base is a __u32 type, an above-4G address need an
ext_lfb_base to present its higher 32bits. In init_screen_info() we can
use __screen_info_lfb_base() to handle this case for reserving screen
info memory.

Signed-off-by: Xuefeng Zhao &lt;zhaoxuefeng@loongson.cn&gt;
Signed-off-by: Jianmin Lv &lt;lvjianmin@loongson.cn&gt;
Signed-off-by: Tianyang Zhang &lt;zhangtianyang@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>Merge tag 'dmaengine-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine</title>
<updated>2024-11-27T21:25:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-27T21:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=7536c1a50ea592967b0db8292b44d4b86bca35bc'/>
<id>urn:sha1:7536c1a50ea592967b0db8292b44d4b86bca35bc</id>
<content type='text'>
Pull dmaengine updates from Vinod Koul:
 "New hardware support:

   - Qualcomm SAR2130P GPI dma support

   - Sifive PIC64GX pdma support

   - Rcar r7s72100 support and associated updates

  Updates:

   - STM32 DMA3 updates for packing/unpacking mode and prevention of
     additional xfers

   - Simplification of devm_acpi_dma_controller_register() and associate
     cleanup including headers

   - loongson prefix renames

   - Switch back to platform_driver::remove() subsystem update"

* tag 'dmaengine-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
  dmaengine: loongson2-apb: Rename the prefix ls2x to loongson2
  dt-bindings: dma: sifive pdma: Add PIC64GX to compatibles
  dmaengine: fix typo in the comment
  dmaengine: stm32-dma3: clamp AXI burst using match data
  dmaengine: stm32-dma3: prevent LL refactoring thanks to DT configuration
  dt-bindings: dma: stm32-dma3: prevent additional transfers
  dmaengine: stm32-dma3: refactor HW linked-list to optimize memory accesses
  dmaengine: stm32-dma3: prevent pack/unpack thanks to DT configuration
  dt-bindings: dma: stm32-dma3: prevent packing/unpacking mode
  dmaengine: idxd: Move DSA/IAA device IDs to IDXD driver
  dt-bindings: dma: qcom,gpi: Add SAR2130P compatible
  dmaengine: Switch back to struct platform_driver::remove()
  dmaengine: ep93xx: Fix unsigned compared against 0
  dmaengine: acpi: Clean up headers
  dmaengine: acpi: Simplify devm_acpi_dma_controller_register()
  dmaengine: acpi: Drop unused devm_acpi_dma_controller_free()
  dmaengine: sh: rz-dmac: add r7s72100 support
  dt-bindings: dma: rz-dmac: Document RZ/A1H SoC
</content>
</entry>
<entry>
<title>Merge tag 'loongarch-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson</title>
<updated>2024-11-27T19:15:27Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-27T19:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c94696977527f69cbb41aa6a9af9d1991895d002'/>
<id>urn:sha1:c94696977527f69cbb41aa6a9af9d1991895d002</id>
<content type='text'>
Pull LoongArch updates from Huacai Chen:

 - Fix build failure with GCC 15 due to default -std=gnu23

 - Add PREEMPT_RT/PREEMPT_LAZY support

 - Add I2S in DTS for Loongson-2K1000/Loongson-2K2000

 - Some bug fixes and other small changes

* tag 'loongarch-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: Update Loongson-3 default config file
  LoongArch: dts: Add I2S support to Loongson-2K2000
  LoongArch: dts: Add I2S support to Loongson-2K1000
  LoongArch: Allow to enable PREEMPT_LAZY
  LoongArch: Allow to enable PREEMPT_RT
  LoongArch: Select HAVE_POSIX_CPU_TIMERS_TASK_WORK
  LoongArch: Fix sleeping in atomic context for PREEMPT_RT
  LoongArch: Reduce min_delta for the arch clockevent device
  LoongArch: BPF: Sign-extend return values
  LoongArch: Fix build failure with GCC 15 (-std=gnu23)
  LoongArch: Explicitly specify code model in Makefile
</content>
</entry>
<entry>
<title>LoongArch: Update Loongson-3 default config file</title>
<updated>2024-11-26T10:06:54Z</updated>
<author>
<name>Huacai Chen</name>
<email>chenhuacai@loongson.cn</email>
</author>
<published>2024-11-26T10:06:54Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3c272a7551af1c10f6dbba0e71add7dccc7733fa'/>
<id>urn:sha1:3c272a7551af1c10f6dbba0e71add7dccc7733fa</id>
<content type='text'>
1, Enable ACPI_BGRT.
2, Enable MODULE COMPRESS.
3, Enable common DM targets.
4, Enable FS_ENCRYPTION and FS_VERITY.
5, Enable CPUFreq governors and drivers.
6, Enable PVPANIC MMIO and PCI drivers.
7, Enable some HID input drivers.
8, Enable some ASoC codec drivers.
9, Enable some Realtek WiFi drivers.
10, Remove some obsolete config options.

Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
<entry>
<title>LoongArch: dts: Add I2S support to Loongson-2K2000</title>
<updated>2024-11-26T10:06:08Z</updated>
<author>
<name>Binbin Zhou</name>
<email>zhoubinbin@loongson.cn</email>
</author>
<published>2024-11-22T07:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=900f6267e9e39f9f601f5eaf0ea32d620b9130d2'/>
<id>urn:sha1:900f6267e9e39f9f601f5eaf0ea32d620b9130d2</id>
<content type='text'>
The module is supported, adding it.

Not all Loongson-2K1000 boards have an i2s interface, here is an example
of enabling it:

sound {
	compatible = "loongson,ls-audio-card";
	model = "Loongson-ASoC";
	mclk-fs = &lt;512&gt;;

	cpu {
		sound-dai = &lt;&amp;i2s&gt;;
	};

	codec {
		sound-dai = &lt;&amp;es8323&gt;;
	};
};

&amp;i2c1 {
	status = "okay";
	#address-cells = &lt;1&gt;;
	#size-cells = &lt;0&gt;;

	es8323:es8323@10 {
		compatible = "everest,es8323";
		reg = &lt;0x10&gt;;
		#sound-dai-cells = &lt;0&gt;;
	};
};

&amp;i2s {
	status = "okay";

	clock-frequency = &lt;175000000&gt;;
	#sound-dai-cells = &lt;0&gt;;
};

Signed-off-by: Binbin Zhou &lt;zhoubinbin@loongson.cn&gt;
Signed-off-by: Huacai Chen &lt;chenhuacai@loongson.cn&gt;
</content>
</entry>
</feed>
