Skip to content

Conversation

@RevySR
Copy link

@RevySR RevySR commented Nov 24, 2025

No description provided.

RevySR and others added 30 commits November 25, 2025 00:55
Existing rv64 hardware conforms to the rva20 profile.

Ziccrse is an additional extension required by the rva20 profile, so
th1520 has this extension.

Signed-off-by: Han Gao <[email protected]>
Reviewed-by: Drew Fustini <[email protected]>
Link: https://lore.kernel.org/r/71ac2ff73a63bd8674c4bc91fd287390d5339609.1758228055.git.rabenda.cn@gmail.com
Signed-off-by: Han Gao <[email protected]>
th1520 support Zfh ISA extension.
It supports the same RISC-V extensions as SG2042.

commit cb074be ("riscv: dts: sophgo: add zfh for sg2042")

Signed-off-by: Han Gao <[email protected]>
Reviewed-by: Drew Fustini <[email protected]>
Link: https://lore.kernel.org/r/38abc793c2fcb9dd26c89bab10dd4450d91ced4c.1758228055.git.rabenda.cn@gmail.com
Signed-off-by: Han Gao <[email protected]>
…s clock

Add binding ID for C910 bus clock, which takes CLK_C910 as parent and is
essential for C910 cluster's operation.

Signed-off-by: Yao Zi <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
…lity

All PLLs found on TH1520 SoC take 21250ns at maximum to lock, and their
lock status is indicated by register PLL_STS (offset 0x80 inside AP
clock controller). We should poll the register to ensure the PLL
actually locks after enabling it.

Furthermore, a 30us delay is added after enabling the PLL, after which
the PLL could be considered stable as stated by vendor clock code.

Fixes: 56a48c1 ("clk: thead: add support for enabling/disabling PLLs")
Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
This divider takes c910_clk as parent and is essential for the C910
cluster to operate, thus is marked as CLK_IS_CRITICAL.

Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
TH1520 ships several PLLs that could operate in either integer or
fractional mode. However, the TRM only lists a few configuration whose
stability is considered guaranteed.

Add a table-lookup rate determination logic to support PLL rate setting,
and fill up frequency-configuration tables for AP-subsystem PLLs.

Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
…h flags

The new macro, TH_CCU_MUX_FLAGS, extends TH_CCU_MUX macro by adding two
parameters to specify clock flags and multiplexer flags.

Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
On TH1520 SoC, c910_clk feeds the CPU cluster. It could be glitchlessly
reparented to one of the two PLLs: either to cpu_pll0 indirectly through
c910_i0_clk, or to cpu_pll1 directly.

To achieve glitchless rate change, customized clock operations are
implemented for c910_clk: on rate change, the PLL not currently in use
is configured to the requested rate first, then c910_clk reparents to
it.

Additionally, c910_bus_clk, which in turn takes c910_clk as parent,
has a frequency limit of 750MHz. A clock notifier is registered on
c910_clk to adjust c910_bus_clk on c910_clk rate change.

Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
Add operating point table for CPU cores, and wire up clocks for CPU
nodes.

This patch isn't intended for upstreaming but only for testing purpose,
since the PMIC driver for scaling CPU voltage isn't ready yet. Only
operating points whose voltage is satisified by Lichee Module 4A's PMIC
default, i.e. <= 1.5GHz, are enabled.

Signed-off-by: Yao Zi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
VeriSilicon is a Silicon IP vendor, which is the current owner of
Vivante series video-related IPs and Hantro series video codec IPs.

Add a vendor prefix for this company.

Signed-off-by: Icenowy Zheng <[email protected]>
Acked-by: Rob Herring (Arm) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
Verisilicon has a series of display controllers prefixed with DC and
with self-identification facility like their GC series GPUs.

Add a device tree binding for it.

Depends on the specific DC model, it can have either one or two display
outputs, and each display output could be set to DPI signal or "DP"
signal (which seems to be some plain parallel bus to HDMI controllers).

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
…rollers

This is a from-scratch driver targeting Verisilicon DC-series display
controllers, which feature self-identification functionality like their
GC-series GPUs.

Only DC8200 is being supported now, and only the main framebuffer is set
up (as the DRM primary plane). Support for more DC models and more
features is my further targets.

As the display controller is delivered to SoC vendors as a whole part,
this driver does not use component framework and extra bridges inside a
SoC is expected to be implemented as dedicated bridges (this driver
properly supports bridge chaining).

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
…ntroller

T-Head TH1520 SoC contains a Synopsys DesignWare HDMI controller paired
with DesignWare HDMI PHY, with an extra clock gate for HDMI pixel clock
and two reset controls.

Add a device tree binding to it.

Signed-off-by: Icenowy Zheng <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
T-Head TH1520 SoC contains a Synopsys DesignWare HDMI controller (paired
with DesignWare HDMI TX PHY Gen2) that takes the "DP" output from the
display controller.

Add a driver for this controller utilizing the common DesignWare HDMI
code in the kernel.

Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
T-Head TH1520 SoC contains a Verisilicon DC8200 display controller
(called DPU in manual) and a Synopsys DesignWare HDMI TX controller.

Add device tree nodes to them.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
Lichee Pi 4A board features a HDMI Type-A connector connected to the
HDMI TX controller of TH1520 SoC.

Add a device tree node describing the connector, connect it to the HDMI
controller, and enable everything on this display pipeline.

Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
… driver

As I am the author of this rewritten driver, it makes sense for me to be
the maintainer.

Confirm this in MAINTAINERS file.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
Map all mail addresses Icenowy Zheng had used to the personal mailbox
prefixed "uwu".

All these mailboxes, except the one of Sipeed (which was only used
during a summer vacation internship), can accept mails now.

Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Icenowy Zheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
T-HEAD TH1520 platform's USB has a wrapper module around
the DesignWare USB3 DRD controller. Add binding information doc for
it.

Signed-off-by: Jisheng Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
Adds TH1520 Glue layer to support USB controller on T-HEAD TH1520 SoC.
There is a DesignWare USB3 DRD core in TH1520 SoCs, the dwc3 core is
the child of this USB wrapper module device.

Signed-off-by: Jisheng Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Han Gao: fix build in 6.18 ]
Signed-off-by: Han Gao <[email protected]>
T-HEAD SoCs such as the TH1520 contain a PWM controller used
to control the LCD backlight, fan and so on.

Signed-off-by: Jisheng Zhang <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Han Gao <[email protected]>
T-HEAD SoCs such as the TH1520 contain a PWM controller used
to control the LCD backlight, fan and so on. Add driver for it.

Signed-off-by: Jisheng Zhang <[email protected]>
Tested-by: Thomas Bonnefille <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Han Gao: fix build in 6.18 ]
Signed-off-by: Han Gao <[email protected]>
From: revyos@882a91b

Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Emil Renner Berthing <[email protected]>
[ Han Gao: use clk pwm ]
Signed-off-by: Han Gao <[email protected]>
Signed-off-by: Jisheng Zhang <[email protected]>
[esmil: add fan pinctrl]
Signed-off-by: Emil Renner Berthing <[email protected]>
Signed-off-by: Han Gao <[email protected]>
From: revyos@2bd7874

Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Emil Renner Berthing <[email protected]>
Signed-off-by: Han Gao <[email protected]>
From: revyos@ef4ac92

Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Emil Renner Berthing <[email protected]>
Signed-off-by: Han Gao <[email protected]>
xhackerustc and others added 3 commits November 25, 2025 00:55
From: revyos@9f2a969

Signed-off-by: Jisheng Zhang <[email protected]>
[esmil: fix gpio references]
Signed-off-by: Emil Renner Berthing <[email protected]>
[ Han Gao: remove audio_i2c ]
Signed-off-by: Han Gao <[email protected]>
From: revyos@fe55f7b
HACK patch for compatibility with thead-u-boot and vendor opensbi

Signed-off-by: Han Gao <[email protected]>
[Icenowy: preserve the original compatible to allow Linux to match]
Signed-off-by: Icenowy Zheng <[email protected]>
From: revyos@1e57185
HACK patch for compatibility with thead-u-boot and vendor opensbi

Signed-off-by: Han Gao <[email protected]>
[Icenowy: remove the interrupt-controller property]
Signed-off-by: Icenowy Zheng <[email protected]>
@RevySR RevySR force-pushed the rv/6.18.y/th1520/dev branch from 603e3ba to e0e2cd2 Compare November 24, 2025 16:56
AirFortressIlikara pushed a commit that referenced this pull request Nov 26, 2025
Use BPF_TRAMP_F_INDIRECT flag to detect struct ops and emit proper
prologue and epilogue for this case.

With this patch, all of the struct_ops related testcases (except
struct_ops_multi_pages) passed on LoongArch.

The testcase struct_ops_multi_pages failed is because the actual
image_pages_cnt is 40 which is bigger than MAX_TRAMP_IMAGE_PAGES.

Before:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  WATCHDOG: test case struct_ops_module/struct_ops_load executes for 10 seconds...

After:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  #15      bad_struct_ops:OK
  ...
  torvalds#399     struct_ops_autocreate:OK
  ...
  torvalds#400     struct_ops_kptr_return:OK
  ...
  torvalds#401     struct_ops_maybe_null:OK
  ...
  torvalds#402     struct_ops_module:OK
  ...
  torvalds#404     struct_ops_no_cfi:OK
  ...
  torvalds#405     struct_ops_private_stack:SKIP
  ...
  torvalds#406     struct_ops_refcounted:OK
  Summary: 8/25 PASSED, 3 SKIPPED, 0 FAILED

Signed-off-by: Tiezhu Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Signed-off-by: maoxiaochuan <[email protected]>
MingcongBai pushed a commit that referenced this pull request Nov 26, 2025
The namespaces can access the controller's admin request_queue, and
stale references on the namespaces may exist after tearing down the
controller. Ensure the admin request_queue is active by moving the
controller's 'put' to after all controller references have been released
to ensure no one is can access the request_queue. This fixes a reported
use-after-free bug:

  BUG: KASAN: slab-use-after-free in blk_queue_enter+0x41c/0x4a0
  Read of size 8 at addr ffff88c0a53819f8 by task nvme/3287
  CPU: 67 UID: 0 PID: 3287 Comm: nvme Tainted: G            E       6.13.2-ga1582f1a031e #15
  Tainted: [E]=UNSIGNED_MODULE
  Hardware name: Jabil /EGS 2S MB1, BIOS 1.00 06/18/2025
  Call Trace:
   <TASK>
   dump_stack_lvl+0x4f/0x60
   print_report+0xc4/0x620
   ? _raw_spin_lock_irqsave+0x70/0xb0
   ? _raw_read_unlock_irqrestore+0x30/0x30
   ? blk_queue_enter+0x41c/0x4a0
   kasan_report+0xab/0xe0
   ? blk_queue_enter+0x41c/0x4a0
   blk_queue_enter+0x41c/0x4a0
   ? __irq_work_queue_local+0x75/0x1d0
   ? blk_queue_start_drain+0x70/0x70
   ? irq_work_queue+0x18/0x20
   ? vprintk_emit.part.0+0x1cc/0x350
   ? wake_up_klogd_work_func+0x60/0x60
   blk_mq_alloc_request+0x2b7/0x6b0
   ? __blk_mq_alloc_requests+0x1060/0x1060
   ? __switch_to+0x5b7/0x1060
   nvme_submit_user_cmd+0xa9/0x330
   nvme_user_cmd.isra.0+0x240/0x3f0
   ? force_sigsegv+0xe0/0xe0
   ? nvme_user_cmd64+0x400/0x400
   ? vfs_fileattr_set+0x9b0/0x9b0
   ? cgroup_update_frozen_flag+0x24/0x1c0
   ? cgroup_leave_frozen+0x204/0x330
   ? nvme_ioctl+0x7c/0x2c0
   blkdev_ioctl+0x1a8/0x4d0
   ? blkdev_common_ioctl+0x1930/0x1930
   ? fdget+0x54/0x380
   __x64_sys_ioctl+0x129/0x190
   do_syscall_64+0x5b/0x160
   entry_SYSCALL_64_after_hwframe+0x4b/0x53
  RIP: 0033:0x7f765f703b0b
  Code: ff ff ff 85 c0 79 9b 49 c7 c4 ff ff ff ff 5b 5d 4c 89 e0 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d dd 52 0f 00 f7 d8 64 89 01 48
  RSP: 002b:00007ffe2cefe808 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
  RAX: ffffffffffffffda RBX: 00007ffe2cefe860 RCX: 00007f765f703b0b
  RDX: 00007ffe2cefe860 RSI: 00000000c0484e41 RDI: 0000000000000003
  RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000000000000
  R10: 00007f765f611d50 R11: 0000000000000202 R12: 0000000000000003
  R13: 00000000c0484e41 R14: 0000000000000001 R15: 00007ffe2cefea60
   </TASK>

Reported-by: Casey Chen <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
@MingcongBai
Copy link

Picked to aosc/v6.18-rc7, thanks!

MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 97588d21a38c430e497c4fce8e89243c8a65a12b).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 97588d21a38c430e497c4fce8e89243c8a65a12b).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 415ba9a351fe9e2fe2f8a522331e7b997b998d2c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 415ba9a351fe9e2fe2f8a522331e7b997b998d2c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- (riscv64) Enable TH1520 options.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (amd64) Enable DEBUG_INFO_BTF.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- (riscv64) Enable TH1520 options.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 26, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- (amd64) Enable DEBUG_INFO_BTF.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- (riscv64) Enable TH1520 options.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 27, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- Fix stmmac-phytium again against latest STMMAC changes in net-next.
- (amd64) Enable DEBUG_INFO_BTF.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- (riscv64) Enable TH1520 options.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Nov 28, 2025
- Refresh YT6801 patches (suspend/resume v5, YT6801 v3).
- Add patches for pre-upstream TH1520 support (AOSC-Tracking/linux#15).
- Drop broken KVM AVEC patch and unneeded AVEC IRQ redirect patch.
- Fix stmmac-phytium again against latest STMMAC changes in net-next.
- (amd64) Enable DEBUG_INFO_BTF.
- (loongarch64) Enable ZBOOT, disable broken PATA_LEGACY.
- (riscv64) Enable TH1520 options.
- Refresh all configurations.
- Track patches at AOSC-Tracking/linux @ aosc/v6.18-rc7
  (HEAD: 1db9d99ccffa495041850bd1a8d8a3c2fa82a23c).
AirFortressIlikara pushed a commit that referenced this pull request Nov 29, 2025
Use BPF_TRAMP_F_INDIRECT flag to detect struct ops and emit proper
prologue and epilogue for this case.

With this patch, all of the struct_ops related testcases (except
struct_ops_multi_pages) passed on LoongArch.

The testcase struct_ops_multi_pages failed is because the actual
image_pages_cnt is 40 which is bigger than MAX_TRAMP_IMAGE_PAGES.

Before:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  WATCHDOG: test case struct_ops_module/struct_ops_load executes for 10 seconds...

After:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  #15      bad_struct_ops:OK
  ...
  torvalds#399     struct_ops_autocreate:OK
  ...
  torvalds#400     struct_ops_kptr_return:OK
  ...
  torvalds#401     struct_ops_maybe_null:OK
  ...
  torvalds#402     struct_ops_module:OK
  ...
  torvalds#404     struct_ops_no_cfi:OK
  ...
  torvalds#405     struct_ops_private_stack:SKIP
  ...
  torvalds#406     struct_ops_refcounted:OK
  Summary: 8/25 PASSED, 3 SKIPPED, 0 FAILED

Signed-off-by: Tiezhu Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Signed-off-by: maoxiaochuan <[email protected]>
AirFortressIlikara pushed a commit that referenced this pull request Nov 29, 2025
Use BPF_TRAMP_F_INDIRECT flag to detect struct ops and emit proper
prologue and epilogue for this case.

With this patch, all of the struct_ops related testcases (except
struct_ops_multi_pages) passed on LoongArch.

The testcase struct_ops_multi_pages failed is because the actual
image_pages_cnt is 40 which is bigger than MAX_TRAMP_IMAGE_PAGES.

Before:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  WATCHDOG: test case struct_ops_module/struct_ops_load executes for 10 seconds...

After:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  #15      bad_struct_ops:OK
  ...
  torvalds#399     struct_ops_autocreate:OK
  ...
  torvalds#400     struct_ops_kptr_return:OK
  ...
  torvalds#401     struct_ops_maybe_null:OK
  ...
  torvalds#402     struct_ops_module:OK
  ...
  torvalds#404     struct_ops_no_cfi:OK
  ...
  torvalds#405     struct_ops_private_stack:SKIP
  ...
  torvalds#406     struct_ops_refcounted:OK
  Summary: 8/25 PASSED, 3 SKIPPED, 0 FAILED

Signed-off-by: Tiezhu Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Signed-off-by: maoxiaochuan <[email protected]>
AirFortressIlikara pushed a commit that referenced this pull request Nov 30, 2025
[ Upstream commit 48918ca ]

The test starts a workload and then opens events. If the events fail
to open, for example because of perf_event_paranoid, the gopipe of the
workload is leaked and the file descriptor leak check fails when the
test exits. To avoid this cancel the workload when opening the events
fails.

Before:
```
$ perf test -vv 7
  7: PERF_RECORD_* events & perf_sample fields:
 --- start ---
test child forked, pid 1189568
Using CPUID GenuineIntel-6-B7-1
 ------------------------------------------------------------
perf_event_attr:
  type                    	   0 (PERF_TYPE_HARDWARE)
  config                  	   0xa00000000 (cpu_atom/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                	   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0xa00000000 (cpu_atom/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
  exclude_kernel                   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 3
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0x400000000 (cpu_core/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0x400000000 (cpu_core/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
  exclude_kernel                   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 3
Attempt to add: software/cpu-clock/
..after resolving event: software/config=0/
cpu-clock -> software/cpu-clock/
 ------------------------------------------------------------
perf_event_attr:
  type                             1 (PERF_TYPE_SOFTWARE)
  size                             136
  config                           0x9 (PERF_COUNT_SW_DUMMY)
  sample_type                      IP|TID|TIME|CPU
  read_format                      ID|LOST
  disabled                         1
  inherit                          1
  mmap                             1
  comm                             1
  enable_on_exec                   1
  task                             1
  sample_id_all                    1
  mmap2                            1
  comm_exec                        1
  ksymbol                          1
  bpf_event                        1
  { wakeup_events, wakeup_watermark } 1
 ------------------------------------------------------------
sys_perf_event_open: pid 1189569  cpu 0  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
perf_evlist__open: Permission denied
 ---- end(-2) ----
Leak of file descriptor 6 that opened: 'pipe:[14200347]'
 ---- unexpected signal (6) ----
iFailed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
    #0 0x565358f6666e in child_test_sig_handler builtin-test.c:311
    #1 0x7f29ce849df0 in __restore_rt libc_sigaction.c:0
    #2 0x7f29ce89e95c in __pthread_kill_implementation pthread_kill.c:44
    #3 0x7f29ce849cc2 in raise raise.c:27
    #4 0x7f29ce8324ac in abort abort.c:81
    #5 0x565358f662d4 in check_leaks builtin-test.c:226
    #6 0x565358f6682e in run_test_child builtin-test.c:344
    #7 0x565358ef7121 in start_command run-command.c:128
    #8 0x565358f67273 in start_test builtin-test.c:545
    #9 0x565358f6771d in __cmd_test builtin-test.c:647
    #10 0x565358f682bd in cmd_test builtin-test.c:849
    #11 0x565358ee5ded in run_builtin perf.c:349
    #12 0x565358ee6085 in handle_internal_command perf.c:401
    #13 0x565358ee61de in run_argv perf.c:448
    #14 0x565358ee6527 in main perf.c:555
    #15 0x7f29ce833ca8 in __libc_start_call_main libc_start_call_main.h:74
    #16 0x7f29ce833d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
    torvalds#17 0x565358e391c1 in _start perf[851c1]
  7: PERF_RECORD_* events & perf_sample fields                       : FAILED!
```

After:
```
$ perf test 7
  7: PERF_RECORD_* events & perf_sample fields                       : Skip (permissions)
```

Fixes: 16d00fe ("perf tests: Move test__PERF_RECORD into separate object")
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Athira Rajeev <[email protected]>
Cc: Chun-Tse Shao <[email protected]>
Cc: Howard Chu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
AirFortressIlikara pushed a commit that referenced this pull request Nov 30, 2025
commit 1d3ad18 upstream.

syzbot reported a BUG_ON in ext4_es_cache_extent() when opening a verity
file on a corrupted ext4 filesystem mounted without a journal.

The issue is that the filesystem has an inode with both the INLINE_DATA
and EXTENTS flags set:

    EXT4-fs error (device loop0): ext4_cache_extents:545: inode #15:
    comm syz.0.17: corrupted extent tree: lblk 0 < prev 66

Investigation revealed that the inode has both flags set:
    DEBUG: inode 15 - flag=1, i_inline_off=164, has_inline=1, extents_flag=1

This is an invalid combination since an inode should have either:
- INLINE_DATA: data stored directly in the inode
- EXTENTS: data stored in extent-mapped blocks

Having both flags causes ext4_has_inline_data() to return true, skipping
extent tree validation in __ext4_iget(). The unvalidated out-of-order
extents then trigger a BUG_ON in ext4_es_cache_extent() due to integer
underflow when calculating hole sizes.

Fix this by detecting this invalid flag combination early in ext4_iget()
and rejecting the corrupted inode.

Cc: [email protected]
Reported-and-tested-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=038b7bf43423e132b308
Suggested-by: Zhang Yi <[email protected]>
Signed-off-by: Deepanshu Kartikey <[email protected]>
Reviewed-by: Zhang Yi <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
AirFortressIlikara pushed a commit that referenced this pull request Nov 30, 2025
Use BPF_TRAMP_F_INDIRECT flag to detect struct ops and emit proper
prologue and epilogue for this case.

With this patch, all of the struct_ops related testcases (except
struct_ops_multi_pages) passed on LoongArch.

The testcase struct_ops_multi_pages failed is because the actual
image_pages_cnt is 40 which is bigger than MAX_TRAMP_IMAGE_PAGES.

Before:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  WATCHDOG: test case struct_ops_module/struct_ops_load executes for 10 seconds...

After:

  $ sudo ./test_progs -t struct_ops -d struct_ops_multi_pages
  ...
  #15      bad_struct_ops:OK
  ...
  torvalds#399     struct_ops_autocreate:OK
  ...
  torvalds#400     struct_ops_kptr_return:OK
  ...
  torvalds#401     struct_ops_maybe_null:OK
  ...
  torvalds#402     struct_ops_module:OK
  ...
  torvalds#404     struct_ops_no_cfi:OK
  ...
  torvalds#405     struct_ops_private_stack:SKIP
  ...
  torvalds#406     struct_ops_refcounted:OK
  Summary: 8/25 PASSED, 3 SKIPPED, 0 FAILED

Signed-off-by: Tiezhu Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Signed-off-by: maoxiaochuan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants