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

Michael Ellerman mpe at ellerman.id.au
Sun Oct 22 20:54:43 AEDT 2017


Florian Weimer <fweimer at redhat.com> 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.

Yes I agree, but the PPC_FEATURE2_HTM bit is already clear. I've updated
the patch to clear it explicitly, see my other mail.

> Otherwise, 
> applications may incorrectly select the HTM code and break if running on 
> a system which supports HTM, but without the suspend state.

Yes.

> 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.

I don't agree with that. HTM and HTM_NO_SUSPEND are mutually exclusive.

I don't understand how it would work if HTM_NO_SUSPEND was "always set
if PPC_FEATURE2_HTM is set"? That would tell apps that HTM with suspend
is supported and HTM without suspend is supported, which is meaningless
AFAICS.

cheers


More information about the Linuxppc-dev mailing list