xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v2 6/6] xen/arm: Remove dependency on __LINE__ for release builds
Date: Wed, 8 Mar 2017 17:46:55 +0000	[thread overview]
Message-ID: <1488995215-7647-7-git-send-email-ross.lagerwall@citrix.com> (raw)
In-Reply-To: <1488995215-7647-1-git-send-email-ross.lagerwall@citrix.com>

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

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/arm/traps.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 614501f..059afe7 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -82,14 +82,28 @@ static inline void check_stack_alignment_constraints(void) {
  * Compared with regular BUG_ON it dumps the guest vcpu state instead
  * of Xen's state.
  */
+#if defined(NDEBUG) && defined(CONFIG_LIVEPATCH)
+#define guest_bug_on_failed(p)                          \
+do {                                                    \
+    panic("Guest Bug: %pv: '%s', address %pS\n",        \
+          current, p, current_text_addr());             \
+} while (0)
+#else
 #define guest_bug_on_failed(p)                          \
 do {                                                    \
-    show_execution_state(guest_cpu_user_regs());        \
     panic("Guest Bug: %pv: '%s', line %d, file %s\n",   \
           current, p, __LINE__, __FILE__);              \
 } while (0)
-#define GUEST_BUG_ON(p) \
-    do { if ( unlikely(p) ) guest_bug_on_failed(#p); } while (0)
+#endif
+
+#define GUEST_BUG_ON(p)                                 \
+do {                                                    \
+    if ( unlikely(p) )                                  \
+    {                                                   \
+        show_execution_state(guest_cpu_user_regs());    \
+        guest_bug_on_failed(#p);                        \
+    }                                                   \
+} while (0)
 
 #ifdef CONFIG_ARM_32
 static int debug_stack_lines = 20;
-- 
2.7.4


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

  parent reply	other threads:[~2017-03-08 17:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 17:46 [PATCH v2 0/6] Remove dependency on __LINE__ Ross Lagerwall
2017-03-08 17:46 ` [PATCH v2 1/6] lib: Add a generic implementation of current_text_addr() Ross Lagerwall
2017-03-09  8:52   ` Dario Faggioli
2017-03-09 10:29   ` Jan Beulich
2017-03-08 17:46 ` [PATCH v2 2/6] sched: Remove dependency on __LINE__ for release builds Ross Lagerwall
2017-03-09  9:03   ` Dario Faggioli
2017-03-08 17:46 ` [PATCH v2 3/6] mm: Use statically defined locking order Ross Lagerwall
2017-03-20 13:52   ` George Dunlap
2017-03-08 17:46 ` [PATCH v2 4/6] iommu: Remove dependency on __LINE__ for release builds Ross Lagerwall
2017-03-09 10:42   ` Jan Beulich
2017-03-15 10:07   ` Tian, Kevin
     [not found]   ` <5940F13702000000000EA4B6@prv-mh.provo.novell.com>
2017-12-07 11:00     ` Jan Beulich
2017-03-08 17:46 ` [PATCH v2 5/6] x86_emulate: " Ross Lagerwall
2017-03-09 10:45   ` Jan Beulich
2017-03-08 17:46 ` Ross Lagerwall [this message]
2017-03-09 10:34 ` [PATCH v2 0/6] Remove dependency on __LINE__ Jan Beulich
2017-03-10  8:29   ` Ross Lagerwall
2017-03-10  8:50     ` Jan Beulich
2017-03-17  8:57       ` Ross Lagerwall
2017-03-17  9:10         ` Jan Beulich

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=1488995215-7647-7-git-send-email-ross.lagerwall@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --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).