From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Michael Neuling <mikey@neuling.org>
Cc: Gustavo Bueno Romero <gromero@br.ibm.com>,
mikey@neuling.org, linuxppc-dev@lists.ozlabs.org,
cyrilbur@gmail.com, Breno Leitao <brenohl@br.ibm.com>
Subject: Re: [1/2] powerpc/tm: Fix FP and VMX register corruption
Date: Wed, 17 May 2017 19:34:34 +1000 (AEST) [thread overview]
Message-ID: <3wSTfy2wh7z9s7w@ozlabs.org> (raw)
In-Reply-To: <20170508071627.21851-1-mikey@neuling.org>
On Mon, 2017-05-08 at 07:16:26 UTC, Michael Neuling wrote:
> In this commit:
> commit dc3106690b20305c3df06b42456fe386dd632ac9
> Author: Cyril Bur <cyrilbur@gmail.com>
> powerpc: tm: Always use fp_state and vr_state to store live registers
>
> A section of code was removed that copied the current state to
> checkpointed state. This should not have been removed.
>
> When an FP unavailable is taken inside a transaction, we need to abort
> the transaction. This is because at the time of the tbegin, the FP
> state is bogus so the state stored in the checkpointed registers is
> incorrect. To fix this, we treclaim (to get the checkpointed GPRs) and
> then copy the thread_struct FP live state into the checkpointed
> state. We then trecheckpoint so that the FP state is correctly
> restored into the CPU.
>
> The coping of the FP registers from live to checkpointed is what was
> missing.
>
> This simplifies the logic slightly from the original patch.
> tm_reclaim_thread() will now always write the checkpointed FP
> state. Either the checkpointed FP statte will be written as part of
> the actual treclaim (in tm.S), or it'll be a copy of the live
> state. Which one we use is based on MSR[FP] from userspace.
>
> Similarly for VMX.
>
> CC: <stable@vger.kernel.org> # 4.9+
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> Reviewed-by: cyrilbur@gmail.com
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/f48e91e87e67b56bef63393d1a02c6
cheers
prev parent reply other threads:[~2017-05-17 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 7:16 [PATCH 1/2] powerpc/tm: Fix FP and VMX register corruption Michael Neuling
2017-05-08 7:16 ` [PATCH 2/2] selftests/powerpc: Test TM and VMX register state Michael Neuling
2017-05-12 15:16 ` Cyril Bur
2017-05-15 9:31 ` Michael Ellerman
2017-05-17 9:34 ` [2/2] " Michael Ellerman
2017-05-12 15:26 ` [PATCH 1/2] powerpc/tm: Fix FP and VMX register corruption Cyril Bur
2017-05-15 9:23 ` Michael Ellerman
2017-05-17 9:34 ` Michael Ellerman [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=3wSTfy2wh7z9s7w@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=brenohl@br.ibm.com \
--cc=cyrilbur@gmail.com \
--cc=gromero@br.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.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).