aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@citrix.com>2011-03-07 11:21:11 +0000
committerTim Deegan <Tim.Deegan@citrix.com>2011-03-07 11:21:11 +0000
commitb021dd99f4b53657537e8aec22fc1b7338e6127d (patch)
tree6aff492d32a33e41860b28264d89d40c895acdcf
parent024456981b27d793f8c17ce8e0818bfee47cc504 (diff)
downloadxen-b021dd99f4b53657537e8aec22fc1b7338e6127d.tar.gz
xen-b021dd99f4b53657537e8aec22fc1b7338e6127d.tar.bz2
xen-b021dd99f4b53657537e8aec22fc1b7338e6127d.zip
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@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
-rw-r--r--xen/arch/x86/traps.c19
-rw-r--r--xen/include/asm-x86/bug.h9
-rw-r--r--xen/include/asm-x86/processor.h1
3 files changed, 13 insertions, 16 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 58fbaba82c..8964fa65fe 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -907,6 +907,15 @@ asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
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 @@ asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
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 --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
index 05083e0168..19fc06a0c8 100644
--- a/xen/include/asm-x86/bug.h
+++ b/xen/include/asm-x86/bug.h
@@ -13,16 +13,15 @@ struct bug_frame {
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 --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 78d9278173..c63b574976 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -542,7 +542,6 @@ void show_stack(struct cpu_user_regs *regs);
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);