Message ID | 1400079481-16928-1-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
Hi Mikey and Luis, On 05/14/2014 11:58 AM, Luis Henriques wrote: > This is a note to let you know that I have just added a patch titled > > powerpc/tm: Disable IRQ in tm_recheckpoint > > to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree > which can be found at: > [...] This one seems to break a build with ubuntu-trusty.git's master-next. Reverting it made the build to pass fine. Maybe there's another commit to pull in? Thanks. > diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c > index 7e9dff8..81f929f 100644 > --- a/arch/powerpc/kernel/signal_32.c > +++ b/arch/powerpc/kernel/signal_32.c > @@ -863,6 +863,8 @@ static long restore_tm_user_regs(struct pt_regs *regs, > * transactional versions should be loaded. > */ > tm_enable(); > + /* Make sure the transaction is marked as failed */ > + current->thread.tm_texasr |= TEXASR_FS; > /* This loads the checkpointed FP/VEC state, if used */ > tm_recheckpoint(¤t->thread, msr); > /* Get the top half of the MSR */ $ fakeroot debian/rules binary-generic [...] CC arch/powerpc/kernel/signal_32.o /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c: In function ‘restore_tm_user_regs’: /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c:885:37: error: ‘TEXASR_FS’ undeclared (first use in this function) current->thread.tm_texasr |= TEXASR_FS; ^ /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c:885:37: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [arch/powerpc/kernel/signal_32.o] Error 1
Hi Mauricio, (Adding Kamal to CC) On Wed, May 21, 2014 at 09:34:51AM -0300, Mauricio Faria de Oliveira wrote: > Hi Mikey and Luis, > > On 05/14/2014 11:58 AM, Luis Henriques wrote: > >This is a note to let you know that I have just added a patch titled > > > > powerpc/tm: Disable IRQ in tm_recheckpoint > > > >to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree > >which can be found at: > > [...] > > This one seems to break a build with ubuntu-trusty.git's master-next. > Reverting it made the build to pass fine. > > Maybe there's another commit to pull in? > > Thanks. > Thank you for reporting this! Actually, for the 3.11 stable kernel (that is pulled into Saucy), I've picked Michael Neuling's backport for 3.10 that includes the definition of TEXASR_FS from commit e4e38121507a27d2ccc4b28d9e7fc4818a12c44c (which is what seems to be the cause of this build break. Kamal, maybe you could pick this for the 3.13 kernel as well? In the meantime, I'll fix ubuntu-trusty master-next branch. Cheers, -- Luís > >diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c > >index 7e9dff8..81f929f 100644 > >--- a/arch/powerpc/kernel/signal_32.c > >+++ b/arch/powerpc/kernel/signal_32.c > >@@ -863,6 +863,8 @@ static long restore_tm_user_regs(struct pt_regs *regs, > > * transactional versions should be loaded. > > */ > > tm_enable(); > >+ /* Make sure the transaction is marked as failed */ > >+ current->thread.tm_texasr |= TEXASR_FS; > > /* This loads the checkpointed FP/VEC state, if used */ > > tm_recheckpoint(¤t->thread, msr); > > /* Get the top half of the MSR */ > > > $ fakeroot debian/rules binary-generic > [...] > CC arch/powerpc/kernel/signal_32.o > /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c: In function > ‘restore_tm_user_regs’: > /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c:885:37: error: > ‘TEXASR_FS’ undeclared (first use in this function) > current->thread.tm_texasr |= TEXASR_FS; > ^ > /home/test/hdrs/k/arch/powerpc/kernel/signal_32.c:885:37: note: each > undeclared identifier is reported only once for each function it > appears in > make[3]: *** [arch/powerpc/kernel/signal_32.o] Error 1 > > > > -- > Mauricio Faria de Oliveira > IBM Linux Technology Center >
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 99222e2..bdb7c45 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -208,6 +208,7 @@ #define SPRN_ACOP 0x1F /* Available Coprocessor Register */ #define SPRN_TFIAR 0x81 /* Transaction Failure Inst Addr */ #define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */ +#define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */ #define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */ #define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */ #define SPRN_CTRLF 0x088 diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 273e9ab..db9d554 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -523,6 +523,31 @@ out_and_saveregs: tm_save_sprs(thr); } +extern void __tm_recheckpoint(struct thread_struct *thread, + unsigned long orig_msr); + +void tm_recheckpoint(struct thread_struct *thread, + unsigned long orig_msr) +{ + unsigned long flags; + + /* We really can't be interrupted here as the TEXASR registers can't + * change and later in the trecheckpoint code, we have a userspace R1. + * So let's hard disable over this region. + */ + local_irq_save(flags); + hard_irq_disable(); + + /* The TM SPRs are restored here, so that TEXASR.FS can be set + * before the trecheckpoint and no explosion occurs. + */ + tm_restore_sprs(thread); + + __tm_recheckpoint(thread, orig_msr); + + local_irq_restore(flags); +} + static inline void tm_recheckpoint_new_task(struct task_struct *new) { unsigned long msr; @@ -541,13 +566,10 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new) if (!new->thread.regs) return; - /* The TM SPRs are restored here, so that TEXASR.FS can be set - * before the trecheckpoint and no explosion occurs. - */ - tm_restore_sprs(&new->thread); - - if (!MSR_TM_ACTIVE(new->thread.regs->msr)) + if (!MSR_TM_ACTIVE(new->thread.regs->msr)){ + tm_restore_sprs(&new->thread); return; + } msr = new->thread.tm_orig_msr; /* Recheckpoint to restore original checkpointed register state. */ TM_DEBUG("*** tm_recheckpoint of pid %d " diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 7e9dff8..81f929f 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -863,6 +863,8 @@ static long restore_tm_user_regs(struct pt_regs *regs, * transactional versions should be loaded. */ tm_enable(); + /* Make sure the transaction is marked as failed */ + current->thread.tm_texasr |= TEXASR_FS; /* This loads the checkpointed FP/VEC state, if used */ tm_recheckpoint(¤t->thread, msr); /* Get the top half of the MSR */ diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 35c20a1..74d9615 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -513,6 +513,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs, } #endif tm_enable(); + /* Make sure the transaction is marked as failed */ + current->thread.tm_texasr |= TEXASR_FS; /* This loads the checkpointed FP/VEC state, if used */ tm_recheckpoint(¤t->thread, msr); diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S index e3f8da3..df71307 100644 --- a/arch/powerpc/kernel/tm.S +++ b/arch/powerpc/kernel/tm.S @@ -306,7 +306,7 @@ dont_backup_fp: * Call with IRQs off, stacks get all out of sync for * some periods in here! */ -_GLOBAL(tm_recheckpoint) +_GLOBAL(__tm_recheckpoint) mfcr r5 mflr r0 std r5, 8(r1)