qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] MTTCG memory ordering
@ 2016-10-12  8:58 Stefan Hajnoczi
  2016-10-12 15:17 ` Laszlo Ersek
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2016-10-12  8:58 UTC (permalink / raw)
  To: pranith kumar; +Cc: Alex Bennée, qemu-devel, Richard Henderson

Hi Pranith,
I was curious about the status of your MTTCG GSoC work:

I saw your fence series which implements the noop memory barrier/fence
instructions on various architectures, but I wasn't sure if that also
covers the case where a strong target is emulated on a weak host.

Did you make TCG automatically emit barriers so stronger targets (x86)
run correctly on weaker targets (ARM)?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] MTTCG memory ordering
  2016-10-12  8:58 [Qemu-devel] MTTCG memory ordering Stefan Hajnoczi
@ 2016-10-12 15:17 ` Laszlo Ersek
  2016-10-12 15:30 ` Pranith Kumar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2016-10-12 15:17 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: pranith kumar, Alex Bennée, qemu-devel, Richard Henderson

On 10/12/16 10:58, Stefan Hajnoczi wrote:
> Hi Pranith,
> I was curious about the status of your MTTCG GSoC work:
> 
> I saw your fence series which implements the noop memory barrier/fence
> instructions on various architectures, but I wasn't sure if that also
> covers the case where a strong target is emulated on a weak host.
> 
> Did you make TCG automatically emit barriers so stronger targets (x86)
> run correctly on weaker targets (ARM)?

(Testing that might run into other problems:
<https://bugs.launchpad.net/qemu/+bug/893208/>)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] MTTCG memory ordering
  2016-10-12  8:58 [Qemu-devel] MTTCG memory ordering Stefan Hajnoczi
  2016-10-12 15:17 ` Laszlo Ersek
@ 2016-10-12 15:30 ` Pranith Kumar
  2016-10-12 21:55 ` Emilio G. Cota
  2016-10-14 16:29 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Pranith Kumar @ 2016-10-12 15:30 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Alex Bennée, qemu-devel, Richard Henderson

Hi Stefan,

Stefan Hajnoczi writes:

> Hi Pranith,
> I was curious about the status of your MTTCG GSoC work:
>
> I saw your fence series which implements the noop memory barrier/fence
> instructions on various architectures, but I wasn't sure if that also
> covers the case where a strong target is emulated on a weak host.
>

No, this work is still pending. The current implementation only supports weak
on strong (the simplest case) by emitting barriers explicitly.

> Did you make TCG automatically emit barriers so stronger targets (x86)
> run correctly on weaker targets (ARM)?

We did consider doing this by emitting barriers implicitly for each memory
instruction of a strong target but decided that it would be too costly. There
is, AFAIK, no trivial solution to avoiding this overhead as of now.

I will start working on this next step soon, once I finish the tcg test setup.

Thanks,
-- 
Pranith

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] MTTCG memory ordering
  2016-10-12  8:58 [Qemu-devel] MTTCG memory ordering Stefan Hajnoczi
  2016-10-12 15:17 ` Laszlo Ersek
  2016-10-12 15:30 ` Pranith Kumar
@ 2016-10-12 21:55 ` Emilio G. Cota
  2016-10-14 16:29 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Emilio G. Cota @ 2016-10-12 21:55 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: pranith kumar, Alex Bennée, qemu-devel, Richard Henderson

On Wed, Oct 12, 2016 at 10:58:43 +0200, Stefan Hajnoczi wrote:
> Hi Pranith,
> I was curious about the status of your MTTCG GSoC work:
> 
> I saw your fence series which implements the noop memory barrier/fence
> instructions on various architectures, but I wasn't sure if that also
> covers the case where a strong target is emulated on a weak host.
> 
> Did you make TCG automatically emit barriers so stronger targets (x86)
> run correctly on weaker targets (ARM)?

Here are some numbers on this. Chart:
  http://imgur.com/a/H9E9R

The overhead of emitting barriers all over the place is significant
(~3x for integer code), but that's the price of correctness as
the ArMOR paper shows[*] (this is the SYNC option in the chart).

A faster alternative also provided by ArMOR is to pretend the host
isn't multi-copy atomic (i.e. the iriw litmus test would fail); this
is the PowerA option in the chart.

An even better alternative is to let the hardware deal with this.
Unfortunately, so far only recent IBM processors support this
(the feature is called Strong Access Ordering--SAO in the chart).

[*] ArMOR: Defending Against Memory Consistency Model Mismatches
    in Heterogeneous Architectures
  http://www.cs.princeton.edu/~ctrippel/dlustig_ISCA15.pdf

		Emilio

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] MTTCG memory ordering
  2016-10-12  8:58 [Qemu-devel] MTTCG memory ordering Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2016-10-12 21:55 ` Emilio G. Cota
@ 2016-10-14 16:29 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2016-10-14 16:29 UTC (permalink / raw)
  To: pranith kumar; +Cc: Alex Bennée, qemu-devel, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

On Wed, Oct 12, 2016 at 10:58:43AM +0200, Stefan Hajnoczi wrote:
> I was curious about the status of your MTTCG GSoC work:
> 
> I saw your fence series which implements the noop memory barrier/fence
> instructions on various architectures, but I wasn't sure if that also
> covers the case where a strong target is emulated on a weak host.
> 
> Did you make TCG automatically emit barriers so stronger targets (x86)
> run correctly on weaker targets (ARM)?

Thanks for the responses!

I'm putting together 3 minutes of slides to present at the Google Summer
of Code Mentor Summit.  This project is a good example of the technical
challenges in QEMU so I wanted to showcase it.

Glad I asked for clarification because originally I thought this project
was about emulating strong on weak memory ordering :).

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-14 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12  8:58 [Qemu-devel] MTTCG memory ordering Stefan Hajnoczi
2016-10-12 15:17 ` Laszlo Ersek
2016-10-12 15:30 ` Pranith Kumar
2016-10-12 21:55 ` Emilio G. Cota
2016-10-14 16:29 ` Stefan Hajnoczi

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).