Skip to content

Commit 6954189

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/riscv: Enable SVNAPOT support for contiguous ptes
This turns on a 64k page size. The "RISC-V IOMMU Architecture Specification" states: 6.4 IOMMU capabilities [..] IOMMU implementations must support the Svnapot standard extension for NAPOT Translation Contiguity. So just switch it on unconditionally. Cc: Xu Lu <luxu.kernel@bytedance.com> Tested-by: Vincent Chen <vincent.chen@sifive.com> Acked-by: Paul Walmsley <pjw@kernel.org> # arch/riscv Reviewed-by: Tomasz Jeznach <tjeznach@rivosinc.com> Tested-by: Tomasz Jeznach <tjeznach@rivosinc.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent e5ef321 commit 6954189

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/iommu/riscv/iommu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,13 @@ static struct iommu_domain *riscv_iommu_alloc_paging_domain(struct device *dev)
11851185

11861186
INIT_LIST_HEAD_RCU(&domain->bonds);
11871187
spin_lock_init(&domain->lock);
1188+
/*
1189+
* 6.4 IOMMU capabilities [..] IOMMU implementations must support the
1190+
* Svnapot standard extension for NAPOT Translation Contiguity.
1191+
*/
11881192
cfg.common.features = BIT(PT_FEAT_SIGN_EXTEND) |
1189-
BIT(PT_FEAT_FLUSH_RANGE);
1193+
BIT(PT_FEAT_FLUSH_RANGE) |
1194+
BIT(PT_FEAT_RISCV_SVNAPOT_64K);
11901195
domain->riscvpt.iommu.nid = dev_to_node(iommu->dev);
11911196
domain->domain.ops = &riscv_iommu_paging_domain_ops;
11921197

0 commit comments

Comments
 (0)