Skip to content

Commit e93e4a6

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/riscv: Disable SADE
In terms of the iommu subystem the SADE/GADE feature "3.4. IOMMU updating of PTE accessed (A) and dirty (D) updates" is called dirty tracking. There is no reason to enable HW support for this, and the HW cost associated with it, unless dirty tracking is actually enabled through iommufd. It should be a dynamic feature linked to user request. Further, without implementing the read dirty ops the whole thing is pointless. Do not set DC.tc.SADE just because the HW has support for dirty tracking. 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 e71e001 commit e93e4a6

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

drivers/iommu/riscv/iommu.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,6 @@ struct riscv_iommu_domain {
810810
struct list_head bonds;
811811
spinlock_t lock; /* protect bonds list updates. */
812812
int pscid;
813-
bool amo_enabled;
814813
int numa_node;
815814
unsigned int pgd_mode;
816815
unsigned long *pgd_root;
@@ -1201,8 +1200,6 @@ static int riscv_iommu_map_pages(struct iommu_domain *iommu_domain,
12011200

12021201
if (!(prot & IOMMU_WRITE))
12031202
pte_prot = _PAGE_BASE | _PAGE_READ;
1204-
else if (domain->amo_enabled)
1205-
pte_prot = _PAGE_BASE | _PAGE_READ | _PAGE_WRITE;
12061203
else
12071204
pte_prot = _PAGE_BASE | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY;
12081205

@@ -1387,7 +1384,6 @@ static struct iommu_domain *riscv_iommu_alloc_paging_domain(struct device *dev)
13871384
INIT_LIST_HEAD_RCU(&domain->bonds);
13881385
spin_lock_init(&domain->lock);
13891386
domain->numa_node = dev_to_node(iommu->dev);
1390-
domain->amo_enabled = !!(iommu->caps & RISCV_IOMMU_CAPABILITIES_AMO_HWAD);
13911387
domain->pgd_mode = pgd_mode;
13921388
domain->pgd_root = iommu_alloc_pages_node_sz(domain->numa_node,
13931389
GFP_KERNEL_ACCOUNT, SZ_4K);
@@ -1512,8 +1508,6 @@ static struct iommu_device *riscv_iommu_probe_device(struct device *dev)
15121508
* the device directory. Do not mark the context valid yet.
15131509
*/
15141510
tc = 0;
1515-
if (iommu->caps & RISCV_IOMMU_CAPABILITIES_AMO_HWAD)
1516-
tc |= RISCV_IOMMU_DC_TC_SADE;
15171511
for (i = 0; i < fwspec->num_ids; i++) {
15181512
dc = riscv_iommu_get_dc(iommu, fwspec->ids[i]);
15191513
if (!dc) {

0 commit comments

Comments
 (0)