Skip to content

sync: rvck #309: iommu/riscv: add dma_wmb before cmpxchg_relaxed#243

Merged
xmzzz merged 1 commit into
RVCK-Project:OLK-6.6from
ieiao:PR309@rvck
Jul 12, 2026
Merged

sync: rvck #309: iommu/riscv: add dma_wmb before cmpxchg_relaxed#243
xmzzz merged 1 commit into
RVCK-Project:OLK-6.6from
ieiao:PR309@rvck

Conversation

@ieiao

@ieiao ieiao commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Sync commits from rvck PR 309.
Source PR: RVCK-Project/rvck#309

driver inclusion
category: bugfix
Link: RVCK-Project/rvck#308

--------------------------------

When using NVMe for PCIe peripherals on an RV multi-core CPU with IOMMU
enabled, the command `fio --filename=/dev/nvme0n1 --ioengine=libaio
--direct=1 --iodepth=256 --numjobs=8 --group_reporting=1 --bs=1M
--time_based=1 --runtime=2 --rw=read --name=test_read_8 --thread=1`
resulted a fault 15 exception during IOMMU testing.

When multiple cores modify iommu page talbe simultaneously, executing
riscv_iommu_map_pages or riscv_iommu_pte_alloc, an out-of-order iommu
page table clearing problem can occur due to a memory barrier missing.
It caused PTE being incorrectly cleared.

Setting dma_wmb ensures that all previous DMA write operations have
been completed before cmpxchg_relaxed.

This issue is relatively rare and may only occur during stress testing.

Signed-off-by: bailu <bai.lu5@zte.com.cn>
Signed-off-by: liuqingtao <liu.qingtao2@zte.com.cn>
[sync from rvck.]
Signed-off-by: WeiHao Li <cn.liweihao@gmail.com>
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

开始测试 log: https://github.com/RVCK-Project/rvck-olk/actions/runs/29094299936

参数解析结果
args value
repository RVCK-Project/rvck-olk
head ref pull/243/head
base ref OLK-6.6
LAVA repo RVCK-Project/lavaci
LAVA hardware ['qemu']
LAVA Testcase path lava-testcases/common-test/ltp/ltp.yaml
need run job kunit-test,kernel-build,check-patch,lava-trigger

测试完成

详细结果:
check result
kunit-test success
kernel-build success
check-patch success
lava-trigger-qemu success
lava-trigger-sg2042 skipped
lava-trigger-k1 skipped
lava-trigger-lpi4a skipped

Kunit Test Result

[13:02:07] Testing complete. Ran 482 tests: passed: 466, skipped: 16

Kernel Build Result

Check Patch Result

Total Errors 0
Total Warnings 0

LAVA Check (qemu)

args value
testcase_repo RVCK-Project/lavaci
lava_template lava-job-template/qemu/qemu-ltp.yaml
testcase_path lava-testcases/common-test/ltp/ltp.yaml
kernel_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/243_29094299936_1/Image
initramfs_download_url http://10.30.190.110/openEuler-RISC-V/RVCK/OERV-RVCI/RVCK-Project/rvck-olk/243_29094299936_1/initramfs.img
rootfs_download_url https://fast-mirror.isrc.ac.cn/openeuler-sig-riscv/openEuler-RISC-V/RVCK/openEuler24.03-LTS-SP1/openeuler-rootfs.img.zst
testcase_ref main
testitem_name RVCK-Project_rvck-olk_pull_request_target_243__common-test_qemu

result: Lava check done!

@xmzzz
xmzzz merged commit 198156a into RVCK-Project:OLK-6.6 Jul 12, 2026
53 checks passed
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.

2 participants