From: Zhou Wang <wangzhou1@hisilicon.com>
To: Will Deacon <will@kernel.org>, Rob Herring <robh@kernel.org>
Cc: iommu@lists.linux-foundation.org,
Zhou Wang <wangzhou1@hisilicon.com>,
linux-arm-kernel@lists.infradead.org, chenxiang66@hisilicon.com
Subject: [RFC PATCH 0/3] iommu/arm-smmu-v3: Add debug interfaces for SMMUv3
Date: Fri, 29 Jan 2021 17:06:21 +0800 [thread overview]
Message-ID: <1611911184-116261-1-git-send-email-wangzhou1@hisilicon.com> (raw)
This RFC series is the followed patch of this discussion:
https://www.spinics.net/lists/arm-kernel/msg866187.html.
Currently there is no debug interface about SMMUv3 driver, which makes it
not convenient when we want to dump some information, like the value of
CD/STE, S1/S2 page table, SMMU registers or cmd/event/pri queues.
This series tries to add support of dumping CD/STE and page table. The
interface design is that user sets device/pasid firstly by sysfs files
and then read related sysfs file to get information:
(currently only support PCI device)
echo <domain>:<bus>:<dev>.<fun> > /sys/kernel/debug/iommu/smmuv3/pci_dev
echo <pasid> > /sys/kernel/debug/iommu/smmuv3/pasid
Then value in CD and STE can be got by:
cat /sys/kernel/debug/iommu/smmuv3/ste
cat /sys/kernel/debug/iommu/smmuv3/cd
S1 and S2 page tables can be got by:
cat /sys/kernel/debug/iommu/smmuv3/pt_dump_s1
cat /sys/kernel/debug/iommu/smmuv3/pt_dump_s2
For STE, CD and page table, related device and pasid are set in pci_dev
and pasid files as above.
First and second patch export some help functions or macros in arm-smmu-v3
and io-pgtable-arm codes, so we can reuse them in debugfs.c. As a RFC, this
series does not go further to dump SMMU registers and cmd/event/pri queues.
I am not sure this series is in the right way, so let's post it out and have a
discussion. Looking forward to any feedback.
Zhou Wang (3):
iommu/arm-smmu-v3: Export cd/ste get functions
iommu/io-pgtable: Export page table walk needed functions and macros
iommu/arm-smmu-v3: Add debug interfaces for SMMUv3
drivers/iommu/Kconfig | 11 +
drivers/iommu/arm/arm-smmu-v3/Makefile | 1 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 10 +
drivers/iommu/arm/arm-smmu-v3/debugfs.c | 398 ++++++++++++++++++++++++++++
drivers/iommu/io-pgtable-arm.c | 47 +---
drivers/iommu/io-pgtable-arm.h | 43 +++
7 files changed, 475 insertions(+), 45 deletions(-)
create mode 100644 drivers/iommu/arm/arm-smmu-v3/debugfs.c
--
2.8.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-01-29 9:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 9:06 Zhou Wang [this message]
2021-01-29 9:06 ` [RFC PATCH 1/3] iommu/arm-smmu-v3: Export cd/ste get functions Zhou Wang
2021-01-29 9:06 ` [RFC PATCH 2/3] iommu/io-pgtable: Export page table walk needed functions and macros Zhou Wang
2021-01-29 9:06 ` [RFC PATCH 3/3] iommu/arm-smmu-v3: Add debug interfaces for SMMUv3 Zhou Wang
2021-02-04 15:58 ` Robin Murphy
2021-02-05 12:04 ` Zhou Wang
2021-02-03 3:15 ` [RFC PATCH 0/3] " Zhou Wang
2021-02-03 21:38 ` Will Deacon
2021-02-04 13:01 ` Zhou Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1611911184-116261-1-git-send-email-wangzhou1@hisilicon.com \
--to=wangzhou1@hisilicon.com \
--cc=chenxiang66@hisilicon.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=robh@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox