Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jason Gunthorpe and committed by
Joerg Roedel
69541898 e5ef3219

+6 -1
+6 -1
drivers/iommu/riscv/iommu.c
··· 1185 1185 1186 1186 INIT_LIST_HEAD_RCU(&domain->bonds); 1187 1187 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 + */ 1188 1192 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); 1190 1195 domain->riscvpt.iommu.nid = dev_to_node(iommu->dev); 1191 1196 domain->domain.ops = &riscv_iommu_paging_domain_ops; 1192 1197