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-ppc-devel

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Print DAR and DSISR registers

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [XEN][POWERPC] Print DAR and DSISR registers on CPU register dumps
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 21 Jan 2007 00:30:15 +0000
Delivery-date: Sat, 20 Jan 2007 16:29:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID b4b7249f00d6063286d8d7240f4341e08bd2ee91
# Parent  ae504a49923cd7d4446022f300498d95271ffbd1
[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@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/backtrace.c             |    1 -
 xen/arch/powerpc/powerpc64/asm-offsets.c |    2 ++
 xen/arch/powerpc/powerpc64/exceptions.S  |    8 +++++++-
 xen/arch/powerpc/powerpc64/traps.c       |   10 +++++++++-
 xen/include/public/arch-powerpc.h        |   11 +++++++----
 5 files changed, 25 insertions(+), 7 deletions(-)

diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c      Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/backtrace.c      Sat Jan 20 19:05:18 2007 -0500
@@ -198,7 +198,6 @@ void show_backtrace_regs(struct cpu_user
     console_start_sync();
     
     show_registers(regs);
-    printk("dar 0x%016lx, dsisr 0x%08x\n", mfdar(), mfdsisr());
     printk("hid4 0x%016lx\n", regs->hid4);
     printk("---[ backtrace ]---\n");
     show_backtrace(regs->gprs[1], regs->lr, regs->pc);
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/asm-offsets.c
--- a/xen/arch/powerpc/powerpc64/asm-offsets.c  Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/asm-offsets.c  Sat Jan 20 19:05:18 2007 -0500
@@ -48,6 +48,8 @@ void __dummy__(void)
     OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
     OFFSET(UREGS_xer, struct cpu_user_regs, xer);
     OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
+    OFFSET(UREGS_dar, struct cpu_user_regs, dar);
+    OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
     OFFSET(UREGS_cr, struct cpu_user_regs, cr);
     OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
     DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/exceptions.S
--- a/xen/arch/powerpc/powerpc64/exceptions.S   Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/exceptions.S   Sat Jan 20 19:05:18 2007 -0500
@@ -373,9 +373,15 @@ ex_machcheck_continued:
  * a better way, but this works for now. */
 ex_program_continued:
     SAVE_GPRS r14, r31, r1              /* save all the non-volatiles */
-    /* save hid4 for debug */
+
+    /* save these for debug, no needed for restore */
     mfspr r14, SPRN_HID4
     std r14, UREGS_hid4(r1)
+    mfdar r14
+    std r14, UREGS_dar(r1)
+    mfdsisr r14
+    stw r14, UREGS_dsisr(r1)
+
     mr r14, r0
     EXCEPTION_SAVE_STATE r1
     mr r4, r14
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/traps.c
--- a/xen/arch/powerpc/powerpc64/traps.c        Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/traps.c        Sat Jan 20 19:05:18 2007 -0500
@@ -41,7 +41,15 @@ void show_registers(struct cpu_user_regs
            regs->pc, regs->msr,
            regs->lr, regs->ctr,
            regs->srr0, regs->srr1);
-    for (i=0; i<32; i+=4) {
+
+    /* These come in handy for debugging but are not always saved, so
+     * what is "actually" in the register should be good */
+    printk("dar %016lx dsisr %08x *** saved\n"
+           "dar %016lx dsisr %08x *** actual\n",
+           regs->dar, regs->dsisr,
+           mfdar(), mfdsisr());
+
+    for (i = 0; i < 32; i += 4) {
         printk("r%02i: %016lx %016lx %016lx %016lx\n", i,
             regs->gprs[i], regs->gprs[i+1], regs->gprs[i+2], regs->gprs[i+3]);
     }
diff -r ae504a49923c -r b4b7249f00d6 xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/include/public/arch-powerpc.h Sat Jan 20 19:05:18 2007 -0500
@@ -77,8 +77,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 typedef uint64_t xen_ulong_t;
 
-/* User-accessible registers: need to be saved/restored for every nested Xen
- * invocation. */
+/* User-accessible registers: nost of these need to be saved/restored
+ * for every nested Xen invocation. */
 struct cpu_user_regs
 {
     uint64_t gprs[32];
@@ -88,10 +88,13 @@ struct cpu_user_regs
     uint64_t srr1;
     uint64_t pc;
     uint64_t msr;
-    uint64_t fpscr;
+    uint64_t fpscr;             /* XXX Is this necessary */
     uint64_t xer;
-    uint64_t hid4;
+    uint64_t hid4;              /* debug only */
+    uint64_t dar;               /* debug only */
+    uint32_t dsisr;             /* debug only */
     uint32_t cr;
+    uint32_t __pad;             /* good spot for another 32bit reg */
     uint32_t entry_vector;
 };
 typedef struct cpu_user_regs cpu_user_regs_t;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [XEN][POWERPC] Print DAR and DSISR registers on CPU register dumps, Xen patchbot-xenppc-unstable <=