From: Greg KH <gregkh@linuxfoundation.org>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>
Cc: benh@kernel.crashing.org, mpe@ellerman.id.au, stable@vger.kernel.org
Subject: Re: [PATCH 4.4] powerpc: Disable HFSCR[TM] if TM is not supported
Date: Wed, 19 Apr 2017 13:41:17 +0200 [thread overview]
Message-ID: <20170419114117.GG27378@kroah.com> (raw)
In-Reply-To: <20170419065307.GA306@tungsten.ozlabs.ibm.com>
On Wed, Apr 19, 2017 at 04:53:07PM +1000, Sam Bobroff wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> commit 7ed23e1bae8bf7e37fd555066550a00b95a3a98b upstream.
>
> On Power8 & Power9 the early CPU inititialisation in __init_HFSCR()
> turns on HFSCR[TM] (Hypervisor Facility Status and Control Register
> [Transactional Memory]), but that doesn't take into account that TM
> might be disabled by CPU features, or disabled by the kernel being built
> with CONFIG_PPC_TRANSACTIONAL_MEM=n.
>
> So later in boot, when we have setup the CPU features, clear HSCR[TM] if
> the TM CPU feature has been disabled. We use CPU_FTR_TM_COMP to account
> for the CONFIG_PPC_TRANSACTIONAL_MEM=n case.
>
> Without this a KVM guest might try use TM, even if told not to, and
> cause an oops in the host kernel. Typically the oops is seen in
> __kvmppc_vcore_entry() and may or may not be fatal to the host, but is
> always bad news.
>
> In practice all shipping CPU revisions do support TM, and all host
> kernels we are aware of build with TM support enabled, so no one should
> actually be able to hit this in the wild.
>
> Fixes: 2a3563b023e5 ("powerpc: Setup in HFSCR for POWER8")
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Tested-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> [mpe: Rewrite change log with input from Sam, add Fixes/stable]
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [sb: Backported to linux-4.4.y: adjusted context]
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
> Hi Stable,
>
> This is a fixed version of a patch that did not apply cleanly on
> linux-4.4.y. The patch context had changed slightly.
Thanks, now queued up!
greg k-h
prev parent reply other threads:[~2017-04-19 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170410143523.7F791AC03A@b01ledav006.gho.pok.ibm.com>
2017-04-19 6:53 ` [PATCH 4.4] powerpc: Disable HFSCR[TM] if TM is not supported Sam Bobroff
2017-04-19 11:41 ` Greg KH [this message]
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=20170419114117.GG27378@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=benh@kernel.crashing.org \
--cc=mpe@ellerman.id.au \
--cc=sam.bobroff@au1.ibm.com \
--cc=stable@vger.kernel.org \
/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).