From: Segher Boessenkool <segher@kernel.crashing.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Oliver O'Halloran" <oohall@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/asm: Mark cr0 as clobbered in mftb()
Date: Mon, 10 Jul 2017 08:43:26 -0500 [thread overview]
Message-ID: <20170710134326.GB13471@gate.crashing.org> (raw)
In-Reply-To: <8737a4v7dd.fsf@concordia.ellerman.id.au>
Hi!
On Mon, Jul 10, 2017 at 09:50:06PM +1000, Michael Ellerman wrote:
> Oliver O'Halloran <oohall@gmail.com> writes:
>
> > The workaround for the CELL timebase bug does not correctly mark cr0 as
> > being clobbered. This can result in GCC making some poor^W completely
> > broken optimisations.
>
> Fruit 'n oats, how did we never notice that? Luck I guess. Or subtle
> breakage that no one could pin down :E
GCC does not use cr0 before it has used cr7, cr5, cr6, cr1 (unless some
instruction _requires_ cr0, like record form ("dot") instructions, which
until recently were disabled when targetting Cell), so it isn't too easy
to hit the problem here. Maybe Oliver used a very new GCC? Or he was
unlucky.
> I'll tag it for stable.
>
> Your change log is not entirely fair, it's not GCC's fault, we changed
> register state without telling it, so it's on us :) I'll reword it a
> bit here.
Yep, GCC works fine here, GIGO etc. It isn't feasible to make GCC warn
for most inline asm problems, either (we do not parse the mnemonics in
the asm; this is a fundamental part of the design; you must express all
constraints as, well, constraints).
Segher
next prev parent reply other threads:[~2017-07-10 13:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 8:46 [PATCH] powerpc/asm: Mark cr0 as clobbered in mftb() Oliver O'Halloran
2017-07-10 11:50 ` Michael Ellerman
2017-07-10 13:43 ` Segher Boessenkool [this message]
2017-07-11 2:33 ` Michael Ellerman
2017-07-11 4:02 ` Oliver
2017-07-11 12:48 ` 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=20170710134326.GB13471@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=oohall@gmail.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).