[PATCH] iommu: Limit the IOVA page range to the specified addresses

2017-10-17 Thread Gary R Hook
From: amd <a...@sosxen2.amd.com> The extent of pages specified when applying a reserved region should include up to the last page of the range, but not the page following the range. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c |2 +- 1 fil

[PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-04 Thread Gary R Hook
to support PPR for a particular endpoint device. Please see https://support.amd.com/TechDocs/48882_IOMMU.pdf for this revision of the AMD IOMMU specification. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c | 20 +++- drivers/iommu/amd_iommu_t

[PATCH] iommu/amd - Record more information about unknown events

2017-12-04 Thread Gary R Hook
When an unknown type event occurs, the default information written to the syslog should dump raw event data. This could provide insight into the event that occurred. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c |4 +++- 1 file changed, 3 insertions

Re: [PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-12 Thread Gary R Hook
Please ignore. I've uncovered a problem and will re-submit. On 12/04/2017 01:52 PM, Gary R Hook wrote: The AMD IOMMU specification Rev 3.00 (December 2016) introduces a new Enhanced PPR Handling Support (EPHSup) bit in the MMIO register offset 0030h (IOMMU Extended Feature Register). When

[PATCH V2] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-19 Thread Gary R Hook
to support PPR for a particular endpoint device. Please see https://support.amd.com/TechDocs/48882_IOMMU.pdf for this revision of the AMD IOMMU specification. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- 0 files changed diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c

Re: [PATCH 3/3] iommu/amd: Do not flush when device is busy

2018-05-04 Thread Gary R Hook
On 05/04/2018 11:22 AM, Sebastian Andrzej Siewior wrote: From: Anna-Maria Gleixner When device is already attached to a domain, there is no need to execute the domain_flush_tlb_pde(). Therefore move the check if the domain is set into attach_device(). Signed-off-by:

Re: [PATCH 3/3] iommu/amd: Do not flush when device is busy

2018-05-07 Thread Gary R Hook
On 05/07/2018 07:38 AM, Anna-Maria Gleixner wrote: On Fri, 4 May 2018, Gary R Hook wrote: The prior version of this comment appears 3 times in the file, and is grammatically problematic every time. Can we simplify it to say * This function makes the device visible in the domain Or some

Re: [PATCH v5 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-08 Thread Gary R Hook
On 05/08/2018 01:48 PM, Joe Perches wrote: On Tue, 2018-05-08 at 12:08 -0500, Hook, Gary wrote: On 5/7/2018 6:47 PM, kbuild test robot wrote: All error/warnings (new ones prefixed by >>): In file included from include/linux/intel-iommu.h:32:0, from

Re: [PATCH v5 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-08 Thread Gary R Hook
On 05/08/2018 03:42 PM, Joe Perches wrote: On Tue, 2018-05-08 at 15:07 -0500, Gary R Hook wrote: On 05/08/2018 01:48 PM, Joe Perches wrote: On Tue, 2018-05-08 at 12:08 -0500, Hook, Gary wrote: On 5/7/2018 6:47 PM, kbuild test robot wrote: All error/warnings (new ones prefixed

Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-14 Thread Gary R Hook
On 05/14/2018 12:50 PM, Randy Dunlap wrote: On 05/14/2018 10:20 AM, Gary R Hook wrote: Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|5 + drivers/iommu/amd_iommu_deb

[PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-14 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|5 + drivers/iommu/amd_iommu_debugfs.c | 39 + drivers/iommu/amd_iommu_init.c

[PATCH v7 0/2] Base enablement of IOMMU debugfs support

2018-05-14 Thread Gary R Hook
Changes since v2: - Move a declaration to outside an ifdef - Remove a spurious blank line Changes since v1: - Remove debug cruft - Remove cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2

[PATCH v7 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-14 Thread Gary R Hook
from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig | 10 ++ drivers/iommu/Makefile|1 + drivers/iommu/iommu-debugfs.c | 72

[PATCH v5 0/2] Base enablement of IOMMU debugfs support

2018-05-07 Thread Gary R Hook
to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of IOMMU driver internals iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig | 11 ++ drivers/iommu/Makefile|6 +++ drivers/iommu/amd_iommu_debugfs.c

[PATCH v5 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-07 Thread Gary R Hook
from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig | 11 +++ drivers/iommu/Makefile|1 + drivers/iommu/iommu-debugfs.c | 64

[PATCH v5 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-07 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|5 + drivers/iommu/amd_iommu_debugfs.c | 41 + drivers/iommu/amd_iommu_init.c

[PATCH v6 0/2] Base enablement of IOMMU debugfs support

2018-05-11 Thread Gary R Hook
cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of IOMMU driver internals iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu

[PATCH v6 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-11 Thread Gary R Hook
from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig | 11 ++ drivers/iommu/Makefile|1 + drivers/iommu/iommu-debugfs.c | 70

[PATCH v6 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-11 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|5 + drivers/iommu/amd_iommu_debugfs.c | 39 + drivers/iommu/amd_iommu_init.c

Re: [PATCH v6 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-11 Thread Gary R Hook
On 05/11/2018 10:22 AM, Robin Murphy wrote: Hi Gary, Just a few trivial nitpicks below, otherwise: Reviewed-by: Robin Murphy <robin.mur...@arm.com> On 11/05/18 15:34, Gary R Hook wrote: Provide base enablement for using debugfs to expose internal data of an IOMMU driver. When called,

Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-24 Thread Gary R Hook
On 05/18/2018 04:02 PM, Gary R Hook wrote: On 05/18/2018 11:49 AM, Randy Dunlap wrote: I think the Kconfig option would have been the correct choice. "Preferred", perhaps. Neither is incorrect. And really, the Makefile/Kconfig choice is somewhat separate from the organization i

Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-18 Thread Gary R Hook
On 05/15/2018 08:46 AM, Joerg Roedel wrote: On Mon, May 14, 2018 at 03:00:50PM -0500, Gary R Hook wrote: This was brought up a few weeks ago in, I believe, version 3 of this patch. That question was discussed (because that's what I did the first time out), and _someone_ _else_ asked about why I

Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-18 Thread Gary R Hook
On 05/18/2018 11:49 AM, Randy Dunlap wrote: On 05/18/2018 08:20 AM, Gary R Hook wrote: On 05/15/2018 08:46 AM, Joerg Roedel wrote: On Mon, May 14, 2018 at 03:00:50PM -0500, Gary R Hook wrote: This was brought up a few weeks ago in, I believe, version 3 of this patch. That question

[PATCH] iommu/amd - Optimize PPR log handling

2018-05-18 Thread Gary R Hook
, to inform the IOMMU that space is available in the log. Finally, since a single pass may leave logged events unread, use an outer loop to repeat until head has caught up to tail. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c

Re: [PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-06-12 Thread Gary R Hook
On 06/04/2018 08:23 PM, Randy Dunlap wrote: On 05/29/2018 11:39 AM, Greg KH wrote: On Tue, May 29, 2018 at 01:23:23PM -0500, Gary R Hook wrote: Implement a skeleton framework for debugfs support in the AMD IOMMU. Add a hidden boolean to Kconfig that is defined for the AMD IOMMU when general

Re: [PATCH v8 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-06-12 Thread Gary R Hook
On 06/05/2018 12:08 PM, Greg KH wrote: On Tue, Jun 05, 2018 at 12:01:41PM -0500, Gary R Hook wrote: +/** + * iommu_debugfs_new_driver_dir - create a vendor directory under debugfs/iommu + * @vendor: name of the vendor-specific subdirectory to create + * + * This function is called by an IOMMU

[PATCH v9 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-06-12 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Add an AMD-specific Kconfig boolean that depends upon general enablement of DebugFS in the IOMMU. Signed-off-by: Gary R Hook --- drivers/iommu/Kconfig | 12 drivers/iommu/Makefile|1

[PATCH v9 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-06-12 Thread Gary R Hook
from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook --- drivers/iommu/Kconfig | 10 ++ drivers/iommu/Makefile|1 + drivers/iommu/iommu-debugfs.c | 66 + drivers/iommu/iommu.c

Re: [PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-06-12 Thread Gary R Hook
On 06/05/2018 12:06 PM, Greg KH wrote: On Tue, Jun 05, 2018 at 11:58:13AM -0500, Gary R Hook wrote: On 05/29/2018 01:39 PM, Greg KH wrote: On Tue, May 29, 2018 at 01:23:23PM -0500, Gary R Hook wrote: Implement a skeleton framework for debugfs support in the AMD IOMMU. Add a hidden boolean

[PATCH v9 0/2] Base enablement of IOMMU debugfs support

2018-06-12 Thread Gary R Hook
to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of IOMMU driver internals iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig | 22 drivers/iommu/Makefile|2 + drivers/iommu

[PATCH v8 0/2] Base enablement of IOMMU debugfs support

2018-05-29 Thread Gary R Hook
cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of IOMMU driver internals iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig

[PATCH v8 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-05-29 Thread Gary R Hook
from the running system, there is no need for an "off" function. Signed-off-by: Gary R Hook --- drivers/iommu/Kconfig | 10 ++ drivers/iommu/Makefile|1 + drivers/iommu/iommu-debugfs.c | 72 + drivers/iommu/iommu.c

[PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-05-29 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Add a hidden boolean to Kconfig that is defined for the AMD IOMMU when general IOMMY DebugFS support is enabled. Signed-off-by: Gary R Hook --- drivers/iommu/Kconfig |4 drivers/iommu/Makefile

Re: [PATCH v7 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-06-05 Thread Gary R Hook
On 05/24/2018 04:18 AM, Greg KH wrote: On Mon, May 14, 2018 at 12:20:20PM -0500, 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

Re: [PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-06-05 Thread Gary R Hook
On 05/29/2018 01:39 PM, Greg KH wrote: On Tue, May 29, 2018 at 01:23:23PM -0500, Gary R Hook wrote: Implement a skeleton framework for debugfs support in the AMD IOMMU. Add a hidden boolean to Kconfig that is defined for the AMD IOMMU when general IOMMY DebugFS support is enabled. Signed-off

Re: [PATCH v8 1/2] iommu - Enable debugfs exposure of IOMMU driver internals

2018-06-05 Thread Gary R Hook
On 05/29/2018 01:41 PM, Greg KH wrote: On Tue, May 29, 2018 at 01:23:14PM -0500, 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

Re: [PATCH] iommu/amd - Optimize PPR log handling

2018-05-29 Thread Gary R Hook
On 05/29/2018 09:54 AM, Joerg Roedel wrote: Hey Gary, On Fri, May 18, 2018 at 04:51:56PM -0500, Gary R Hook wrote: Improve the performance of the PPR log polling function (i.e. the task of emptying the log) by minimizing MMIO operations and more efficiently processing groups of log entries

Re: [PATCH] iommu/amd: remove redundant variable tag

2018-07-02 Thread Gary R Hook
On 07/02/2018 11:37 AM, Colin King wrote: From: Colin Ian King Variable tag is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'tag' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King ---

Re: [PATCH] iommu/amd: fix missing tag from dev_err message

2018-07-03 Thread Gary R Hook
u/amd: Update logging information for new event type") Signed-off-by: Colin Ian King --- This is a re-working of an earlier incorrect fix that I posted yesterday ("iommu/amd: remove redundant variable tag") Acked-by: Gary R Hook --- drivers/iommu/amd_iommu.c | 4 ++-- 1 file c

[PATCH 1/2] iommu/amd - Update the PASID information printed to the system log

2018-05-01 Thread Gary R Hook
Provide detailed data for each event, as appropriate. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c | 31 +-- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c

[PATCH 0/2] Tweak AMD IOMMU logging

2018-05-01 Thread Gary R Hook
Update the AMD IOMMU log messages to be more precise, and add a log message for a new event type. --- Gary R Hook (2): iommu/amd - Update the PASID information printed to the system log iommu/amd - Update logging information for new event type drivers/iommu/amd_iommu.c

[PATCH 2/2] iommu/amd - Update logging information for new event type

2018-05-01 Thread Gary R Hook
A new events have been defined in the AMD IOMMU spec: 0x09 - "invalid PPR request" Add support for logging this type of event. Signed-off-by: Gary R Hook <gary.h...@amd.com> ~ ~ ~ --- drivers/iommu/amd_iommu.c | 10 +- drivers/iommu/amd_iommu_types.h |1 +

[PATCH v4 0/2] Base enablement of IOMMU debugfs support

2018-04-30 Thread Gary R Hook
: - Move a declaration to outside an ifdef - Remove a spurious blank line Changes since v1: - Remove debug cruft - Remove cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu - Enable

[PATCH v4 1/2] iommu - Enable debugfs exposure of the IOMMU

2018-04-30 Thread Gary R Hook
("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.h...@amd.com> --- drivers/iommu/Kconfig | 11 drivers/iommu/Makefile|

Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-04-30 Thread Gary R Hook
On 04/17/2018 12:38 PM, Hook, Gary wrote: On 4/13/2018 8:08 PM, Mehta, Sohil wrote: On Fri, 2018-04-06 at 08:17 -0500, Gary R Hook wrote: + + +    mutex_lock(_iommu_debugfs_lock); +    if (!amd_iommu_debugfs) { +    d_top = iommu_debugfs_setup(); +    if (d_top

[PATCH v4 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-04-30 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|5 drivers/iommu/amd_iommu_debugfs.c | 42 + drivers/iommu/amd_iommu_init.c

Re: [PATCH 1/2] iommu/amd - Update the PASID information printed to the system log

2018-05-03 Thread Gary R Hook
On 05/03/2018 08:57 AM, Joerg Roedel wrote: On Tue, May 01, 2018 at 02:52:52PM -0500, Gary R Hook wrote: @@ -567,7 +567,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt) } if (type == EVENT_TYPE_IO_FAULT) { - amd_iommu_report_page_fault(devid

Re: [PATCH] iommu: Limit the IOVA page range to the specified addresses

2017-10-27 Thread Gary R Hook
On 10/26/2017 03:32 AM, Alex Williamson wrote: On Tue, 17 Oct 2017 16:22:01 -0500 Gary R Hook <gary.h...@amd.com> wrote: From: amd <a...@sosxen2.amd.com> The extent of pages specified when applying a reserved region should include up to the last page of the range, but not the pa

Re: [PATCH] iommu/amd: fix missing tag from dev_err message

2018-07-03 Thread Gary R Hook
On 07/03/2018 05:07 AM, Joe Perches wrote: On Tue, 2018-07-03 at 07:40 +0100, Colin King wrote: Currently tag is being assigned but not used, it is missing from the dev_err message, so add it in. Cleans up clang warning: warning: variable 'tag' set but not used [-Wunused-but-set-variable] []

Re: [PATCH V4 11/26] iommu/amd: deprecate pci_get_bus_and_slot()

2018-01-04 Thread Gary R Hook
On 01/04/2018 06:25 AM, Sinan Kaya wrote: On 12/19/2017 12:37 AM, Sinan Kaya wrote: pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as where a PCI device is present. This restricts the device drivers to be reused for other domain numbers. Getting ready to remove

Re: [PATCH V4 11/26] iommu/amd: deprecate pci_get_bus_and_slot()

2018-01-04 Thread Gary R Hook
On 01/04/2018 10:32 AM, Sinan Kaya wrote: On 1/4/2018 11:28 AM, Gary R Hook wrote: On 01/04/2018 06:25 AM, Sinan Kaya wrote: On 12/19/2017 12:37 AM, Sinan Kaya wrote: pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as where a PCI device is present. This restricts

Re: [PATCH v6 2/5] iommu/vt-d: Add debugfs support to show context internals

2018-01-10 Thread Gary R Hook
On 01/09/2018 09:48 PM, Sohil Mehta wrote: From: Gayatri Kammela IOMMU internals states such as root and context can be exported to the userspace. Example of such dump in Kabylake: root@OTC-KBLH-01:~# cat /sys/kernel/debug/intel_iommu/dmar_translation_struct IOMMU

[PATCH 4/5] iommu/amd - Expose the active IOMMU device table entries

2018-01-26 Thread Gary R Hook
definitions for debugfs printing in verbose mode Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 182 + 1 file changed, 182 insertions(+) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_deb

[PATCH 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs

2018-01-26 Thread Gary R Hook
Enable more descriptive debugfs output via a 'verbose' variable. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers

[PATCH 0/5] Add debugfs info for the AMD IOMMU

2018-01-26 Thread Gary R Hook
of three patch series that will expose a number of IOMMU registers. --- Gary R Hook (5): iommu/amd - Add debugfs support iommu/amd - Add a 'verbose' switch for IOMMU debugfs iommu/amd - Add a README variable for the IOMMU debugfs iommu/amd - Expose the active IOMMU device table

[PATCH 3/5] iommu/amd - Add a README variable for the IOMMU debugfs

2018-01-26 Thread Gary R Hook
Provide help text via a filesystem entry Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c

[PATCH 1/5] iommu/amd - Add debugfs support

2018-01-26 Thread Gary R Hook
Create the basic debugfs functions. Expose a count of IOMMU device table entries that appear to be in use. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig |9 +++ drivers/iommu/Makefile|2 - drivers/iommu/amd_iommu_debugfs.c

[PATCH 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-01-26 Thread Gary R Hook
at boot. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 127 - 1 file changed, 109 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c index 87840a

Re: [PATCH 1/5] iommu/amd - Add debugfs support

2018-01-29 Thread Gary R Hook
On 01/26/2018 06:00 PM, Borislav Petkov wrote: On Fri, Jan 26, 2018 at 05:52:15PM -0600, Gary R Hook wrote: --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -135,6 +135,15 @@ config AMD_IOMMU_V2 hardware. Select this option if you want to use devices that support

[PATCH] iommu/amd - Use dev_err to send events to the system log

2018-01-30 Thread Gary R Hook
Remove printk and use a more preferable error logging function. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c | 56 +++-- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/d

Re: [PATCH V2] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-20 Thread Gary R Hook
On 12/20/2017 01:02 PM, Alex Williamson wrote: On Tue, 19 Dec 2017 16:15:41 -0600 Gary R Hook <gary.h...@amd.com> wrote: The AMD IOMMU specification Rev 3.00 (December 2016) introduces a new Enhanced PPR Handling Support (EPHSup) bit in the MMIO register offset 0030h (IOMMU Extended F

Re: [PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-13 Thread Gary R Hook
On 03/13/2018 12:16 PM, Andy Shevchenko wrote: On Fri, Mar 9, 2018 at 2:50 AM, Gary R Hook <gary.h...@amd.com> wrote: + default n Redundant Roger that. +#include +#include +#include Keep in order? What order would that be? These few needed files are listed in the same

Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-13 Thread Gary R Hook
On 03/13/2018 12:20 PM, Andy Shevchenko wrote: + oboff += OSCNPRINTF("%02x:%02x:%x (%u / %04x)\n", + PCI_BUS_NUM(amd_iommu_devid), + PCI_SLOT(amd_iommu_devid), +

[PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-08 Thread Gary R Hook
Expose the IOMMU MMIO registers and device table Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig |8 +++ drivers/iommu/Makefile|1 drivers/iommu/amd_iommu_debugfs.c | 112 + drivers

[PATCH v2 0/5] Add debugfs info for the AMD IOMMU

2018-03-08 Thread Gary R Hook
of three patch series that will expose a number of IOMMU registers. Changes since v1: - Correctly use CONFIG_AMD_IOMMU_DEBUG in Makefile and header file --- Gary R Hook (5): iommu/amd - Add debugfs support iommu/amd - Add a 'verbose' switch for IOMMU debugfs iommu/amd - Add a README

[PATCH v3 1/5] iommu/amd - Add debugfs support

2018-03-14 Thread Gary R Hook
Expose the IOMMU MMIO registers and device table Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig |7 ++ drivers/iommu/Makefile|1 drivers/iommu/amd_iommu_debugfs.c | 122 + drivers

[PATCH v3 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-14 Thread Gary R Hook
at boot. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 121 - 1 file changed, 106 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c index 1d941c

[PATCH v3 3/5] iommu/amd - Add a README variable for the IOMMU debugfs

2018-03-14 Thread Gary R Hook
Provide help text via a filesystem entry Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c

[PATCH v3 0/5] Add debugfs info for the AMD IOMMU

2018-03-14 Thread Gary R Hook
since v1: - Correctly use CONFIG_AMD_IOMMU_DEBUG in Makefile and header file --- Gary R Hook (5): iommu/amd - Add debugfs support iommu/amd - Add a 'verbose' switch for IOMMU debugfs iommu/amd - Add a README variable for the IOMMU debugfs iommu/amd - Expose the active IOMMU

[PATCH v3 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs

2018-03-14 Thread Gary R Hook
Enable more descriptive debugfs output via a 'verbose' variable. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers

[PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-08 Thread Gary R Hook
at boot. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 109 ++--- 1 file changed, 100 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c index c4e071

[PATCH v2 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs

2018-03-08 Thread Gary R Hook
Enable more descriptive debugfs output via a 'verbose' variable. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers

[PATCH v2 4/5] iommu/amd - Expose the active IOMMU device table entries

2018-03-08 Thread Gary R Hook
Add a debugfs entry to dump the active device table entries from the IOMMU's table. Active is determined by non-default values in the first and second long words of the DTE. Aside from IOMMU devices, this output should list every device reported by lspci. Signed-off-by: Gary R Hook <gar

[PATCH v2 3/5] iommu/amd - Add a README variable for the IOMMU debugfs

2018-03-08 Thread Gary R Hook
Provide help text via a filesystem entry Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu_debugfs.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c

[PATCH v2] iommu/amd - Use dev_err to send events to the system log

2018-03-08 Thread Gary R Hook
Remove printk and use a more preferable error logging function. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c | 55 +++-- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/d

Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry

2018-03-14 Thread Gary R Hook
On 03/13/2018 03:56 PM, Andy Shevchenko wrote: On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.h...@amd.com> wrote: On 03/13/2018 12:20 PM, Andy Shevchenko wrote: + } else if (obuf[0] == '0' && obuf[1] == 'x') { + n = sscanf(obuf, "%x", _iomm

Re: [PATCH v2 1/5] iommu/amd - Add debugfs support

2018-03-14 Thread Gary R Hook
On 03/13/2018 03:23 PM, Andy Shevchenko wrote: On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.h...@amd.com> wrote: On 03/13/2018 12:16 PM, Andy Shevchenko wrote: On Fri, Mar 9, 2018 at 2:50 AM, Gary R Hook <gary.h...@amd.com> wrote: +#include +#include +#include K

[PATCH v3 0/2] Base enablement of IOMMU debugfs support

2018-04-06 Thread Gary R Hook
- Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of the IOMMU iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig | 11 +++ drivers/iommu/Makefile|2 + drivers

[PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU

2018-04-06 Thread Gary R Hook
("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.h...@amd.com> --- drivers/iommu/Kconfig | 11 drivers/iommu/Makefile|

[PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-04-06 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|1 + drivers/iommu/amd_iommu_debugfs.c | 45 + drivers/iommu/amd_iommu_init.c

[PATCH v2 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-04-04 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Makefile|1 + drivers/iommu/amd_iommu_debugfs.c | 45 + drivers/iommu/amd_iommu_init.c

[PATCH v2 0/2] Base enablement of IOMMU debugfs support

2018-04-04 Thread Gary R Hook
Kconfig parameter IOMMU_DEBUG to globally allow or disallow debugfs code to be built. Changes since v1: - Remove debug cruft - Remove cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu

[PATCH v2 1/2] iommu - Enable debugfs exposure of the IOMMU

2018-04-04 Thread Gary R Hook
("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.h...@amd.com> --- drivers/iommu/Kconfig | 11 drivers/iommu/Makefile|

Re: [PATCH 1/2] iommu - Enable debugfs exposure of the IOMMU

2018-03-30 Thread Gary R Hook
On 03/29/2018 10:57 PM, Tom Lendacky wrote: On 3/29/2018 5:54 PM, Gary R Hook wrote: Provide base enablement for using debugfs to expose internal data of an IOMMU driver. When enabled, create the /sys/kernel/debug/iommu So this can't actually create anything yet since nothing invokes

Re: [PATCH 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-03-30 Thread Gary R Hook
On 03/29/2018 11:16 PM, Tom Lendacky wrote: On 3/29/2018 5:54 PM, Gary R Hook wrote: Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig |6 ++--- drivers/iommu/Ma

[PATCH 1/2] iommu - Enable debugfs exposure of the IOMMU

2018-03-29 Thread Gary R Hook
Provide base enablement for using debugfs to expose internal data of an IOMMU driver. When enabled, create the /sys/kernel/debug/iommu directory. Emit a strong warning at boot time to indicate that this feature is enabled. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/K

[PATCH 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU

2018-03-29 Thread Gary R Hook
Implement a skeleton framework for debugfs support in the AMD IOMMU. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/Kconfig |6 ++--- drivers/iommu/Makefile|2 +- drivers/iommu/amd_iommu_debugfs.c

[PATCH 0/2] Base enablement of IOMMU debugfs support

2018-03-29 Thread Gary R Hook
Kconfig parameter IOMMU_DEBUG to globally allow or disallow debugfs code to be built. --- Gary R Hook (2): iommu - Enable debugfs exposure of the IOMMU iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig |9 +++ drivers/iommu/Makefile

Re: [PATCH v7 0/5] Add Intel IOMMU debugfs support

2018-03-29 Thread Gary R Hook
On 03/29/2018 03:48 AM, Joerg Roedel wrote: [ Adding Gary from AMD to Cc ] On Mon, Mar 19, 2018 at 09:37:14AM -0700, Jacob Pan wrote: On Thu, 15 Mar 2018 14:18:54 +0100 Joerg Roedel wrote: On Thu, Feb 15, 2018 at 08:38:11AM -0800, Jacob Pan wrote: Just wondering if your

Re: [PATCH v3 0/5] Add debugfs info for the AMD IOMMU

2018-03-26 Thread Gary R Hook
On 03/15/2018 08:58 AM, Joerg Roedel wrote: On Wed, Mar 14, 2018 at 06:04:44PM -0500, Gary R Hook wrote: Gary R Hook (5): iommu/amd - Add debugfs support iommu/amd - Add a 'verbose' switch for IOMMU debugfs iommu/amd - Add a README variable for the IOMMU debugfs

Re: [PATCH v2] iommu/amd: Reserve exclusion range in iova-domain

2019-03-29 Thread Gary R Hook
on data transfered with these devices. > > Treat exclusion ranges as reserved regions in the iommu-core > to fix the problem. Reviewed-by: Gary R Hook > > Fixes: be2a022c0dd0 ('x86, AMD IOMMU: add functions to parse IOMMU memory > mapping requirements for devices') > Signed-off-by

Re: [PATCH] iommu/amd: Reserve exclusion range in iova-domain

2019-03-29 Thread Gary R Hook
On 3/29/19 9:51 AM, Joerg Roedel wrote: > Hi Gary, > > On Thu, Mar 28, 2019 at 02:52:19PM +0000, Gary R Hook wrote: >> On 3/28/19 5:44 AM, Joerg Roedel wrote: >>> + if (entry->prot & (1 << 2)) >> >> Could we add #define IOMMU_WRITE_EXCL (

Re: [PATCH] iommu/amd: Reserve exclusion range in iova-domain

2019-03-28 Thread Gary R Hook
On 3/28/19 5:44 AM, Joerg Roedel wrote: > From: Joerg Roedel > > If a device has an exclusion range specified in the IVRS > table, this region needs to be reserved in the iova-domain > of that device. This hasn't happened until now and can cause > data corruption on data transfered with these

Re: [PATCH] iommu: Fix IOMMU debugfs fallout

2019-02-21 Thread Gary R Hook
nd the patch description. > > Fix this by exporting iommu_debugfs_dir, and removing the reference to > and implementation of iommu_debugfs_new_driver_dir(). > > Fixes: bad614b24293ae46 ("iommu: Enable debugfs exposure of IOMMU driver > internals") > Signed-off-by:

Re: [PATCH] iommu/amd: print out "tag" in INVALID_PPR_REQUEST

2019-05-07 Thread Gary R Hook
On 5/5/19 11:11 PM, Qian Cai wrote: > [CAUTION: External Email] > > The commit e7f63ffc1bf1 ("iommu/amd: Update logging information for new > event type") introduced a variable "tag" but had never used it which > generates a warning below, > > drivers/iommu/amd_iommu.c: In function