diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-10-04 12:57:43 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-10-04 12:57:43 +0200 |
commit | fe06795e82922f8d8c8910da545ef1215cbb1b8c (patch) | |
tree | 52d23ff18703be39afa2ccd09d8f41de15a27263 | |
parent | ef912fbf2eadfa34e61210430117b6c2a4f7c567 (diff) | |
download | xen-fe06795e82922f8d8c8910da545ef1215cbb1b8c.tar.gz xen-fe06795e82922f8d8c8910da545ef1215cbb1b8c.tar.bz2 xen-fe06795e82922f8d8c8910da545ef1215cbb1b8c.zip |
x86/traps: Record last extable faulting address
... so the following patch can identify the location of faults leading to a
decision to crash a domain.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
-rw-r--r-- | xen/arch/x86/traps.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 72e8566238..771e59a132 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -89,6 +89,7 @@ static char __read_mostly opt_nmi[10] = "fatal"; string_param("nmi", opt_nmi); DEFINE_PER_CPU(u64, efer); +static DEFINE_PER_CPU(unsigned long, last_extable_addr); DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr); @@ -550,6 +551,7 @@ static inline void do_trap( { dprintk(XENLOG_ERR, "Trap %d: %p -> %p\n", trapnr, _p(regs->eip), _p(fixup)); + this_cpu(last_extable_addr) = regs->eip; regs->eip = fixup; return; } @@ -1038,6 +1040,7 @@ void do_invalid_op(struct cpu_user_regs *regs) die: if ( (fixup = search_exception_table(regs->eip)) != 0 ) { + this_cpu(last_extable_addr) = regs->eip; regs->eip = fixup; return; } @@ -1370,6 +1373,7 @@ void do_page_fault(struct cpu_user_regs *regs) perfc_incr(copy_user_faults); if ( unlikely(regs->error_code & PFEC_reserved_bit) ) reserved_bit_page_fault(addr, regs); + this_cpu(last_extable_addr) = regs->eip; regs->eip = fixup; return; } @@ -3062,6 +3066,7 @@ void do_general_protection(struct cpu_user_regs *regs) { dprintk(XENLOG_INFO, "GPF (%04x): %p -> %p\n", regs->error_code, _p(regs->eip), _p(fixup)); + this_cpu(last_extable_addr) = regs->eip; regs->eip = fixup; return; } |