All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Zhongze Liu <blackskygg@gmail.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	edgari@xilinx.com, Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xenproject.org,
	Jarvis Roach <Jarvis.Roach@dornerworks.com>
Subject: Re: [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file
Date: Wed, 28 Jun 2017 17:03:21 +0100	[thread overview]
Message-ID: <20170628160321.bfgtuybsglkqfbzg@citrix.com> (raw)
In-Reply-To: <CAHrd_jrpwxJpuvfKR=M5AWyDt1UpKoNaXHJQzrQHRscrcnNb4g@mail.gmail.com>

Sorry for the late reply.

I can see the thread already contains answers to some of my questions so
I will just reply to the bits that are still relevant.

On Fri, Jun 23, 2017 at 01:27:24AM +0800, Zhongze Liu wrote:
> Hi Wei,
> 
> Thank you for your valuable comments.
> 
> 2017-06-21 23:09 GMT+08:00 Wei Liu <wei.liu2@citrix.com>:
[...]
> >> To handle all these, I would suggest using an unsigned integer to serve as the
> >> identifier, and using a "master" tag in the master domain's xl config entry
> >> to announce that she will provide the backing memory pages. A separate
> >> entry would be used to describe the attributes of the shared memory area, of
> >> the form "prot=RW".
> >
> > I think using an integer is too limiting. You would need the user to
> > know if a particular number is already used. Maybe using a number is
> > good enough for the use case you have in mind, but it is not future
> > proof. I don't know how sophisticated we want this to be, though.
> >
> 
> Sounds reasonable. I chose integers because I think integers are fast
> and easy to
> manipulate. But integers are somewhat hard to memorize and this isn't
> a good thing
> from a user's point of view. So maybe I'll make it a string with a
> maximum size of 32
> or longer.
> 

Sounds reasonable.

[...]
> >>  granularity = 4k, prot = RW, master”]
> >>
> >> In xl config file of vm2:
> >>
> >>     static_shared_mem = ["id = ID1, begin = gmfn5, end = gmfn6,
> >>                           granularity = 4k, prot = RO”]
> >>
> >> In xl config file of vm3:
> >>
> >>     static_shared_mem = ["id = ID2, begin = gmfn7, end = gmfn8,
> >>                           granularity = 4k, prot = RW”]
> >>
> >> gmfn's above are all hex of the form "0x20000".
> >>
> >> In the example above. A memory area ID1 will be shared between vm1 and vm2.
> >> This area will be taken from vm1 and mapped into vm2's stage-2 page table.
> >> The parameter "prot=RO" means that this memory area are offered with read-only
> >> permission. vm1 can access this area using gmfn1~gmfn2, and vm2 using
> >> gmfn5~gmfn6.
> >> Likewise, a memory area ID will be shared between vm1 and vm3 with read and
> >> write permissions. vm1 is the master and vm2 the slave. vm1 can access the
> >> area using gmfn3~gmfn4 and vm3 using gmfn7~gmfn8.
> >>
> >> The "granularity" is optional in the slaves' config entries. But if it's
> >> presented in the slaves' config entry, it has to be the same with its master's.
> >> Besides, the size of the gmfn range must also match. And overlapping backing
> >> memory areas are well defined.
> >>
> >
> > What do you mean by "well defined"?
> 
> Em...I think I should have put it in a more clear way. In fact, I mean
> that overlapping
> areas are allowed, and when two areas overlap with each other, any
> operations done
> on the overlapping area will be seen on both sides. Besides this, they
> just act like two
> independent areas. And the job of serializing the access to the
> overlapping area is
> left to the user.
> 

OK. "Well defined" means "clearly defined or described" but I didn't see
any definition or description of it. Just use "allowed" should be OK.

> >
> > Why is inserting a sub-range not allowed?
> >
> 
> This is also a feature under consideration.Maybe the use cases that I have
> in mind is not that complicated, so I chose to keep it simple. But
> after giving it
> a second thought, I found this will not add too much complexity to the code and
> will be useful in some cases. So I think I'll allow this in my next
> version of the proposal.
> 

That's what I thought as well. Essentially it is not any harder than
implementing the overlapping case.

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

  parent reply	other threads:[~2017-06-28 16:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 17:18 [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file Zhongze Liu
2017-06-20 17:29 ` Julien Grall
2017-06-22 16:58   ` Zhongze Liu
2017-06-22 20:55     ` Stefano Stabellini
2017-06-21 15:09 ` Wei Liu
2017-06-21 15:12   ` Julien Grall
2017-06-22 17:27   ` Zhongze Liu
2017-06-22 18:55     ` Zhongze Liu
2017-06-28 16:03     ` Wei Liu [this message]
2017-06-22 21:05 ` Stefano Stabellini
2017-06-23  9:16   ` Julien Grall
2017-06-23 18:21     ` Stefano Stabellini
2017-06-23 19:19       ` Jarvis Roach
2017-06-23 20:09         ` Stefano Stabellini
2017-06-23 20:47           ` Jarvis Roach
2017-06-23 20:18       ` Julien Grall
2017-07-18 12:10 ` Julien Grall
2017-07-18 14:22   ` Zhongze Liu
2017-07-18 16:13     ` Stefano Stabellini

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