]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Add transactional memory paca scratch register to show_regs
authorMichael Neuling <mikey@neuling.org>
Wed, 13 Feb 2013 16:21:34 +0000 (16:21 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 15 Feb 2013 05:58:51 +0000 (16:58 +1100)
Add transactional memory paca scratch register to show_regs.  This is useful
for debugging.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/process.c

index 4b74c6c9d82a3a2eb4954c347b886e0f00a732c3..77c91e74b612675cd7312ea1ada7dfba7b997e9c 100644 (file)
@@ -137,6 +137,9 @@ struct paca_struct {
        u8 irq_work_pending;            /* IRQ_WORK interrupt while soft-disable */
        u8 nap_state_lost;              /* NV GPR values lost in power7_idle */
        u64 sprg3;                      /* Saved user-visible sprg */
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+       u64 tm_scratch;                 /* TM scratch area for reclaim */
+#endif
 
 #ifdef CONFIG_PPC_POWERNV
        /* Pointer to OPAL machine check event structure set by the
index 0fdc97496d7cd87ee4c4d7755687e7bc67a806e7..781190367292514e9d1fd39fdda0ab62fea54a3b 100644 (file)
@@ -126,6 +126,7 @@ int main(void)
        DEFINE(THREAD_TAR, offsetof(struct thread_struct, tar));
 #endif
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+       DEFINE(PACATMSCRATCH, offsetof(struct paca_struct, tm_scratch));
        DEFINE(THREAD_TM_TFHAR, offsetof(struct thread_struct, tm_tfhar));
        DEFINE(THREAD_TM_TEXASR, offsetof(struct thread_struct, tm_texasr));
        DEFINE(THREAD_TM_TFIAR, offsetof(struct thread_struct, tm_tfiar));
index 9ae8451bbc83b73a061d4a75d57540454787c744..612ea130c5d26e6e21c00e48d08bd04dc47c7ad4 100644 (file)
@@ -785,6 +785,10 @@ fast_exception_return:
        andc    r4,r4,r0         /* r0 contains MSR_RI here */
        mtmsrd  r4,1
 
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+       /* TM debug */
+       std     r3, PACATMSCRATCH(r13) /* Stash returned-to MSR */
+#endif
        /*
         * r13 is our per cpu area, only restore it if we are returning to
         * userspace the value stored in the stack frame may belong to
index b0a0321e4bb6370c8b50fac1b7858303c47fb51d..1cc40533021b91ced53e96e862ad00cf33c6912c 100644 (file)
@@ -753,6 +753,9 @@ void show_regs(struct pt_regs * regs)
         */
        printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
        printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
+#endif
+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
+       printk("PACATMSCRATCH [%llx]\n", get_paca()->tm_scratch);
 #endif
        show_stack(current, (unsigned long *) regs->gpr[1]);
        if (!user_mode(regs))