From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: "DATACOM - Felipe.Rechia" <felipe.rechia@datacom.com.br>,
linuxppc-dev@lists.ozlabs.org
Cc: Zaneti <paulo.zaneti@datacom.com.br>
Subject: Re: powerpc/process: Fix flush_all_to_thread for SPE
Date: Wed, 31 Oct 2018 16:43:00 +1100 (AEDT) [thread overview]
Message-ID: <42lHLD5qp5z9sNH@ozlabs.org> (raw)
In-Reply-To: <344813002.4841437.1540469274858.JavaMail.zimbra@datacom.com.br>
On Thu, 2018-10-25 at 12:07:54 UTC, "DATACOM - Felipe.Rechia" wrote:
> From: "Felipe Rechia" <felipe.rechia@datacom.com.br>
> Date: Wed, 24 Oct 2018 10:57:22 -0300
> Subject: [PATCH] powerpc/process: Fix flush_all_to_thread for SPE
>
> Fix a bug introduced by the creation of flush_all_to_thread() for
> processors that have SPE (Signal Processing Engine) and use it to
> compute floating-point operations.
>
> >From userspace perspective, the problem was seen in attempts of
> computing floating-point operations which should generate exceptions.
> For example:
>
> fork();
> float x = 0.0 / 0.0;
> isnan(x); // forked process returns False (should be True)
>
> The operation above also should always cause the SPEFSCR FINV bit to
> be set. However, the SPE floating-point exceptions were turned off
> after a fork().
>
> Kernel versions prior to the bug used flush_spe_to_thread(), which
> first saves SPEFSCR register values in tsk->thread and then calls
> giveup_spe(tsk).
>
> After commit 579e633e764e, the save_all() function was called first
> to giveup_spe(), and then the SPEFSCR register values were saved in
> tsk->thread. This would save the SPEFSCR register values after
> disabling SPE for that thread, causing the bug described above.
>
> Fixes 579e633e764e ("powerpc: create flush_all_to_thread()")
> Signed-off-by: felipe.rechia <felipe.rechia@datacom.com.br>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e901378578c62202594cba0f6c076f
cheers
prev parent reply other threads:[~2018-10-31 5:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 12:07 [PATCH] powerpc/process: Fix flush_all_to_thread for SPE DATACOM - Felipe.Rechia
2018-10-31 5:43 ` 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=42lHLD5qp5z9sNH@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=felipe.rechia@datacom.com.br \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulo.zaneti@datacom.com.br \
/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