All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: joro@8bytes.org, alex.williamson@redhat.com
Cc: jacob.jun.pan@linux.intel.com, eric.auger@redhat.com,
	ashok.raj@intel.com, yi.l.liu@intel.com, robdclark@gmail.com,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	robin.murphy@arm.com
Subject: [PATCH v2 1/4] driver core: Add per device iommu param
Date: Mon,  3 Jun 2019 15:57:46 +0100	[thread overview]
Message-ID: <20190603145749.46347-2-jean-philippe.brucker@arm.com> (raw)
In-Reply-To: <20190603145749.46347-1-jean-philippe.brucker@arm.com>

From: Jacob Pan <jacob.jun.pan@linux.intel.com>

DMA faults can be detected by IOMMU at device level. Adding a pointer
to struct device allows IOMMU subsystem to report relevant faults
back to the device driver for further handling.
For direct assigned device (or user space drivers), guest OS holds
responsibility to handle and respond per device IOMMU fault.
Therefore we need fault reporting mechanism to propagate faults beyond
IOMMU subsystem.

There are two other IOMMU data pointers under struct device today, here
we introduce iommu_param as a parent pointer such that all device IOMMU
data can be consolidated here. The idea was suggested here by Greg KH
and Joerg. The name iommu_param is chosen here since iommu_data has been
used.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Link: https://lkml.org/lkml/2017/10/6/81
---
 include/linux/device.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index e85264fb6616..f0a975abd6e9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -42,6 +42,7 @@ struct iommu_ops;
 struct iommu_group;
 struct iommu_fwspec;
 struct dev_pin_info;
+struct iommu_param;
 
 struct bus_attribute {
 	struct attribute	attr;
@@ -959,6 +960,7 @@ struct dev_links_info {
  * 		device (i.e. the bus driver that discovered the device).
  * @iommu_group: IOMMU group the device belongs to.
  * @iommu_fwspec: IOMMU-specific properties supplied by firmware.
+ * @iommu_param: Per device generic IOMMU runtime data
  *
  * @offline_disabled: If set, the device is permanently online.
  * @offline:	Set after successful invocation of bus type's .offline().
@@ -1052,6 +1054,7 @@ struct device {
 	void	(*release)(struct device *dev);
 	struct iommu_group	*iommu_group;
 	struct iommu_fwspec	*iommu_fwspec;
+	struct iommu_param	*iommu_param;
 
 	bool			offline_disabled:1;
 	bool			offline:1;
-- 
2.21.0


WARNING: multiple messages have this Message-ID (diff)
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: joro@8bytes.org, alex.williamson@redhat.com
Cc: ashok.raj@intel.com, linux-kernel@vger.kernel.org,
	iommu@lists.linux-foundation.org, robin.murphy@arm.com
Subject: [PATCH v2 1/4] driver core: Add per device iommu param
Date: Mon,  3 Jun 2019 15:57:46 +0100	[thread overview]
Message-ID: <20190603145749.46347-2-jean-philippe.brucker@arm.com> (raw)
In-Reply-To: <20190603145749.46347-1-jean-philippe.brucker@arm.com>

From: Jacob Pan <jacob.jun.pan@linux.intel.com>

DMA faults can be detected by IOMMU at device level. Adding a pointer
to struct device allows IOMMU subsystem to report relevant faults
back to the device driver for further handling.
For direct assigned device (or user space drivers), guest OS holds
responsibility to handle and respond per device IOMMU fault.
Therefore we need fault reporting mechanism to propagate faults beyond
IOMMU subsystem.

There are two other IOMMU data pointers under struct device today, here
we introduce iommu_param as a parent pointer such that all device IOMMU
data can be consolidated here. The idea was suggested here by Greg KH
and Joerg. The name iommu_param is chosen here since iommu_data has been
used.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Link: https://lkml.org/lkml/2017/10/6/81
---
 include/linux/device.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index e85264fb6616..f0a975abd6e9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -42,6 +42,7 @@ struct iommu_ops;
 struct iommu_group;
 struct iommu_fwspec;
 struct dev_pin_info;
+struct iommu_param;
 
 struct bus_attribute {
 	struct attribute	attr;
@@ -959,6 +960,7 @@ struct dev_links_info {
  * 		device (i.e. the bus driver that discovered the device).
  * @iommu_group: IOMMU group the device belongs to.
  * @iommu_fwspec: IOMMU-specific properties supplied by firmware.
+ * @iommu_param: Per device generic IOMMU runtime data
  *
  * @offline_disabled: If set, the device is permanently online.
  * @offline:	Set after successful invocation of bus type's .offline().
@@ -1052,6 +1054,7 @@ struct device {
 	void	(*release)(struct device *dev);
 	struct iommu_group	*iommu_group;
 	struct iommu_fwspec	*iommu_fwspec;
+	struct iommu_param	*iommu_param;
 
 	bool			offline_disabled:1;
 	bool			offline:1;
-- 
2.21.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2019-06-03 14:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 14:57 [PATCH v2 0/4] iommu: Add device fault reporting API Jean-Philippe Brucker
2019-06-03 14:57 ` Jean-Philippe Brucker
2019-06-03 14:57 ` Jean-Philippe Brucker [this message]
2019-06-03 14:57   ` [PATCH v2 1/4] driver core: Add per device iommu param Jean-Philippe Brucker
2019-06-03 14:57 ` [PATCH v2 2/4] iommu: Introduce device fault data Jean-Philippe Brucker
2019-06-03 14:57   ` Jean-Philippe Brucker
2019-06-03 22:08   ` Jacob Pan
2019-06-03 22:08     ` Jacob Pan
2019-06-05  8:51     ` Tian, Kevin
2019-06-05  8:51       ` Tian, Kevin
2019-06-05 11:24       ` Jean-Philippe Brucker
2019-06-05 11:24         ` Jean-Philippe Brucker
2019-06-05 21:58         ` Jacob Pan
2019-06-05 21:58           ` Jacob Pan
2019-06-05 17:37       ` Jacob Pan
2019-06-05 17:37         ` Jacob Pan
2019-06-06  6:54         ` Tian, Kevin
2019-06-06  6:54           ` Tian, Kevin
2019-06-03 14:57 ` [PATCH v2 3/4] iommu: Introduce device fault report API Jean-Philippe Brucker
2019-06-03 14:57   ` Jean-Philippe Brucker
2019-06-03 14:57 ` [PATCH v2 4/4] iommu: Add recoverable fault reporting Jean-Philippe Brucker
2019-06-03 14:57   ` Jean-Philippe Brucker
2019-06-03 21:59 ` [PATCH v2 0/4] iommu: Add device fault reporting API Jacob Pan
2019-06-03 21:59   ` Jacob Pan
2019-06-05 11:26   ` Jean-Philippe Brucker
2019-06-05 11:26     ` Jean-Philippe Brucker
2019-06-12  8:19 ` Joerg Roedel
2019-06-12  8:19   ` Joerg Roedel
2019-06-12 11:54   ` Jean-Philippe Brucker
2019-06-12 11:54     ` Jean-Philippe Brucker
2019-06-12 13:11     ` Joerg Roedel
2019-06-12 13:11       ` Joerg Roedel
2019-06-12 17:59       ` [PATCH] iommu: Add padding to struct iommu_fault Jean-Philippe Brucker
2019-06-12 19:02         ` Jacob Pan
2019-06-12 19:19         ` Auger Eric
2019-06-18 15:15         ` Joerg Roedel
2019-06-12 18:58       ` [PATCH v2 0/4] iommu: Add device fault reporting API Jacob Pan
2019-06-12 18:58         ` Jacob Pan

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=20190603145749.46347-2-jean-philippe.brucker@arm.com \
    --to=jean-philippe.brucker@arm.com \
    --cc=alex.williamson@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=yi.l.liu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.