On Thu, 2013-06-20 at 00:51 +0200, Torvald Riegel wrote: > On Wed, 2013-06-19 at 14:43 -0500, Peter Bergner wrote: > >> I'm having trouble seeing why/when _ITM_inTransaction() is > >> returning something other than inIrrevocableTransaction. I'll see if I can > >> determine why and will report back. > > > > Ok, we return outsideTransaction because the nesting level (tx->nesting) > > is zero. > > That's a second bug in libitm, sorry. Can you try with the attached > patch additionally to the previous one? Thanks!
Ok, with this patch, plus adding a powerpc implementation of htm_transaction_active(), reentrant.c now executes correctly on both HTM and non-HTM hardware for me. Thanks for all of your help with this! I'd still like to hear from Andreas, whether the reentrant.c test case with both patches, now works on S390. I'll note unlike your x86 htm_transaction_active() implementation, my implementation has to check for htm_available() first before executing the htm instruction which tells me whether I'm in transaction state or not, otherwise I'll get a SIGILL on non-HTM hardware. Unfortunately, my htm_available() call uses getauxval() to query the AUXV for a hwcap bit. Is there a place I can stash the result of the first call, so that subsequent calls use the cached value? Normally, I could use a static var, but I doubt that is what we want to do in static inline functions. Peter