Re: [PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-04-01 Thread Nicolin Chen
On Tue, Mar 16, 2021 at 12:16:43PM +0100, Thierry Reding wrote: > > +struct tegra_smmu_group_debug { > > + const struct tegra_smmu_swgroup *group; > > + void *priv; > > This always stores the address space, so why not make this: > > struct tegra_smmu_as *as; > > ? While at it,

Re: [PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-03-16 Thread Dmitry Osipenko
16.03.2021 14:16, Thierry Reding пишет: >> +seq_puts(s, "}\n"); >> +seq_printf(s, "Total PDE count: %u\n", pde_count); >> +seq_printf(s, "Total PTE count: %llu\n", pte_count); > Some of the above looks like it wouldn't be very easily consumed by > scripts. Is that something we want to

Re: [PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-03-16 Thread Dmitry Osipenko
15.03.2021 23:36, Nicolin Chen пишет: > +static int tegra_smmu_mappings_show(struct seq_file *s, void *data) > +{ > + struct tegra_smmu_group_debug *group_debug = s->private; > + const struct tegra_smmu_swgroup *group; > + struct tegra_smmu_as *as; > + struct tegra_smmu *smmu; > +

Re: [PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-03-16 Thread Dmitry Osipenko
15.03.2021 23:36, Nicolin Chen пишет: > +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned int > pt_index) > +{ > + return ((dma_addr_t)pd_index & (SMMU_NUM_PDE - 1)) << SMMU_PDE_SHIFT | > +((dma_addr_t)pt_index & (SMMU_NUM_PTE - 1)) << SMMU_PTE_SHIFT; > +}

Re: [PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-03-16 Thread Thierry Reding
On Mon, Mar 15, 2021 at 01:36:31PM -0700, Nicolin Chen wrote: > This patch dumps all active mapping entries from pagetable > to a debugfs directory named "mappings". > > Attaching an example: > > SWGROUP: hc > ASID: 0 > reg: 0x250 > PTB_ASID: 0xe0080004 > as->pd_dma: 0x80004000 > { >

[PATCH v5] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-03-15 Thread Nicolin Chen
This patch dumps all active mapping entries from pagetable to a debugfs directory named "mappings". Attaching an example: SWGROUP: hc ASID: 0 reg: 0x250 PTB_ASID: 0xe0080004 as->pd_dma: 0x80004000 { [1023] 0xf008000b (1) { PTE RANGE | ATTR | PHYS