Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arch/arm64/configs/altra_5.10_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1597,3 +1597,5 @@ CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
CONFIG_ATOMIC64_SELFTEST=y
CONFIG_ASYNC_RAID6_TEST=m
CONFIG_TEST_KSTRTOX=y
CONFIG_IOMMU_DEBUGFS=y
CONFIG_ARM_SMMU_V3_DEBUGFS=y
11 changes: 11 additions & 0 deletions drivers/iommu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,17 @@ config ARM_SMMU_V3_SVA
Say Y here if your system supports SVA extensions such as PCIe PASID
and PRI.

config ARM_SMMU_V3_DEBUGFS
bool "Export ARM SMMUv3 internals in Debugfs"
depends on ARM_SMMU_V3 && IOMMU_DEBUGFS
help
DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!

Expose ARM SMMUv3 internals in Debugfs.

This option is -NOT- intended for production environments, and should
only be enabled for debugging ARM SMMUv3.

config S390_IOMMU
def_bool y if S390 && PCI
depends on S390 && PCI
Expand Down
1 change: 1 addition & 0 deletions drivers/iommu/arm/arm-smmu-v3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj-$(CONFIG_ARM_SMMU_V3) += arm_smmu_v3.o
arm_smmu_v3-objs-y += arm-smmu-v3.o
arm_smmu_v3-objs-$(CONFIG_ARM_SMMU_V3_SVA) += arm-smmu-v3-sva.o
arm_smmu_v3-objs := $(arm_smmu_v3-objs-y)
obj-$(CONFIG_ARM_SMMU_V3_DEBUGFS) += debugfs.o
10 changes: 7 additions & 3 deletions drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,7 @@ static void arm_smmu_write_cd_l1_desc(__le64 *dst,
WRITE_ONCE(*dst, cpu_to_le64(val));
}

static __le64 *arm_smmu_get_cd_ptr(struct arm_smmu_domain *smmu_domain,
u32 ssid)
__le64 *arm_smmu_get_cd_ptr(struct arm_smmu_domain *smmu_domain, u32 ssid)
{
__le64 *l1ptr;
unsigned int idx;
Expand All @@ -981,6 +980,7 @@ static __le64 *arm_smmu_get_cd_ptr(struct arm_smmu_domain *smmu_domain,
idx = ssid & (CTXDESC_L2_ENTRIES - 1);
return l1_desc->l2ptr + idx * CTXDESC_CD_DWORDS;
}
EXPORT_SYMBOL_GPL(arm_smmu_get_cd_ptr);

int arm_smmu_write_ctx_desc(struct arm_smmu_domain *smmu_domain, int ssid,
struct arm_smmu_ctx_desc *cd)
Expand Down Expand Up @@ -2012,7 +2012,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain,
return 0;
}

static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)
__le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)
{
__le64 *step;
struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
Expand All @@ -2033,6 +2033,7 @@ static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)

return step;
}
EXPORT_SYMBOL_GPL(arm_smmu_get_step_for_sid);

static void arm_smmu_install_ste_for_dev(struct arm_smmu_master *master)
{
Expand Down Expand Up @@ -3595,6 +3596,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
return ret;
}

arm_smmu_debugfs_init();

return arm_smmu_set_bus_ops(&arm_smmu_ops);
}

Expand All @@ -3603,6 +3606,7 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
struct arm_smmu_device *smmu = platform_get_drvdata(pdev);

arm_smmu_set_bus_ops(NULL);
arm_smmu_debugfs_uninit();
iommu_device_unregister(&smmu->iommu);
iommu_device_sysfs_remove(&smmu->iommu);
arm_smmu_device_disable(smmu);
Expand Down
10 changes: 10 additions & 0 deletions drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ int arm_smmu_write_ctx_desc(struct arm_smmu_domain *smmu_domain, int ssid,
struct arm_smmu_ctx_desc *cd);
void arm_smmu_tlb_inv_asid(struct arm_smmu_device *smmu, u16 asid);
bool arm_smmu_free_asid(struct arm_smmu_ctx_desc *cd);
__le64 *arm_smmu_get_cd_ptr(struct arm_smmu_domain *smmu_domain, u32 ssid);
__le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid);

#ifdef CONFIG_ARM_SMMU_V3_SVA
bool arm_smmu_sva_supported(struct arm_smmu_device *smmu);
Expand Down Expand Up @@ -720,4 +722,12 @@ static inline int arm_smmu_master_disable_sva(struct arm_smmu_master *master)
return -ENODEV;
}
#endif /* CONFIG_ARM_SMMU_V3_SVA */

#ifdef CONFIG_ARM_SMMU_V3_DEBUGFS
void arm_smmu_debugfs_init(void);
void arm_smmu_debugfs_uninit(void);
#else
static inline void arm_smmu_debugfs_init(void) {}
static inline void arm_smmu_debugfs_uninit(void) {}
#endif /* CONFIG_ARM_SMMU_V3_DEBUGFS */
#endif /* _ARM_SMMU_V3_H */
Loading