qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Mark Burton <mark.burton@greensocs.com>
Cc: mttcg@listserver.greensocs.com,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	"KONRAD Frédéric" <fred.konrad@greensocs.com>
Subject: Re: [Qemu-devel] [RFC PATCH] target-arm: protect cpu_exclusive_*.
Date: Thu, 18 Dec 2014 16:05:41 +0100	[thread overview]
Message-ID: <5492ED45.5040300@suse.de> (raw)
In-Reply-To: <522D6BCF-C0ED-4ADF-B7CA-7D7787E1238A@greensocs.com>



On 18.12.14 15:51, Mark Burton wrote:
> 
>> On 18 Dec 2014, at 15:44, Alexander Graf <agraf@suse.de> wrote:
>>
>>
>>
>> On 18.12.14 15:20, Mark Burton wrote:
>>>
>>>
>>>> On 18/12/2014 13:24, Alexander Graf wrote:
>>>>> That's the nice thing about transactions - they guarantee that no other
>>>>> CPU accesses the same cache line at the same time. So you're safe
>>>>> against other vcpus even without blocking them manually.
>>>>>
>>>>> For the non-transactional implementation we probably would need an "IPI
>>>>> others and halt them until we're done with the critical section"
>>>>> approach. But I really wouldn't concentrate on making things fast on old
>>>>> CPUs.
>>>>
>>>> The non-transactional implementation can use softmmu to trap access to
>>>> the page from other VCPUs.  This makes it possible to implement (at the
>>>> cost of speed) the same semantics on all hosts.
>>>>
>>>> Paolo
>>>
>>> I believe what your describing, using transactional memory, or using softmmu amounts to either option 3 below or option 4.
>>> Relying on it totally was option 4. 
>>>
>>> Seems to me, the problem with that option is that support for some hosts will be a pain, and covering everything will take some time :-(
>>>
>>> Option 3 suggests that we build a ‘slow path’ mechanism first - make sure that works (as a backup), and then add optimisations for specific hosts/guests afterwards. To me that still seems preferable?
>>
>> Yes, the only thing I'm in favor for here is to align the semantics with
>> what transactional memory would give you. That way moving to the fast
>> implementation will be easy and people would actually want to use
>> multi-threaded TCG ;)
> 
> In other words — the back-end (slow path) memory interface should look ‘transactional’…?

Yeah, the semantics should be tied to what TM would give you. We can
always be more safe than TM in our fallback implementation, but I
wouldn't want to see semantic optimizations tied to the MMIO
implementation put in.

This is mostly theory though, try to write the code and see where things
fall apart, then we'll be in a much better position to rationalize on
where to do things differently.


Alex

  reply	other threads:[~2014-12-18 15:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  9:13 [Qemu-devel] [RFC PATCH] target-arm: protect cpu_exclusive_* fred.konrad
2014-12-16  9:31 ` Paolo Bonzini
2014-12-16  9:36   ` Frederic Konrad
2014-12-16  9:49     ` Paolo Bonzini
2014-12-16  9:54       ` Frederic Konrad
2014-12-16 16:37 ` Peter Maydell
2014-12-17 10:27   ` Frederic Konrad
2014-12-17 10:28     ` Alexander Graf
2014-12-17 10:31       ` Mark Burton
2014-12-17 10:45         ` Alexander Graf
2014-12-17 11:12           ` Mark Burton
2014-12-17 11:18             ` Alexander Graf
2014-12-17 11:25               ` Paolo Bonzini
2014-12-17 11:36                 ` Peter Maydell
2014-12-17 16:17                   ` Mark Burton
2014-12-17 16:27                     ` Peter Maydell
2014-12-17 16:29                       ` Mark Burton
2014-12-17 16:39                         ` Peter Maydell
2014-12-17 16:51                           ` Peter Maydell
2014-12-18  9:12                           ` Mark Burton
2014-12-18 12:24                             ` Alexander Graf
2014-12-18 12:35                               ` Dr. David Alan Gilbert
2014-12-18 13:28                               ` Paolo Bonzini
2014-12-18 13:56                               ` Mark Burton
2014-12-18 14:20                               ` Mark Burton
2014-12-18 14:44                                 ` Alexander Graf
2014-12-18 14:51                                   ` Mark Burton
2014-12-18 15:05                                     ` Alexander Graf [this message]
2014-12-18 15:09                                       ` Mark Burton
2014-12-18 16:55                                       ` Paolo Bonzini
2014-12-17 15:52                 ` Mark Burton
2014-12-17 16:20                   ` Dr. David Alan Gilbert
2014-12-17 11:19             ` 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=5492ED45.5040300@suse.de \
    --to=agraf@suse.de \
    --cc=fred.konrad@greensocs.com \
    --cc=mark.burton@greensocs.com \
    --cc=mttcg@listserver.greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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).