All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>, Zhongze Liu <blackskygg@gmail.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	edgari@xilinx.com, xen-devel@lists.xenproject.org,
	Jarvis Roach <Jarvis.Roach@dornerworks.com>
Subject: Re: [RFC v4]Proposal to allow setting up shared memory areas between VMs from xl config file
Date: Wed, 2 Aug 2017 20:34:03 +0200	[thread overview]
Message-ID: <20170802183403.GU12347@toto> (raw)
In-Reply-To: <6d3f6bf7-3f45-f473-512f-7b38c4868af6@arm.com>

On Wed, Aug 02, 2017 at 07:10:25PM +0100, Julien Grall wrote:
> Hi,
> 
> On 01/08/17 00:53, Stefano Stabellini wrote:
> >On Mon, 31 Jul 2017, Edgar E. Iglesias wrote:
> >>>>>  @role                 Can only be 'master' or 'slave', it defaults to 'slave'.
> >>>>>
> >>>>>  @prot                 When @role = master, this means the largest set of
> >>>>>                        stage-2 permission flags that can be granted to the
> >>>>>                        slave domains.
> >>>>>When @role = slave, this means the stage-2 permission
> >>>>>                        flags of the shared memory area.
> >>>>>                        Currently only 'rw' is supported. If not set. it
> >>>>>                        defaults to 'rw'.
> >>>>>
> >>>>>  @cache_policy         The stage-2 cacheability/shareability attributes of the
> >>>>>                        shared memory area. Currently, only two policies are
> >>>>>                        supported:
> >>>>>                          * ARM_normal: Only applicable to ARM guests. This
> >>>>>                                        would mean Inner and Outer Write-Back
> >>>>>                                        Cacheable, and Inner Shareable.
> >>>>
> >>>>
> >>>>Is there a reason not to set this to Outer Shareable?
> >>>>Again, mainly useful when these pages get shared with devs as well.
> >>>>
> >>>>The guest can always lower it to Inner Shareable via S1 tables if needed.
> >>>
> >>>I don't think we can support memory sharing with devices in this version
> >>>of the document (see above about GSoC timelines). Normal memory is inner
> >>>shareable in Xen today, it makes sense to default to that.
> >>
> >>I thought we mapped RAM as Outer shareable to guests but you seem to be right.
> >>I think we should be mapping all RAM as Outer Shareable and then let the
> >>guest decide what is Inner and what is Outer via it's S1 tables.
> >>Right now it would be impossible to be Coherent with a DMA device outside
> >>of the Inner domain...
> >>
> >>Perhaps we should fix that and then ARM_normal would by itself become Outer.
> >>If there's agreement I can test it and send a patch.
> >
> >Today, only device memory is mapped Outer Shareable, while normal memory
> >is mapped Inner Shareable. I am OK with changing the default in
> >mfn_to_p2m_entry to Outer Shareable for normal RAM if the change would
> >make it possible to do coherent DMA with more devices on the platform.
> >Julien?
> 
> Per Table D4-44 in ARM DDI 0487B.a, outer-shareable takes precedence on
> inner-shareable. So if the guest configures the stage-1 page table with
> outer-shareable, the resultant will be outer-shareable.

You're right, I had gotten this backwards.

Thanks,
Edgar



> 
> As I pointed out in a previous version, this option is a bit confusing
> because the value set in stage-2 does not mean this will be the resultant
> value. I would strongly recommend any user wanting to share memory between
> guests to read D4.5.4 "Combining the stage 1 and stage 2 attributes" before
> using this option. Otherwise, he/she will likely be confused and end up to
> mis-configure the attribute.
> 
> The current configuration (i.e "ARM_normal") gives the most flexibility to
> the guest in term of memory attribute but prevent non-shareable mapping.
> 
> Cheers,
> 
> -- 
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-08-02 18:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 13:03 [RFC v4]Proposal to allow setting up shared memory areas between VMs from xl config file Zhongze Liu
2017-07-30 17:09 ` Zhongze Liu
2017-07-31 15:19   ` Wei Liu
2017-07-31 20:47     ` Stefano Stabellini
2017-07-31 20:52   ` Stefano Stabellini
2017-07-31 21:15 ` Edgar E. Iglesias
2017-07-31 21:30   ` Stefano Stabellini
2017-07-31 21:55     ` Edgar E. Iglesias
2017-07-31 23:53       ` Stefano Stabellini
2017-08-02 18:10         ` Julien Grall
2017-08-02 18:34           ` Edgar E. Iglesias [this message]
2017-08-01 15:58       ` Zhongze Liu

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=20170802183403.GU12347@toto \
    --to=edgar.iglesias@xilinx.com \
    --cc=Jarvis.Roach@dornerworks.com \
    --cc=blackskygg@gmail.com \
    --cc=edgari@xilinx.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 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.