xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>, Feng Wu <feng.wu@intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v1 5/7] iommu: Remove dependency on __LINE__ for release builds
Date: Fri, 6 May 2016 16:48:06 +0100	[thread overview]
Message-ID: <1462549688-29263-6-git-send-email-ross.lagerwall@citrix.com> (raw)
In-Reply-To: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com>

When using xsplice, use of __LINE__ can generate spurious changes in
functions due to embedded line numbers.  For release builds, remove the
use of these line numbers in IOMMU_WAIT_OP() and print the current text
address instead.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/drivers/passthrough/vtd/dmar.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h
index 729b603..3a7bfe0 100644
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -108,6 +108,15 @@ struct acpi_atsr_unit *acpi_find_matched_atsr_unit(const struct pci_dev *);
 
 #define DMAR_OPERATION_TIMEOUT MILLISECS(1000)
 
+#ifdef NDEBUG
+#define IOMMU_WAIT_OP_PANIC \
+    panic("%p: DMAR hardware is malfunctional", current_text_addr());
+#else
+#define IOMMU_WAIT_OP_PANIC \
+    panic("%s:%d:%s: DMAR hardware is malfunctional",  \
+          __FILE__, __LINE__, __func__);
+#endif
+
 #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \
 do {                                                \
     s_time_t start_time = NOW();                    \
@@ -117,8 +126,7 @@ do {                                                \
             break;                                  \
         if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) {    \
             if ( !kexecing )                                    \
-                panic("%s:%d:%s: DMAR hardware is malfunctional",\
-                      __FILE__, __LINE__, __func__);            \
+                IOMMU_WAIT_OP_PANIC                             \
             else                                                \
                 break;                                          \
         }                                                       \
-- 
2.4.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-05-06 15:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 15:48 [PATCH v1 0/7] Make building xSplice patches easier Ross Lagerwall
2016-05-06 15:48 ` [PATCH v1 1/7] lib: Add a generic implementation of current_text_addr() Ross Lagerwall
2016-05-10  8:18   ` Dario Faggioli
2016-05-10 14:34   ` Jan Beulich
2016-05-06 15:48 ` [PATCH v1 2/7] sched: Remove dependency on __LINE__ for release builds Ross Lagerwall
2016-05-10 14:39   ` Jan Beulich
2016-05-06 15:48 ` [PATCH v1 3/7] mm: Use statically defined locking order Ross Lagerwall
2016-05-10  8:25   ` Dario Faggioli
2016-05-10 14:42   ` Jan Beulich
2016-05-10 14:46   ` Andrew Cooper
2016-05-06 15:48 ` [PATCH v1 4/7] page-alloc: Remove dependency on __LINE__ for release builds Ross Lagerwall
2016-05-10 14:40   ` Andrew Cooper
2016-05-10 14:46   ` Jan Beulich
2016-05-06 15:48 ` Ross Lagerwall [this message]
2016-05-10 14:48   ` [PATCH v1 5/7] iommu: " Jan Beulich
2016-05-06 15:48 ` [PATCH v1 6/7] acpi: " Ross Lagerwall
2016-05-10 14:52   ` Jan Beulich
2016-05-06 15:48 ` [PATCH v1 7/7] Rename sections for compatibility with -ffunction-sections -fdata-sections Ross Lagerwall
2016-05-10 11:42   ` Julien Grall
2016-05-10 14:24   ` Jan Beulich
2016-05-09 12:43 ` [PATCH v1 0/7] Make building xSplice patches easier Wei Liu
2016-05-10 16:36 ` Konrad Rzeszutek Wilk
2017-01-31  3:05 ` Doug Goldstein
2017-01-31 13:42   ` Ross Lagerwall

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=1462549688-29263-6-git-send-email-ross.lagerwall@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=feng.wu@intel.com \
    --cc=jbeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).