ia64/xen-unstable

changeset 13935:3dd92f0d8fd6

[XEN][POWERPC] Print DAR and DSISR registers on CPU register dumps

The information from these register can really help track doen
problems. They are only saved on program exception, so we show what
in the CPU at time of printing as well.

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Sat Jan 20 19:05:18 2007 -0500 (2007-01-20)
parents b8fac1c5e6ae
children 88ae0647d542
files xen/arch/powerpc/backtrace.c xen/arch/powerpc/powerpc64/asm-offsets.c xen/arch/powerpc/powerpc64/exceptions.S xen/arch/powerpc/powerpc64/traps.c xen/include/public/arch-powerpc.h
line diff
     1.1 --- a/xen/arch/powerpc/backtrace.c	Sat Jan 20 18:59:32 2007 -0500
     1.2 +++ b/xen/arch/powerpc/backtrace.c	Sat Jan 20 19:05:18 2007 -0500
     1.3 @@ -198,7 +198,6 @@ void show_backtrace_regs(struct cpu_user
     1.4      console_start_sync();
     1.5      
     1.6      show_registers(regs);
     1.7 -    printk("dar 0x%016lx, dsisr 0x%08x\n", mfdar(), mfdsisr());
     1.8      printk("hid4 0x%016lx\n", regs->hid4);
     1.9      printk("---[ backtrace ]---\n");
    1.10      show_backtrace(regs->gprs[1], regs->lr, regs->pc);
     2.1 --- a/xen/arch/powerpc/powerpc64/asm-offsets.c	Sat Jan 20 18:59:32 2007 -0500
     2.2 +++ b/xen/arch/powerpc/powerpc64/asm-offsets.c	Sat Jan 20 19:05:18 2007 -0500
     2.3 @@ -48,6 +48,8 @@ void __dummy__(void)
     2.4      OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
     2.5      OFFSET(UREGS_xer, struct cpu_user_regs, xer);
     2.6      OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
     2.7 +    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
     2.8 +    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
     2.9      OFFSET(UREGS_cr, struct cpu_user_regs, cr);
    2.10      OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
    2.11      DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
     3.1 --- a/xen/arch/powerpc/powerpc64/exceptions.S	Sat Jan 20 18:59:32 2007 -0500
     3.2 +++ b/xen/arch/powerpc/powerpc64/exceptions.S	Sat Jan 20 19:05:18 2007 -0500
     3.3 @@ -373,9 +373,15 @@ ex_machcheck_continued:
     3.4   * a better way, but this works for now. */
     3.5  ex_program_continued:
     3.6      SAVE_GPRS r14, r31, r1              /* save all the non-volatiles */
     3.7 -    /* save hid4 for debug */
     3.8 +
     3.9 +    /* save these for debug, no needed for restore */
    3.10      mfspr r14, SPRN_HID4
    3.11      std r14, UREGS_hid4(r1)
    3.12 +    mfdar r14
    3.13 +    std r14, UREGS_dar(r1)
    3.14 +    mfdsisr r14
    3.15 +    stw r14, UREGS_dsisr(r1)
    3.16 +
    3.17      mr r14, r0
    3.18      EXCEPTION_SAVE_STATE r1
    3.19      mr r4, r14
     4.1 --- a/xen/arch/powerpc/powerpc64/traps.c	Sat Jan 20 18:59:32 2007 -0500
     4.2 +++ b/xen/arch/powerpc/powerpc64/traps.c	Sat Jan 20 19:05:18 2007 -0500
     4.3 @@ -41,7 +41,15 @@ void show_registers(struct cpu_user_regs
     4.4             regs->pc, regs->msr,
     4.5             regs->lr, regs->ctr,
     4.6             regs->srr0, regs->srr1);
     4.7 -    for (i=0; i<32; i+=4) {
     4.8 +
     4.9 +    /* These come in handy for debugging but are not always saved, so
    4.10 +     * what is "actually" in the register should be good */
    4.11 +    printk("dar %016lx dsisr %08x *** saved\n"
    4.12 +           "dar %016lx dsisr %08x *** actual\n",
    4.13 +           regs->dar, regs->dsisr,
    4.14 +           mfdar(), mfdsisr());
    4.15 +
    4.16 +    for (i = 0; i < 32; i += 4) {
    4.17          printk("r%02i: %016lx %016lx %016lx %016lx\n", i,
    4.18              regs->gprs[i], regs->gprs[i+1], regs->gprs[i+2], regs->gprs[i+3]);
    4.19      }
     5.1 --- a/xen/include/public/arch-powerpc.h	Sat Jan 20 18:59:32 2007 -0500
     5.2 +++ b/xen/include/public/arch-powerpc.h	Sat Jan 20 19:05:18 2007 -0500
     5.3 @@ -77,8 +77,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
     5.4  
     5.5  typedef uint64_t xen_ulong_t;
     5.6  
     5.7 -/* User-accessible registers: need to be saved/restored for every nested Xen
     5.8 - * invocation. */
     5.9 +/* User-accessible registers: nost of these need to be saved/restored
    5.10 + * for every nested Xen invocation. */
    5.11  struct cpu_user_regs
    5.12  {
    5.13      uint64_t gprs[32];
    5.14 @@ -88,10 +88,13 @@ struct cpu_user_regs
    5.15      uint64_t srr1;
    5.16      uint64_t pc;
    5.17      uint64_t msr;
    5.18 -    uint64_t fpscr;
    5.19 +    uint64_t fpscr;             /* XXX Is this necessary */
    5.20      uint64_t xer;
    5.21 -    uint64_t hid4;
    5.22 +    uint64_t hid4;              /* debug only */
    5.23 +    uint64_t dar;               /* debug only */
    5.24 +    uint32_t dsisr;             /* debug only */
    5.25      uint32_t cr;
    5.26 +    uint32_t __pad;             /* good spot for another 32bit reg */
    5.27      uint32_t entry_vector;
    5.28  };
    5.29  typedef struct cpu_user_regs cpu_user_regs_t;