@@ -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;
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(-)