diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-03-07 15:58:19 +0000 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-03-07 15:58:19 +0000 |
commit | 942031961a12a3b2d5269c122aa9637fb1e076b1 (patch) | |
tree | e1c38deeded180563762b09232008b31c30eb49c | |
parent | e4cdd74f02eaeea96348dc51534eff8e03d87697 (diff) | |
download | xen-942031961a12a3b2d5269c122aa9637fb1e076b1.tar.gz xen-942031961a12a3b2d5269c122aa9637fb1e076b1.tar.bz2 xen-942031961a12a3b2d5269c122aa9637fb1e076b1.zip |
x86: revert 22983:0edb666c8300
run_in_exception_handler _does_ have other users.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
-rw-r--r-- | xen/arch/x86/traps.c | 19 | ||||
-rw-r--r-- | xen/include/asm-x86/bug.h | 9 | ||||
-rw-r--r-- | xen/include/asm-x86/processor.h | 1 |
3 files changed, 16 insertions, 13 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 8964fa65fe..58fbaba82c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -907,15 +907,6 @@ 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)) || @@ -926,6 +917,16 @@ 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 19fc06a0c8..05083e0168 100644 --- a/xen/include/asm-x86/bug.h +++ b/xen/include/asm-x86/bug.h @@ -13,15 +13,16 @@ struct bug_frame { unsigned short id; /* BUGFRAME_??? */ } __attribute__((packed)); -#define BUGFRAME_state 0 +#define BUGFRAME_run_fn 0 #define BUGFRAME_warn 1 #define BUGFRAME_bug 2 #define BUGFRAME_assert 3 -#define dump_execution_state() \ +#define run_in_exception_handler(fn) \ asm volatile ( \ - "ud2 ; ret %0" \ - : : "i" (BUGFRAME_state) ) + "ud2 ; ret %0" BUG_STR(1) \ + : : "i" (BUGFRAME_run_fn), \ + "i" (fn) ) #define WARN() \ asm volatile ( \ diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index c63b574976..78d9278173 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -542,6 +542,7 @@ 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); |