All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: "Jeff Epler" <jepler@gmail.com>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Richard Henderson" <rth@twiddle.net>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Blue Swirl" <blauwirbel@gmail.com>
Subject: Re: [Qemu-devel] qemu-arm-static, multiprocess, atomic
Date: Thu, 26 May 2016 13:42:36 +0300	[thread overview]
Message-ID: <5746D31C.3070500@gmail.com> (raw)
In-Reply-To: <CAKoL9oSdQLxkfgWn3HT+B=yD2_AxB3-z-GRd3_RX75KzfetB7g@mail.gmail.com>

On 25/05/16 15:34, Jeff Epler wrote:
> Hi.  Before I take the time to prepare a detailed bug report, I wanted to
> ask whether I'm doing something that is expected to work, or expected not
> to work.
>
> I am a developer of the LinuxCNC, Free and Open Source software for control
> of milling machines, lathes, and so forth.
>
> Our software uses an IPC model where multiple processes share a
> memory-mapped region which contains data as well as mutexes to manipulate
> the data (using gcc intrinsics like
> __sync_fetch_and_or).
>
> On real multiprocessor ARM systems, our testsuite passes, but when running
> in a debian schroot using qemu-arm-static it regularly deadlocks,
> apparently with two processes both trying to take the same mutex in a
> shared memory region.
>
> From what I have been able to tell, the emulation of atomics in qemu is
> based on a single-process, multi-thread model (based on start_exclusive()
> in linux-user/main.c,
> http://git.qemu.org/?p=qemu.git;a=blob;f=linux-user/main.c;h=95ed11d85c1#l160)
> so right now I think that our code is expected not to work on qemu-user.
> If that's the case, for our purposes I will simply document that while our
> software can be built in a qemu-user environment, it cannot be used and its
> testsuite experiences spurious failures.
>
> Thanks for your time,
> Jeff

Hi Jeff,

Looks like you are right that ARM exclusive access implementation in
QEMU implies a single-process, multi-thread model and it's not supposed
to work for your use-case. I'm afraid even our recent efforts in
multi-threaded TCG won't change the situation. The problem is that it
would require to translate somehow ARM's exclusive access monitor to x86
model.

Kind regards,
Sergey

  reply	other threads:[~2016-05-26 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 12:34 [Qemu-devel] qemu-arm-static, multiprocess, atomic Jeff Epler
2016-05-26 10:42 ` Sergey Fedorov [this message]
2016-05-26 11:21   ` Paolo Bonzini
2016-05-26 12:53     ` Sergey Fedorov
2016-05-26 15:16       ` Paolo Bonzini

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=5746D31C.3070500@gmail.com \
    --to=serge.fdrv@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=blauwirbel@gmail.com \
    --cc=jepler@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.