WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Xen: remove run_in_exception_handler() an

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Xen: remove run_in_exception_handler() and recode its only caller
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 10 Mar 2011 22:20:10 +0000
Delivery-date: Thu, 10 Mar 2011 14:22:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1299496871 0
# Node ID 0edb666c8300863d570ab29ad9cb9c82531625b9
# Parent  591c459ee00a93cada4f78ac61ce08c9115ecfc5
Xen: remove run_in_exception_handler() and recode its only caller
(dump_execution_state()) as its own bug-trap.

This is needed to compile xen with clang, which can't handle using a
function name in an asm immediate.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 591c459ee00a -r 0edb666c8300 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Mar 07 11:21:11 2011 +0000
+++ b/xen/arch/x86/traps.c      Mon Mar 07 11:21:11 2011 +0000
@@ -907,6 +907,15 @@
         goto die;
     eip += sizeof(bug);
 
+    id = bug.id & 3;
+
+    if ( id == BUGFRAME_state )
+    {
+        show_execution_state(regs);
+        regs->eip = (unsigned long)eip;
+        return;
+    }
+
     /* Decode first pointer argument. */
     if ( !is_kernel(eip) ||
          __copy_from_user(&bug_str, eip, sizeof(bug_str)) ||
@@ -917,16 +926,6 @@
         goto die;
     eip += sizeof(bug_str);
 
-    id = bug.id & 3;
-
-    if ( id == BUGFRAME_run_fn )
-    {
-        void (*fn)(struct cpu_user_regs *) = (void *)p;
-        (*fn)(regs);
-        regs->eip = (unsigned long)eip;
-        return;
-    }
-
     /* WARN, BUG or ASSERT: decode the filename pointer and line number. */
     filename = p;
     lineno = bug.id >> 2;
diff -r 591c459ee00a -r 0edb666c8300 xen/include/asm-x86/bug.h
--- a/xen/include/asm-x86/bug.h Mon Mar 07 11:21:11 2011 +0000
+++ b/xen/include/asm-x86/bug.h Mon Mar 07 11:21:11 2011 +0000
@@ -13,16 +13,15 @@
     unsigned short id; /* BUGFRAME_??? */
 } __attribute__((packed));
 
-#define BUGFRAME_run_fn 0
+#define BUGFRAME_state  0
 #define BUGFRAME_warn   1
 #define BUGFRAME_bug    2
 #define BUGFRAME_assert 3
 
-#define run_in_exception_handler(fn)               \
+#define dump_execution_state()                     \
     asm volatile (                                 \
-        "ud2 ; ret %0" BUG_STR(1)                  \
-        : : "i" (BUGFRAME_run_fn),                 \
-            "i" (fn) )
+        "ud2 ; ret %0"                             \
+        : : "i" (BUGFRAME_state) )
 
 #define WARN()                                     \
     asm volatile (                                 \
diff -r 591c459ee00a -r 0edb666c8300 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h   Mon Mar 07 11:21:11 2011 +0000
+++ b/xen/include/asm-x86/processor.h   Mon Mar 07 11:21:11 2011 +0000
@@ -542,7 +542,6 @@
 void show_stack_overflow(unsigned int cpu, unsigned long esp);
 void show_registers(struct cpu_user_regs *regs);
 void show_execution_state(struct cpu_user_regs *regs);
-#define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
 asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Xen: remove run_in_exception_handler() and recode its only caller, Xen patchbot-unstable <=