All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: joro@8bytes.org, alex.williamson@redhat.com,
	Varun.Sethi@freescale.com, udknight@gmail.com, aik@ozlabs.ru,
	rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com
Cc: Shuah Khan <shuah.kh@samsung.com>,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	shuahkhan@gmail.com
Subject: [PATCH 2/2] iommu: Change iommu driver to call report_fault trace event
Date: Fri, 16 Aug 2013 11:20:17 -0600	[thread overview]
Message-ID: <035c998d4a5508ba999a9c87ea70c73dc130e804.1376672275.git.shuah.kh@samsung.com> (raw)
In-Reply-To: <cover.1376672275.git.shuah.kh@samsung.com>
In-Reply-To: <cover.1376672275.git.shuah.kh@samsung.com>

Change iommu driver report_iommu_fault() to call report_fault trace event.
This iommu_fault class event can be enabled to trigger when an iommu fault
occurs. Trace information includes driver name, device name, iova, and flags.

Testing:
Added trace calls to iommu_prepare_identity_map() for testing some of the
conditions that are hard to trigger. Here is the trace from the testing:

       swapper/0-1     [003] ....     1.926331: report_fault: IOMMU:pci 0000:00:1d.0 iova=0x00000000cadc6000 flags=0x0001

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 include/linux/iommu.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 3aeb730..9d1c051 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -22,6 +22,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/types.h>
+#include <trace/events/iommu.h>
 
 #define IOMMU_READ	(1)
 #define IOMMU_WRITE	(2)
@@ -211,6 +212,7 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
 		ret = domain->handler(domain, dev, iova, flags,
 						domain->handler_token);
 
+	trace_report_fault(dev, iova, flags);
 	return ret;
 }
 
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: Shuah Khan <shuah.kh-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
	alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	udknight-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org,
	rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org,
	fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: Shuah Khan <shuah.kh-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	shuahkhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: [PATCH 2/2] iommu: Change iommu driver to call report_fault trace event
Date: Fri, 16 Aug 2013 11:20:17 -0600	[thread overview]
Message-ID: <035c998d4a5508ba999a9c87ea70c73dc130e804.1376672275.git.shuah.kh@samsung.com> (raw)
In-Reply-To: <cover.1376672275.git.shuah.kh-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
In-Reply-To: <cover.1376672275.git.shuah.kh-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Change iommu driver report_iommu_fault() to call report_fault trace event.
This iommu_fault class event can be enabled to trigger when an iommu fault
occurs. Trace information includes driver name, device name, iova, and flags.

Testing:
Added trace calls to iommu_prepare_identity_map() for testing some of the
conditions that are hard to trigger. Here is the trace from the testing:

       swapper/0-1     [003] ....     1.926331: report_fault: IOMMU:pci 0000:00:1d.0 iova=0x00000000cadc6000 flags=0x0001

Signed-off-by: Shuah Khan <shuah.kh-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/iommu.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 3aeb730..9d1c051 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -22,6 +22,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/types.h>
+#include <trace/events/iommu.h>
 
 #define IOMMU_READ	(1)
 #define IOMMU_WRITE	(2)
@@ -211,6 +212,7 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
 		ret = domain->handler(domain, dev, iova, flags,
 						domain->handler_token);
 
+	trace_report_fault(dev, iova, flags);
 	return ret;
 }
 
-- 
1.7.10.4

  parent reply	other threads:[~2013-08-16 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 17:20 [PATCH 0/2] iommu: Add iommu_fault class event to iommu trace Shuah Khan
2013-08-16 17:20 ` Shuah Khan
2013-08-16 17:20 ` [PATCH 1/2] " Shuah Khan
2013-08-16 17:20   ` Shuah Khan
2013-09-24 10:48   ` Joerg Roedel
2013-09-24 10:48     ` Joerg Roedel
2013-09-24 12:39     ` Shuah Khan
2013-09-24 12:39       ` Shuah Khan
2013-08-16 17:20 ` Shuah Khan [this message]
2013-08-16 17:20   ` [PATCH 2/2] iommu: Change iommu driver to call report_fault trace event Shuah Khan

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=035c998d4a5508ba999a9c87ea70c73dc130e804.1376672275.git.shuah.kh@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=Varun.Sethi@freescale.com \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=shuahkhan@gmail.com \
    --cc=udknight@gmail.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.