Subject: Re: [PATCH 3/4] powerpc/powernv: Enable TM without suspend if possible

From: Michael Neuling <[email-masked]>
Date: Fri, 20 Oct 2017 13:47:40 +1100

On Thu, 2017-10-19 at 11:34 -0200, Tulio Magno Quites Machado Filho wrote:
> Forwarding some comments from Adhemerval sent to libc-alpha [1]...
> 
> Adhemerval Zanella <[email-masked]> writes:
> > Florian Weimer <[email-masked]> writes:
> > 
> > > On 10/12/2017 12:17 PM, Michael Ellerman wrote:
> > > > +	pr_info("Enabling TM (Transactional Memory) with Suspend
> > > > Disabled\n");
> > > > +	cur_cpu_spec->cpu_features |= CPU_FTR_TM;
> > > > +	cur_cpu_spec->cpu_user_features2 |=
> > > > PPC_FEATURE2_HTM_NO_SUSPEND;
> > > > +	tm_suspend_disabled = true;
> > > 
> > > This doesn't look right because if suspend is not available, you need to 
> > > clear the original PPC_FEATURE2_HTM flag because the semantics are not 
> > > right, so that applications can use fallback code.  Otherwise, 
> > > applications may incorrectly select the HTM code and break if running on 
> > > a system which supports HTM, but without the suspend state.
> > > 
> > > The new flag should say that HTM is supported, but without the suspend 
> > > state, and it should be always set if PPC_FEATURE2_HTM is set.
> > 
> > Will it also change TEXARS with the abort information?
> 
> It should, with a permanent error cause so that old applications entering
> suspended state can adopt another technique.
> Michael, could you clarify if this is indeed happening, please?

It will.

If we hit a tsuspend and we are in this mode, the hardware will abort us and set
the Failure Persistent bit (unless there is some other exception pending at the
same time which causes the abort).

Mikey