<p dir="ltr">How is it causing the problem?</p>
<p dir="ltr">Mikey</p>
<p dir="ltr">On 29 Apr 2014 17:02, "Anshuman Khandual" <<a href="mailto:khandual@linux.vnet.ibm.com">khandual@linux.vnet.ibm.com</a>> wrote:<br>
><br>
> On 04/02/2014 03:02 PM, Anshuman Khandual wrote:<br>
> > On 04/02/2014 12:32 PM, Anshuman Khandual wrote:<br>
> >>      This patch series adds new ELF note sections which are used to<br>
> >> create new ptrace request macros for various transactional memory and<br>
> >> miscellaneous registers on PowerPC. Please find the test case exploiting<br>
> >> the new ptrace request macros and it's results on a POWER8 system.<br>
> >><br>
> >> RFC: <a href="https://lkml.org/lkml/2014/4/1/292">https://lkml.org/lkml/2014/4/1/292</a><br>
> >><br>
> >> ============================== Results ==============================<br>
> >> -------TM specific SPR------<br>
> >> TM TFHAR: 100009dc<br>
> >> TM TEXASR: de000001ac000001<br>
> >> TM TFIAR: c00000000003f386<br>
> >> TM CH ORIG_MSR: 900000050000f032<br>
> >> TM CH TAR: 6<br>
> >> TM CH PPR: c000000000000<br>
> >> TM CH DSCR: 1<br>
> >> -------TM checkpointed GPR-----<br>
> >> TM CH GPR[0]: 1000097c<br>
> >> TM CH GPR[1]: 5<br>
> >> TM CH GPR[2]: 6<br>
> >> TM CH GPR[7]: 1<br>
> >> TM CH NIP: 100009dc<br>
> >> TM CH LINK: 1000097c<br>
> >> TM CH CCR: 22000422<br>
> >> -------TM running GPR-----<br>
> >> TM RN GPR[0]: 1000097c<br>
> >> TM RN GPR[1]: 7<br>
> >> TM RN GPR[2]: 8<br>
> >> TM RN GPR[7]: 5<br>
> >> TM RN NIP: 100009fc<br>
> >> TM RN LINK: 1000097c<br>
> >> TM RN CCR: 2000422<br>
> >> -------TM running FPR-----<br>
> >> TM RN FPR[0]: 1002d3a3780<br>
> >> TM RN FPR[1]: 7<br>
> >> TM RN FPR[2]: 8<br>
> >> TM RN FPSCR: 0<br>
> >> -------TM checkpointed FPR-----<br>
> >> TM CH FPR[0]: 1002d3a3780<br>
> >> TM CH FPR[1]: 5<br>
> >> TM CH FPR[2]: 6<br>
> >> TM CH FPSCR: 0<br>
> >> -------Running miscellaneous registers-------<br>
> > TM RN DSCR: 0<br>
> ><br>
> > There is a problem in here which I forgot to mention. The running DSCR value<br>
> > comes from thread->dscr component of the target process. While we are inside the<br>
> > transaction (which is the case here as we are stuck at "b ." instruction and<br>
> > have not reached TEND) thread->dscr should have the running value of the DSCR<br>
> > register at that point of time. Here we expect the DSCR value to be 5 instead<br>
> > of 0 as shown in the output above. During the tests when I moved the "b ." after<br>
> > TEND, the thread->dscr gets the value of 5 while all check pointed reg values are<br>
> > thrown away. I believe there is some problem in the way thread->dscr context<br>
> > is saved away inside the TM section. Will look into this problem further and<br>
> > keep informed.<br>
><br>
> Reason behind this inconsistent DSCR register value is because of the following commit<br>
> where the kernel reverts the DSCR register into a default value to avoid running with<br>
> the user set value for a long time, thus preventing any potential performance degradation.<br>
> Same reason applies to the PPR register as well. So its not a problem but an expected<br>
> behaviour.<br>
><br>
> commit e9bdc3d6143d1c4b8d8ce5231fc958268331f983<br>
> Author: Michael Neuling <<a href="mailto:mikey@neuling.org">mikey@neuling.org</a>><br>
> Date:   Thu Sep 26 13:29:09 2013 +1000<br>
><br>
>     powerpc/tm: Switch out userspace PPR and DSCR sooner<br>
><br>
>     When we do a treclaim or trecheckpoint we end up running with userspace<br>
>     PPR and DSCR values.  Currently we don't do anything special to avoid<br>
>     running with user values which could cause a severe performance<br>
>     degradation.<br>
><br>
>     This patch moves the PPR and DSCR save and restore around treclaim and<br>
>     trecheckpoint so that we run with user values for a much shorter period.<br>
>     More care is taken with the PPR as it's impact is greater than the DSCR.<br>
><br>
>     This is similar to user exceptions, where we run HTM_MEDIUM early to<br>
>     ensure that we don't run with a userspace PPR values in the kernel.<br>
><br>
</p>