# 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
|