linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Breno Leitao <leitao@debian.org>, Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org, stewart@linux.vnet.ibm.com, cyrilbur@gmail.com
Subject: Re: [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory
Date: Sat, 21 Oct 2017 11:58:47 +1100	[thread overview]
Message-ID: <1508547527.23934.4.camel@neuling.org> (raw)
In-Reply-To: <20171020114539.piyh4wmby5gz7qnb@gmail.com>

On Fri, 2017-10-20 at 09:45 -0200, Breno Leitao wrote:
> Mikey, Cyril,
>=20
> On Thu, Oct 12, 2017 at 09:17:16PM +1100, Michael Ellerman wrote:
> > From: Cyril Bur <cyrilbur@gmail.com>
> >=20
> > Currently the kernel relies on firmware to inform it whether or not the
> > CPU supports HTM and as long as the kernel was built with
> > CONFIG_PPC_TRANSACTIONAL_MEM=3Dy then it will allow userspace to make
> > use of the facility.
> >=20
> > There may be situations where it would be advantageous for the kernel
> > to not allow userspace to use HTM, currently the only way to achieve
> > this is to recompile the kernel with CONFIG_PPC_TRANSACTIONAL_MEM=3Dn.
> >=20
> > This patch adds a simple commandline option so that HTM can be
> > disabled at boot time.
> >=20
> > Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> > [mpe: Simplify to a bool, move to prom.c, put doco in the right place.
> > =C2=A0Always disable, regardless of initial state, to avoid user confus=
ion.]
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> > ---
> > =C2=A0Documentation/admin-guide/kernel-parameters.txt |=C2=A0=C2=A04 ++=
++
> > =C2=A0arch/powerpc/kernel/prom.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0| 31
> > +++++++++++++++++++++++++
> > =C2=A02 files changed, 35 insertions(+)
> >=20
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt
> > b/Documentation/admin-guide/kernel-parameters.txt
> > index 05496622b4ef..ef03e6e16bdb 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -3185,6 +3185,10 @@
> > =C2=A0			allowed (eg
> > kernel_enable_fpu()/kernel_disable_fpu()).
> > =C2=A0			There is some performance impact when enabling
> > this.
> > =C2=A0
> > +	ppc_tm=3D		[PPC]
> > +			Format: {"off"}
> > +			Disable Hardware Transactional Memory
> > +
> > =C2=A0	print-fatal-signals=3D
> > =C2=A0			[KNL] debug: print fatal signals
> > =C2=A0
> > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> > index f83056297441..d9bd6555f980 100644
> > --- a/arch/powerpc/kernel/prom.c
> > +++ b/arch/powerpc/kernel/prom.c
> > @@ -658,6 +658,35 @@ static void __init early_reserve_mem(void)
> > =C2=A0#endif
> > =C2=A0}
> > =C2=A0
> > +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> > +static bool tm_disabled __initdata;
>=20
> I think the name 'tm_disabled' might cause more confusion on the TM
> code. Mainly because we already have tm_enable() and tm_enabled()
> functions which are related to the MSR register and TM bit, and, with
> your new variable, tm_enabled() and tm_disabled are not going to be
> exclusionary. Neither tm_enable() with be able to toggle the tm_disabled
> value.

Got a proposal for better names?

Mikey

  parent reply	other threads:[~2017-10-21  0:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 10:17 [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory Michael Ellerman
2017-10-12 10:17 ` [PATCH 2/4] powerpc: Add PPC_FEATURE2_HTM_NO_SUSPEND Michael Ellerman
2017-10-12 10:17 ` [PATCH 3/4] powerpc/powernv: Enable TM without suspend if possible Michael Ellerman
2017-10-19 10:07   ` Florian Weimer
2017-10-19 12:04     ` Tulio Magno Quites Machado Filho
2017-10-19 12:45       ` Florian Weimer
2017-10-19 13:34     ` Tulio Magno Quites Machado Filho
2017-10-19 15:13       ` Adhemerval Zanella
2017-10-22  9:59         ` Michael Ellerman
2017-10-20  2:47       ` Michael Neuling
2017-10-22  9:48       ` Michael Ellerman
2017-10-22  9:54     ` Michael Ellerman
2017-10-12 10:17 ` [PATCH 4/4] powerpc/tm: P9 disable transactionally suspended sigcontexts Michael Ellerman
2017-10-12 11:58 ` [PATCH 5/4] KVM: PPC: Tie KVM_CAP_PPC_HTM to the user-visible TM feature Michael Ellerman
2017-10-24  8:08   ` [5/4] " Michael Ellerman
2017-10-20 11:45 ` [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory Breno Leitao
2017-10-20 12:58   ` David Laight
2017-10-21  1:00     ` Michael Neuling
2017-10-23  9:01       ` David Laight
2017-10-23  9:15         ` Michael Neuling
2017-10-21  0:58   ` Michael Neuling [this message]
2017-10-23 12:56     ` Breno Leitao
2017-10-24  8:12       ` Michael Ellerman
2017-10-24  8:08 ` [1/4] " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508547527.23934.4.camel@neuling.org \
    --to=mikey@neuling.org \
    --cc=cyrilbur@gmail.com \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=stewart@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).