Skip to content

sync: rvck #114: Backport Linux RISC-V IOMMU Support#166

Merged
xmzzz merged 5 commits intoOLK-6.6from
sync/rvck-pr-114
Apr 8, 2026
Merged

sync: rvck #114: Backport Linux RISC-V IOMMU Support#166
xmzzz merged 5 commits intoOLK-6.6from
sync/rvck-pr-114

Conversation

@xmzzz
Copy link
Copy Markdown
Contributor

@xmzzz xmzzz commented Apr 8, 2026

Sync commits from rvck PR #114.

Source PR: RVCK-Project/rvck#114

Commits

  • 58832315d01a iommu/riscv: Add support for platform msi
  • bb1a4c92062c iommu/riscv: Empty iommu queue before enabling it
  • ee4dacd6f8f2 iommu/riscv: Add shutdown function for iommu driver
  • 6fab9babde3c iommu/riscv: Fixup compile warning
  • bc18ef01f8d4 iommu/riscv: prevent NULL deref in iova_to_phys

Andrew Jones and others added 5 commits April 8, 2026 14:58
mainline inclusion
from mainline-v6.13-rc4
commit d5f88acdd6ff84607043a6845b81e4be148f9fd9
category: feature
bugzilla: RVCK-Project/rvck#112

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

Apply platform_device_msi_init_and_alloc_irqs() to add support for
MSIs when the IOMMU is a platform device.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: gaorui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 5883231)
mainline inclusion
from mainline-v6.13-rc7
commit 8d8d3752c0a4f7fb072352837cbdbf57c02df239
category: feature
bugzilla: RVCK-Project/rvck#112

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

Changing cqen/fqen/pqen from 0 to 1 sets the cqh/fqt/pqt registers to 0.
But the cqt/fqh/pqh registers are left unmodified. This commit resets
cqt/fqh/pqh registers to ensure corresponding queues are empty before
being enabled during initialization.

Signed-off-by: Xu Lu <luxu.kernel@bytedance.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: gaorui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit bb1a4c9)
mainline inclusion
from mainline-v6.13-rc7
commit 8d8d3752c0a4f7fb072352837cbdbf57c02df239
category: feature
bugzilla: RVCK-Project/rvck#112

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

Changing cqen/fqen/pqen from 0 to 1 sets the cqh/fqt/pqt registers to 0.
But the cqt/fqh/pqh registers are left unmodified. This commit resets
cqt/fqh/pqh registers to ensure corresponding queues are empty before
being enabled during initialization.

Signed-off-by: Xu Lu <luxu.kernel@bytedance.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: gaorui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit ee4dacd)
mainline inclusion
from mainline-v6.13
commit 10c62c38b073ecea775b7e23fa7c7a3995a84ff3
category: feature
bugzilla: RVCK-Project/rvck#112

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

When __BITS_PER_LONG == 32, size_t is defined as unsigned int rather
than unsigned long. Therefore, we should use size_t to avoid
type-checking errors.
Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: gaorui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit 6fab9ba)
mainline inclusion
from mainline-v6.17-rc3
commit 99d4d1a070870aa08163af8ce0522992b7f35d8c
category: feature
bugzilla: RVCK-Project/rvck#112

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

The riscv_iommu_pte_fetch() function returns either NULL for
unmapped/never-mapped iova, or a valid leaf pte pointer that
requires no further validation.
riscv_iommu_iova_to_phys() failed to handle NULL returns.
Prevent null pointer dereference in
riscv_iommu_iova_to_phys(), and remove the pte validation.
Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")
Cc: Tomasz Jeznach <tjeznach@rivosinc.com>

Signed-off-by: XianLiang Huang <huangxianliang@lanxincomputing.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: gaorui <gao.rui@zte.com.cn>
Signed-off-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
(cherry picked from commit bc18ef0)
@xmzzz xmzzz merged commit b190047 into OLK-6.6 Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026


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

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

测试完成

详细结果:

RVCK result

check result
kunit-test success
kernel-build failure
lava-trigger skipped
check-patch success

Kunit Test Result

[07:03:55] Testing complete. Ran 454 tests: passed: 442, skipped: 12

Kernel Build Result

Kernel build failed.

Check Patch Result

Total Errors 0
Total Warnings 0

@xmzzz xmzzz deleted the sync/rvck-pr-114 branch April 8, 2026 06:59
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.

3 participants