qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael Walle <michael@walle.cc>,
	Paolo Bonzini <paolo.bonzini@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] milkymist-pfpu: fix GCC 5.0.0 aggressive-loop-optimizations warning
Date: Fri, 20 Feb 2015 16:48:12 +0100	[thread overview]
Message-ID: <20150220154811.GC3974@potion.brq.redhat.com> (raw)
In-Reply-To: <54E74AFE.6030004@redhat.com>

2015-02-20 15:55+0100, Paolo Bonzini:
> 
> 
> On 20/02/2015 15:52, Michael Walle wrote:
> >>>
> >>> -            i = 0;
> >>> -            while (pfpu_decode_insn(s)) {
> >>> -                /* decode at most MICROCODE_WORDS instructions */
> >>> -                if (i++ >= MICROCODE_WORDS) {
> >>
> >> Isn't the fix just to say "++i" instead of "i++"?
> > 
> > In the first run, s->regs[R_PC] may have any value, therefore the "insn
> > = s->microcode[pc]" from above may access out of bounds.
> 
> Then should pfpu_decode_insn access s->microcode[pc & (MICROCODE_WORDS -
> 1)]?  That's likely what happens in hardware, and the purpose of the
> error is just to avoid an infinite loop in device code.

http://www.milkymist.org/socdoc/pfpu.pdf is dead, but the source isn't:
https://github.com/m-labs/milkymist/blob/master/cores/pfpu/doc/pfpu.tex

I don't see the PC register mentioned in interface, so hiding it would
probably be a good start.

  reply	other threads:[~2015-02-20 15:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 14:18 [Qemu-devel] [PATCH 0/2] Fix GCC 5.0.0 build errors Radim Krčmář
2015-02-20 14:18 ` [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings Radim Krčmář
2015-02-20 14:38   ` Paolo Bonzini
2015-02-20 15:43     ` Radim Krčmář
2015-02-20 14:18 ` [Qemu-devel] [PATCH 2/2] milkymist-pfpu: fix GCC 5.0.0 aggressive-loop-optimizations warning Radim Krčmář
2015-02-20 14:24   ` Radim Krčmář
2015-02-20 14:36   ` Paolo Bonzini
2015-02-20 14:52     ` Michael Walle
2015-02-20 14:55       ` Paolo Bonzini
2015-02-20 15:48         ` Radim Krčmář [this message]
2015-02-20 14:40   ` Peter Maydell
2015-02-20 15:37     ` Radim Krčmář
2015-02-20 16:10       ` Michael Walle
  -- strict thread matches above, loose matches on Subject: below --
2015-02-20 16:06 [Qemu-devel] [PATCH 0/2] Fix GCC 5.0.0 build errors Radim Krčmář
2015-02-20 16:06 ` [Qemu-devel] [PATCH 2/2] milkymist-pfpu: fix GCC 5.0.0 aggressive-loop-optimizations warning Radim Krčmář
2015-02-23 17:32   ` Michael Walle

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=20150220154811.GC3974@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=michael@walle.cc \
    --cc=paolo.bonzini@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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).