LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: "Hook, Gary" <ghook@amd.com>, Gary R Hook <gary.hook@amd.com>,
	iommu@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU
Date: Tue, 17 Apr 2018 19:13:52 +0100	[thread overview]
Message-ID: <a24f9f4c-0c65-a77c-a18b-7a6bf5a33b85@arm.com> (raw)
In-Reply-To: <9123cd44-e01f-bff6-8441-792acbde10bc@amd.com>

On 17/04/18 18:46, Hook, Gary wrote:
> On 4/6/2018 9:17 AM, Gary R Hook wrote:
>> Provide base enablement for using debugfs to expose internal data of
>> an IOMMU driver. When called, create the /sys/kernel/debug/iommu
>> directory.  Emit a strong warning at boot time to indicate that this
>> feature is enabled.
>>
>> This patch adds a top-level function that will create the (above)
>> directory, under which a driver may create a hw-specific directory for
>> its use. The function
>>
>>     iommu_debugfs_setup()
>>
>> returns a pointer to the new dentry structure created for
>> /sys/kernel/debug/iommu, or NULL in the event of a failure. An IOMMU
>> driver should call this function first, and then create a directory
>> beneath it. A driver implementation might look something like:
>>
>> static struct dentry *my_debugfs;
>>
>>     struct dentry *d_top;
>>     if (!my_debugfs) {
>>         d_top = iommu_debugfs_setup();
>>         if (d_top)
>>             my_debugfs = debugfs_create_dir("vendor", d_top);
>>     }
>>
>> Since the IOMMU driver can not be removed from the running system, this
>> patch only provides an "on" function.
>>
>> Signed-off-by: Gary R Hook <gary.hook@amd.com>
>> ---
>>   drivers/iommu/Kconfig         |   11 ++++++++
>>   drivers/iommu/Makefile        |    1 +
>>   drivers/iommu/iommu-debugfs.c |   58 
>> +++++++++++++++++++++++++++++++++++++++++
>>   include/linux/iommu.h         |    4 +++
>>   4 files changed, 74 insertions(+)
>>   create mode 100644 drivers/iommu/iommu-debugfs.c
>>
>> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
>> index f3a21343e636..c1e39dabfec2 100644
>> --- a/drivers/iommu/Kconfig
>> +++ b/drivers/iommu/Kconfig
>> @@ -60,6 +60,17 @@ config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
>>   endmenu
>> +config IOMMU_DEBUG
>> +    bool "Enable IOMMU internals in DebugFS"
>> +    depends on DEBUG_FS
>> +    default n
>> +    help
>> +      Allows exposure of IOMMU device internals. This option enables
>> +      the use of debugfs by IOMMU drivers as required. Devices can,
>> +      at initialization time, cause the IOMMU code to create a top-level
>> +      debug/iommu directory, and then populate a subdirectory with
>> +      entries as required.
> 
> I should explicitly ask about this:
> 
> Joerg had suggested IOMMU_DEBUGFS, but here I've changed to IOMMU_DEBUG. 
> I'm not seeing a lot of CONFIG options that use DEBUGFS for debugfs 
> options, so I chose to follow an implied convention.
> 
> Question: should this indeed be IOMMU_DEBUGFS?
>                                  ^^^^^^^^^^^^^

Personally I'd say yes, since there is at least some precedent for 
*_DEBUGFS already, and it does help make the intent that much clearer 
(*_DEBUG often just means lots of dmesg spam rather than an actual 
debugfs interface).

Robin.

  reply	other threads:[~2018-04-17 18:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 13:17 [PATCH v3 0/2] Base enablement of IOMMU debugfs support Gary R Hook
2018-04-06 13:17 ` [PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU Gary R Hook
2018-04-13 23:55   ` Mehta, Sohil
2018-04-17 17:36     ` Hook, Gary
2018-04-17 17:55       ` Robin Murphy
2018-04-17 18:06         ` Hook, Gary
2018-04-17 17:46   ` Hook, Gary
2018-04-17 18:13     ` Robin Murphy [this message]
2018-04-06 13:17 ` [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU Gary R Hook
2018-04-14  0:08   ` Mehta, Sohil
2018-04-17 17:38     ` Hook, Gary
2018-04-18  5:58       ` Yang, Shunyong
2018-04-18  7:27         ` Mehta, Sohil
2018-04-18  8:31           ` Yang, Shunyong
2018-04-18 20:16             ` Mehta, Sohil
2018-04-18 20:51               ` Hook, Gary
2018-04-19  1:52                 ` Yang, Shunyong
2018-04-30 19:57       ` Gary R Hook
2018-04-17  0:52   ` Mehta, Sohil
2018-04-17 17:42     ` Hook, Gary
2018-04-17 18:05       ` Robin Murphy

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=a24f9f4c-0c65-a77c-a18b-7a6bf5a33b85@arm.com \
    --to=robin.murphy@arm.com \
    --cc=gary.hook@amd.com \
    --cc=ghook@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).