qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Alex Zuepke <alexander.zuepke@hs-rm.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] QEMU ARM SMP: IPI delivery delayed until next main loop event // how to improve IPI latency?
Date: Tue, 16 Jun 2015 11:59:11 +0100	[thread overview]
Message-ID: <CAFEAcA_hqVfLtxBXKiPKprABMF8ntWOTAeVobi_0xgS2P-_2cQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9Xr+fTeLX_=ftNFOOWjMMFduoJEvxWCMLSKuYv++W+KQ@mail.gmail.com>

On 16 June 2015 at 11:33, Peter Maydell <peter.maydell@linaro.org> wrote:
> Pressing a key does not unwedge the test case for me.

Looking at the logs, this seems to be expected given what
the guest code does with CPU #1: (the below is edited logs,
created with a hacky patch I have that annotates the debug
logs with CPU numbers):

CPU #1: Trace 0x7f2d67afa000 [80000100] _start
 # we start
CPU #1: Trace 0x7f2d67afc060 [8000041c] main_cpu1
 # we correctly figured out we're CPU 1
CPU #1: Trace 0x7f2d67afc220 [80000448] main_cpu1
 # we took the branch to 80000448
CPU #1: Trace 0x7f2d67afc220 [80000448] main_cpu1
 # 8000448 is a branch-to-self, so here we stay

CPU #1 never bothered to enable its GICC cpu interface,
so it will never receive interrupts and will never get
out of this tight loop.

We get here because CPU #1 has got through main_cpu1
to the point of testing your 'release' variable before
CPU #0 has got through main_cpu0 far enough to set it
to 1, so it still has the zero in it that it has on
system startup. If scheduling happened to mean that
CPU #0 ran further through main_cpu0 before CPU #1
ran, we wouldn't end up in this situation -- you have a
race condition, as I suggested.

The log shows we're sat with CPU#0 fruitlessly looping
on a variable in memory, and CPU#1 in this endless loop.

PS: QEMU doesn't care, but your binary seems to be entirely
devoid of barrier instructions, which is likely to cause
you problems on real hardware.

thanks
-- PMM

  reply	other threads:[~2015-06-16 10:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 16:38 [Qemu-devel] QEMU ARM SMP: IPI delivery delayed until next main loop event // how to improve IPI latency? Alex Züpke
2015-06-12 18:03 ` Peter Maydell
2015-06-15 14:44   ` Alex Züpke
2015-06-15 14:51     ` Peter Maydell
2015-06-15 15:05       ` Alex Züpke
2015-06-15 18:41         ` Peter Maydell
2015-06-15 18:58         ` Peter Maydell
2015-06-15 20:03           ` Alex Zuepke
2015-06-16 10:33             ` Peter Maydell
2015-06-16 10:59               ` Peter Maydell [this message]
2015-06-16 11:11                 ` Alex Züpke
2015-06-16 11:53                   ` Peter Maydell
2015-06-16 12:21                     ` Alex Züpke
2015-06-19 15:53                     ` Peter Maydell
2015-06-23  7:31                       ` Frederic Konrad
2015-06-23  8:09                         ` Peter Maydell
2015-06-23  8:33                           ` Frederic Konrad
2015-06-23 18:15                         ` Peter Maydell
2015-06-25 17:13                           ` Peter Maydell
2015-06-15 15:04 ` Peter Maydell
2015-06-15 15:07   ` Alex Züpke
2015-06-15 15:18     ` Peter Maydell
2015-06-15 15:36       ` Alex Züpke
2015-06-15 15:49         ` Peter Maydell
2015-06-15 16:12           ` Alex Züpke
2015-06-15 21:39           ` Peter Crosthwaite
2015-06-19 16:57 ` Paolo Bonzini
2015-06-19 17:25   ` Peter Maydell

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=CAFEAcA_hqVfLtxBXKiPKprABMF8ntWOTAeVobi_0xgS2P-_2cQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alexander.zuepke@hs-rm.de \
    --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).