Skip to contentSkip to conversation

The arm smmu driver for Linux does not support debugfs

DISCUSSION [email protected] 2 participants 3 messages Nov 15, 2022 1 message not in the archive virtio core

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

     Why doesn't the arm smmu driver for Linux support debugfs ?

Are there any historical reasons?

Thanks!

#2 lore raw
Quoted 5 lines · On 2022-11-15 02:28, [email protected] wrote:

Hi,

     Why doesn't the arm smmu driver for Linux support debugfs ?

Because nobody's ever written any debugfs code for it.

Quoted 1 line

Are there any historical reasons?

Only that so far nobody's needed to.

TBH, arm-smmu is actually quite straightforward, and none of the internal driver state is really all that interesting (other than the special private Adreno stuff, but we leave it up to Rob to implement whatever he needs there). Given the kernel config, module parameters, and the features logged at probe, you can already infer how it will set up context banks etc. for regular IOMMU API work; there won't be any surprises. At this point there shouldn't be any need to debug the driver itself, it's mature and stable. For debugging *users* of the driver, I've only dealt with the DMA layer, where a combination of the IOMMU API tracepoints, CONFIG_DMA_API_DEBUG, and my own hacks to iommu-dma have always proved sufficient to get enough insight into what's being mapped where.

I think a couple of people have previously raised the idea of implementing some kind of debugfs dumping for io-pgtable, but nothing's ever come of it. As above, it often turns out that you can find the information you need from other existing sources, thus the effort of implementing and maintaining a load of special-purpose debug code can be saved. In particular it would not be worth having driver-specific code that only helps debug generic IOMMU API usage - that would be much better implemented at the generic IOMMU API level.

Thanks,
Robin.

#3 lore raw
Quoted 51 lines · Robin Murphy
Quoted 5 lines · On 2022-11-15 02:28, [email protected] wrote:

Hi,

       Why doesn't the arm smmu driver for Linux support debugfs ?

Because nobody's ever written any debugfs code for it.

Quoted 1 line

Are there any historical reasons?

Only that so far nobody's needed to.

TBH, arm-smmu is actually quite straightforward, and none of the

internal driver state is really all that interesting (other than the

special private Adreno stuff, but we leave it up to Rob to implement whatever he needs there). Given the kernel config, module parameters, and the features logged at probe, you can already infer how it will set

up context banks etc. for regular IOMMU API work; there won't be any

surprises. At this point there shouldn't be any need to debug the driver

itself, it's mature and stable. For debugging *users* of the driver,

I've only dealt with the DMA layer, where a combination of the IOMMU API

tracepoints, CONFIG_DMA_API_DEBUG, and my own hacks to iommu-dma have

always proved sufficient to get enough insight into what's being mapped

where.

I think a couple of people have previously raised the idea of

implementing some kind of debugfs dumping for io-pgtable, but nothing's

ever come of it. As above, it often turns out that you can find the

information you need from other existing sources, thus the effort of

Quoted 7 lines

implementing and maintaining a load of special-purpose debug code can be

saved. In particular it would not be worth having driver-specific code

that only helps debug generic IOMMU API usage - that would be much

better implemented at the generic IOMMU API level.

Thanks for your reply, let me know that.

Leo.