Re: [Xen-devel] [PATCH v3 5/7] libxl: support unmapping static shared memory areas during domain destruction

2017-11-08 Thread Zhongze Liu
Oops, The address lines were somehow dropped by my mail client. Adding Wei. 2017-11-09 10:06 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi Wei, > > 2017-11-01 23:55 GMT+08:00 Wei Liu <wei.l...@citrix.com>: >> On Thu, Oct 19, 2017 at 10:36:33AM +0800,

Re: [Xen-devel] [PATCH v3 5/7] libxl: support unmapping static shared memory areas during domain destruction

2017-11-08 Thread Zhongze Liu
Hi Wei, 2017-11-01 23:55 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Thu, Oct 19, 2017 at 10:36:33AM +0800, Zhongze Liu wrote: >> Add libxl__sshm_del to unmap static shared memory areas mapped by >> libxl__sshm_add during domain creation. The unmapping process is: >>

Re: [Xen-devel] [PATCH v3 4/7] libxl: support mapping static shared memory areas during domain creation

2017-11-08 Thread Zhongze Liu
Hi Wei, 2017-11-01 23:55 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Thu, Oct 19, 2017 at 10:36:32AM +0800, Zhongze Liu wrote: >> Add libxl__sshm_add to map shared pages from one DomU to another, The mapping >> process involves the follwing steps: >> >> * S

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-25 Thread Zhongze Liu
2017-10-25 17:37 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi, > > My current plan is to add the following new MAPSPACE to public/memory.h: > > +#define XENMEMSPACE_gmfn_foreign_share 6 /* Same as *_gmfn_foreign, but this > is > +

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-25 Thread Zhongze Liu
doms. */ and create a corresponding entry xsm_map_gmfn_foreign_share to the xsm structure, which will be filled with the proposed policy. Does this look good to you? Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-23 Thread Zhongze Liu
cause it's mapped into (c)'s. Yes, indeed. This won't work. Sorry for giving a wrong example here. I think I now agree to add a new subop, too. Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-22 Thread Zhongze Liu
ew subop, since this code is reached > via the stable memory_op and not just a domctl. How about changing the policy to (c over d) && ((d over t) || (c over t))? Given that (c over d) is a must, which is always checked somewhere higher in the call stack as Daniel pointed out, permitting (d over t) or (c over t) actually infers permitting the other. - if you permit (d over t) but not (c over t): Given (c over t), (c) can first map the src page from (t) into its own memory space and then map this page from its own memory space to (d)'s memory space. - if you permit (c over t) but not (d over t): Given (d over t), (c) can first map (d)'s pages into its own memory space and modify (d)'s code to issues a hypercall that maps (t)'s memory pages into (d)'s memory space. I'm not very familiar with Xen's security model. So I might be totally wrong here. If so, please correct me. And if you still think adding a new subop is necessary, do you have any suggestions on this? Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-19 Thread Zhongze Liu
2017-10-20 8:34 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi Daniel, > > 2017-10-20 1:36 GMT+08:00 Daniel De Graaf <dgde...@tycho.nsa.gov>: >> On 10/18/2017 10:36 PM, Zhongze Liu wrote: >>> >>> The original dummy xsm_map_gmfn_foregin checks if so

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-19 Thread Zhongze Liu
Hi Daniel, 2017-10-20 1:36 GMT+08:00 Daniel De Graaf <dgde...@tycho.nsa.gov>: > On 10/18/2017 10:36 PM, Zhongze Liu wrote: >> >> The original dummy xsm_map_gmfn_foregin checks if source domain has the >> proper >> privileges over the target domain. Under this poli

[Xen-devel] [PATCH v3 6/7] libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config files

2017-10-18 Thread Zhongze Liu
[1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall &l

[Xen-devel] [PATCH v3 7/7] docs: documentation about static shared memory regions

2017-10-18 Thread Zhongze Liu
03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall <julien.gr...@arm.com> Cc: xen-devel@lists.xen.org --- docs/man

[Xen-devel] [PATCH v3 0/7] Allow setting up shared memory areas between VMs from xl config files

2017-10-18 Thread Zhongze Liu
trasaction fails * Changed the xsm hooks to lookup the current domain themselves instead of getting it as a parameter Cheers, Zhongze Liu (7): libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap xsm: flask: change the dummy xsm policy and flask hook

[Xen-devel] [PATCH v3 5/7] libxl: support unmapping static shared memory areas during domain destruction

2017-10-18 Thread Zhongze Liu
8/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall <julien.gr...@arm.com> Cc: xen-devel@lists.xen.org

[Xen-devel] [PATCH v3 4/7] libxl: support mapping static shared memory areas during domain creation

2017-10-18 Thread Zhongze Liu
not allowd on x86 (see the comments in x86/mm/p2m.c:p2m_add_foregin for more details). This is for the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Li

[Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-18 Thread Zhongze Liu
. This is for the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Daniel De Graaf <dgde...@tycho.nsa.g

[Xen-devel] [PATCH v3 3/7] libxl: introduce a new structure to represent static shared memory regions

2017-10-18 Thread Zhongze Liu
Add a new structure to the IDL familiy to represent static shared memory regions as proposed in the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Z

[Xen-devel] [PATCH v3 1/7] libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap

2017-10-18 Thread Zhongze Liu
er and use XENMEM_remove_from_physmap to cancel the sharing. A wrapper to XENMEM_add_to_physmap_batch was added in the following commit: commit 20e725e9364cff4a29945f66986ecd88cca8743d Now add the wrapper to XENMEM_remove_from_physmap. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Reviewed-by: St

Re: [Xen-devel] [PATCH v2 0/6] Allow setting up shared memory areas between VMs from xl config files

2017-10-11 Thread Zhongze Liu
it within the following one week or so. Sorry again for failing to schedule my time effectively. Cheers, Zhongze Liu. 2017-10-11 7:55 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Sun, 27 Aug 2017, Zhongze Liu wrote: >> This series implements the new xl config entry

Re: [Xen-devel] [PATCH v2 3/6] libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config files

2017-09-01 Thread Zhongze Liu
2017-09-02 0:03 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Sun, Aug 27, 2017 at 04:36:12PM +0800, Zhongze Liu wrote: >> Add the parsing utils for the newly introduced libxl_static_sshm struct >> to the libxl/libxlu_* family. And add realated parsing code in xl to >&g

Re: [Xen-devel] [PATCH v2 5/6] libxl: support mapping static shared memory areas during domain creation

2017-09-01 Thread Zhongze Liu
Hi Wei, Thanks for reviewing. 2017-09-02 0:23 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Sun, Aug 27, 2017 at 04:36:14PM +0800, Zhongze Liu wrote: >> Add libxl__sshm_add to map shared pages from one DomU to another, The mapping >> process involves the follwing steps: &

Re: [Xen-devel] [PATCH v2 4/6] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-08-28 Thread Zhongze Liu
>> +if (rc) return rc; > > Coding style. In any event, as suggested before the whole thing is > easier to write as > >> +return xsm_default_action(action, cd, t); > > return xsm_default_action(action, cd, d) ?: xsm_default_action(action, > cd,

[Xen-devel] [PATCH v2 4/6] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-08-27 Thread Zhongze Liu
Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Daniel De Graaf <dgde...@tycho.nsa.gov> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall <julien.gr...@arm.com> Cc: Georg

[Xen-devel] [PATCH v2 2/6] libxl: introduce a new structure to represent static shared memory regions

2017-08-27 Thread Zhongze Liu
g/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Cc: Wei Liu <wei.l...@citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Stefano Stabellini <sstabell...@ke

[Xen-devel] [PATCH v2 1/6] libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap

2017-08-27 Thread Zhongze Liu
er and use XENMEM_remove_from_physmap to cancel the sharing. A wrapper to XENMEM_add_to_physmap_batch was added in the following commit: commit 20e725e9364cff4a29945f66986ecd88cca8743d Now add the wrapper to XENMEM_remove_from_physmap. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Reviewed-by: St

[Xen-devel] [PATCH v2 0/6] Allow setting up shared memory areas between VMs from xl config files

2017-08-27 Thread Zhongze Liu
for xsm_map_gmfn_foreign. * support rolling back during creation on partial failure. * refcounting the sshm path instead of using "alive" and "zombie" to label the master and counting the slaves. Cheers, Zhongze Liu (6): libxc: add xc_domain_remove_from_physmap to wrap XENMEM

[Xen-devel] [PATCH v2 6/6] libxl: support unmapping static shared memory areas during domain destruction

2017-08-27 Thread Zhongze Liu
8/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Julien Grall <julien.gr...@arm.com> Cc: xen-devel@lists.xen.org ---

[Xen-devel] [PATCH v2 3/6] libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config files

2017-08-27 Thread Zhongze Liu
[1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Andrew Cooper <andrew.coop...@citrix.com> Cc: George Dunlap <george.dun...@eu.citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Jan Beul

[Xen-devel] [PATCH v2 5/6] libxl: support mapping static shared memory areas during domain creation

2017-08-27 Thread Zhongze Liu
not allowd on x86 (see the comments in x86/mm/p2m.c:p2m_add_foregin for more details). This is for the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xen.org/archives/html/xen-devel/2017-08/msg03242.html Signed-off-by: Zhongze Li

[Xen-devel] [RFC v5]Proposal to Allow Setting up Shared Memory Areas between VMs from xl Config File

2017-08-27 Thread Zhongze Liu
cation channel between domains who are communicating through shared memory regions, this allows one vm to signal her friends when data is available in the shared memory or when the data in the shared memory is consumed. The channel could be built upon PPI or SGI. [See also: https://wiki.xenproject.org/wiki/Outreach_Program_Projects#Share_a_page_in_memory_from_the_VM_config_file] Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 5/6] libxl: support mapping static shared memory areas during domain creation

2017-08-25 Thread Zhongze Liu
Hi Wei, 2017-08-25 19:05 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Wed, Aug 23, 2017 at 02:08:39AM +0800, Zhongze Liu wrote: > [...] >> diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h >> index 5e1fc6060e..1d681d8863 100644 >> --- a/tools/lib

Re: [Xen-devel] [PATCH 4/6] xsm: flask: change the interface and default policy for xsm_map_gmfn_foregin

2017-08-24 Thread Zhongze Liu
e irc log from a discussion with Julien on #xendevel, where Julien said: blackskygg: I think you want to pass the current domain in parameter, i.e having 3 domains argument. because your solution only works when XSM is not enabled (this is the dummy callback) when XSM is enabled, the policy would be specificed by the administrator he needs to be able to know which domain was doing the configuration. Cheers, Zhongze Liu > > Jan > ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 4/6] xsm: flask: change the interface and default policy for xsm_map_gmfn_foregin

2017-08-23 Thread Zhongze Liu
return domain_has_perm(cd, d, SECCLASS_MMU, MMU__MAP_READ | >> MMU__MAP_WRITE) || >> +domain_has_perm(cd, t, SECCLASS_MMU, MMU__MAP_READ | >> MMU__MAP_WRITE); >> } > > ... here. A domain can't have XSM_TARGET permission over two > other domains, so what you want to do here can't work at all, > afaict. I agree with what Stefano has said below. Cheers, Zhongze Liu. > > Jan > ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 6/6] libxl: support unmapping static shared memory areas during domain destruction

2017-08-22 Thread Zhongze Liu
Hi Stefano, 2017-08-23 5:31 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 23 Aug 2017, Zhongze Liu wrote: >> Add libxl__sshm_del to Unmap static shared memory areas mapped by >> libxl__sshm_add during domain creation. The unmapping process is: >&g

Re: [Xen-devel] [PATCH 5/6] libxl: support mapping static shared memory areas during domain creation

2017-08-22 Thread Zhongze Liu
Hi Stefano, 2017-08-23 5:42 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 23 Aug 2017, Zhongze Liu wrote: >> Add libxl__sshm_add to map shared pages from one DomU to another, The mapping >> process involves the follwing steps: >> >> * Set defa

Re: [Xen-devel] [PATCH 4/6] xsm: flask: change the interface and default policy for xsm_map_gmfn_foregin

2017-08-22 Thread Zhongze Liu
Hi Stefano, 2017-08-23 3:58 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 23 Aug 2017, Zhongze Liu wrote: >> The original xsm_map_gmfn_foregin policy checks if source domain has the >> proper >> privileges over the target domain. Under th

Re: [Xen-devel] [PATCH 2/6] libxl: introduce a new structure to represent static shared memory regions

2017-08-22 Thread Zhongze Liu
Hi Stefano, 2017-08-23 4:05 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 23 Aug 2017, Zhongze Liu wrote: >> Add a new structure to the IDL famliy to represent static shared memory >> regions, > ^ family > >

[Xen-devel] [PATCH 5/6] libxl: support mapping static shared memory areas during domain creation

2017-08-22 Thread Zhongze Liu
/p2m.c:p2m_add_foregin for more details). This is for the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Andrew Coo

[Xen-devel] [PATCH 6/6] libxl: support unmapping static shared memory areas during domain destruction

2017-08-22 Thread Zhongze Liu
from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l...@citrix.com> Cc: Stefano Stabellini <sstabell..

[Xen-devel] [PATCH 3/6] libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config files

2017-08-22 Thread Zhongze Liu
[1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Andrew Cooper <andrew.coop...@citrix.com> Cc: George Dunlap <george.dun...@eu.citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc:

[Xen-devel] [PATCH 4/6] xsm: flask: change the interface and default policy for xsm_map_gmfn_foregin

2017-08-22 Thread Zhongze Liu
. This is for the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: J

[Xen-devel] [PATCH 2/6] libxl: introduce a new structure to represent static shared memory regions

2017-08-22 Thread Zhongze Liu
Add a new structure to the IDL famliy to represent static shared memory regions, as proposed in the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Z

[Xen-devel] [PATCH 1/6] libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap

2017-08-22 Thread Zhongze Liu
er and use XENMEM_remove_from_physmap to cancel the sharing. A wrapper to XENMEM_add_to_physmap_batch was added in the following commit: commit 20e725e9364cff4a29945f66986ecd88cca8743d Now add the wrapper to XENMEM_remove_from_physmap. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Reviewed-by: St

[Xen-devel] [PATCH 0/6] Allow setting up shared memory areas between VMs from xl config files

2017-08-22 Thread Zhongze Liu
VMs from xl config file: https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Cheers, Zhongze Liu (6): libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap libxl: introduce a new structure to represent static shared memory regions

[Xen-devel] [PATCH v2] libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap

2017-08-19 Thread Zhongze Liu
er and use XENMEM_remove_from_physmap to cancel the sharing. A wrapper to XENMEM_add_to_physmap_batch was added in the following commit: commit 20e725e9364cff4a29945f66986ecd88cca8743d Now add the wrapper to XENMEM_remove_from_physmap. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> Cc: Ian J

[Xen-devel] [PATCH] libxc: add xc_domain_remove_from_physmap to wrap XENMEM_remove_from_physmap

2017-08-18 Thread Zhongze Liu
This is for the proposal "Allow setting up shared memory areas between VMs from xl config file". See: https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Then plan is to use XENMEM_add_to_physmap_batch to map the shared pages from one domU to another and use

Re: [Xen-devel] [RFC PATCH 4/4] libxl: support creation and destruction of static shared memory areas

2017-08-09 Thread Zhongze Liu
2017-08-08 18:49 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Sat, Aug 05, 2017 at 01:26:37AM +0800, Zhongze Liu wrote: >> Hi Wei, >> >> Thank you for reviewing my patch. >> >> 2017-08-04 23:20 GMT+08:00 Wei Liu <wei.l...@citrix.com>: >>

Re: [Xen-devel] [RFC PATCH 4/4] libxl: support creation and destruction of static shared memory areas

2017-08-09 Thread Zhongze Liu
2017-08-08 18:56 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Tue, Aug 08, 2017 at 11:49:35AM +0100, Wei Liu wrote: >> On Sat, Aug 05, 2017 at 01:26:37AM +0800, Zhongze Liu wrote: >> > Hi Wei, >> > >> > Thank you for reviewing my patch. >>

Re: [Xen-devel] [RFC PATCH 4/4] libxl: support creation and destruction of static shared memory areas

2017-08-04 Thread Zhongze Liu
Hi Wei, Thank you for reviewing my patch. 2017-08-04 23:20 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > I skim through this patch and have some questions. > > On Fri, Aug 04, 2017 at 10:20:25AM +0800, Zhongze Liu wrote: >> + >> +static int libxl__sshm_add_master(li

Re: [Xen-devel] [RFC PATCH 3/4] x86/p2m : remove checks that forbid adding foreign pages between HVM guests

2017-08-04 Thread Zhongze Liu
been done, so I'm separating this patch out to serve as a place to discuss this problem. For this GSoC project, I would also ask if there is any temporary workaround. While waiting for any further suggestions and answers, I'll continue to work on the ARM side. Cheers, Zhongze Liu 2017-08-04 21:27

Re: [Xen-devel] [RFC PATCH 0/4] Allow setting up shared memory areas between VMs from xl config files

2017-08-03 Thread Zhongze Liu
Hi, I should have mentioned that this RFC only adds support to the x86 side. Sorry for that. Cheers, Zhongze Liu 2017-08-04 10:20 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > This series implements the new xl config entry proposed in [1]. Users can use > the new config entry t

[Xen-devel] [RFC PATCH 2/4] libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config files

2017-08-03 Thread Zhongze Liu
[1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Cc: Andrew Cooper <andrew.coop...@citrix.com> Cc: George Dunlap <george.dun...@eu.citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc:

[Xen-devel] [RFC PATCH 4/4] libxl: support creation and destruction of static shared memory areas

2017-08-03 Thread Zhongze Liu
roject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Cc: Andrew Cooper <andrew.coop...@citrix.com> Cc: George Dunlap <george.dun...@eu.citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Jan Beulich <jbeul..

[Xen-devel] [RFC PATCH 1/4] libxl: introduce a new structure to represent static shared memory regions

2017-08-03 Thread Zhongze Liu
Add a new structure to the IDL famliy to represent static shared memory regions, as proposed in the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Z

[Xen-devel] [RFC PATCH 3/4] x86/p2m : remove checks that forbid adding foreign pages between HVM guests

2017-08-03 Thread Zhongze Liu
areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Cc: George Dunlap <george.dun...@eu.citrix.com> Cc: Jan Beulich <jbeul...@suse.com> Cc

[Xen-devel] [RFC PATCH 0/4] Allow setting up shared memory areas between VMs from xl config files

2017-08-03 Thread Zhongze Liu
VMs from xl config files: https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Cheers, Zhongze Liu (4): libxl: introduce a new structure to represent static shared memory regions libxl:xl: add parsing code to parse "libxl_static_sshm" from xl config

Re: [Xen-devel] [RFC v4]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-08-01 Thread Zhongze Liu
2017 at 09:03:15PM +0800, Zhongze Liu wrote: >> > > >> > > 1. Motivation and Description >> > >> > Hi, >> > >> > I think this looks qui

Re: [Xen-devel] [RFC v4]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-30 Thread Zhongze Liu
missing @prot flags and @cache_policy options. Set up a notification channel between domains who are communicating through shared memory regions, this allows one vm to signal her friends when data is available in the shared memory or when the data in the shared memory is consumed. The channel could

[Xen-devel] [RFC v4]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-28 Thread Zhongze Liu
her friends when data is available in the shared memory or when the data in the shared memory is consumed. The channel could be built upon PPI or SGI. [See also: https://wiki.xenproject.org/wiki/Outreach_Program_Projects#Share_a_page_in_memory_from_the_VM_config_file] Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [RFC PATCH] tools/libxl : add struct and parsing utils for the 'static_shm' xl config entry

2017-07-20 Thread Zhongze Liu
2017-07-20 9:43 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi Stefano, > > 2017-07-20 3:24 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: >> On Wed, 19 Jul 2017, Zhongze Liu wrote: >>> Add a new struct libxl_static_shm in the libxl IDL for

Re: [Xen-devel] [RFC v3]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-19 Thread Zhongze Liu
Hi Stefano, I missed some of your comments in the last reply. adding responses to them. 2017-07-20 2:47 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 19 Jul 2017, Zhongze Liu wrote: >> >> 1. Motiv

Re: [Xen-devel] [RFC PATCH] tools/libxl : add struct and parsing utils for the 'static_shm' xl config entry

2017-07-19 Thread Zhongze Liu
Hi Stefano, 2017-07-20 3:24 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 19 Jul 2017, Zhongze Liu wrote: >> Add a new struct libxl_static_shm in the libxl IDL for the proposed new xl >> config entry 'static_shm' (see [1]), which allow the user to set up s

Re: [Xen-devel] [RFC v3]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-19 Thread Zhongze Liu
2017-07-20 2:47 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Wed, 19 Jul 2017, Zhongze Liu wrote: >> >> 1. Motivation and Description >> >>

[Xen-devel] [RFC PATCH] tools/libxl : add struct and parsing utils for the 'static_shm' xl config entry

2017-07-18 Thread Zhongze Liu
to allow setting up shared memory areas between VMs from xl config file, https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg01741.html Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Cc: Wei Liu <wei.l...@citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.c

Re: [Xen-devel] [RFC v3]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-18 Thread Zhongze Liu
Forget to restrict the possible values of begin/end. 2017-07-19 2:30 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > > 1. Motivation and Description > > Virtual machin

[Xen-devel] [RFC v3]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-18 Thread Zhongze Liu
Implement the prot, x86_* and arm_* memory attribute options. Set up a notification channel between domains who are communicating through shared memory regions, this allows one vm to signal her friends when data is available in the shared memory or w

Re: [Xen-devel] [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-07-18 Thread Zhongze Liu
by multiplying them with @granularity. For example, if begin=0x100 and granularity=4k then the shared space will begin at the address 0x10. Cheers, Zhongze Liu 2017-07-18 20:10 GMT+08:00 Julien Grall <julien.gr...@arm.com>: > Hi, > > > On 20/06/17 18:18,

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-07-03 Thread Zhongze Liu
on the usage of this interface, so I turned to the implementation in xen/common/mem_access.c, where I see this interface invoking p2m_set_mem_acess, which further invokes set_mem_acess and finally p2m->set_entry(), so I guess this might be the right interface to use. To confirm the guess, I

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-07-03 Thread Zhongze Liu
Hi Julien, 2017-07-03 19:16 GMT+08:00 Julien Grall <julien.gr...@arm.com>: > Hi, > > On 01/07/17 10:16, Zhongze Liu wrote: >>> >>> On the ARM side, we are missing BUFFERABLE and WRITEALLOC. I don't know >>> how they map to these tags, which comes from t

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-07-01 Thread Zhongze Liu
2017-07-01 17:16 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi Stefano, > > Added Julien and removed those who are mistakenly Cc'ed:-) > will never try to draft emails half asleep again. > > 2017-07-01 5:48 GMT+08:00 Stefano Stabellini <sstabell...@kernel.

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-07-01 Thread Zhongze Liu
Hi Stefano, Added Julien and removed those who are mistakenly Cc'ed:-) will never try to draft emails half asleep again. 2017-07-01 5:48 GMT+08:00 Stefano Stabellini <sstabell...@kernel.org>: > On Sat, 1 Jul 2017, Zhongze

Re: [Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-07-01 Thread Zhongze Liu
It seems that I fed the wrong patch to scripts/get_maintainers.pl. Sorry for mistakenly Cc'ing George, Konrad, and Tim. Apologies for this sudden mail in your inbox. Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https

[Xen-devel] [RFC] DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes

2017-06-30 Thread Zhongze Liu
DOMCTL_memattrs_op : a new DOMCTL to play with stage-2 page attributes Zhongze Liu <blacksk...@gmail.

Re: [Xen-devel] [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-06-22 Thread Zhongze Liu
caching attributes, with the rest left to the to-be-done list. Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-06-22 Thread Zhongze Liu
Hi Wei, Thank you for your valuable comments. 2017-06-21 23:09 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Wed, Jun 21, 2017 at 01:18:38AM +0800, Zhongze Liu wrote: >> >> 1. Motiv

Re: [Xen-devel] [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-06-22 Thread Zhongze Liu
Hi Julien, 2017-06-21 1:29 GMT+08:00 Julien Grall <julien.gr...@arm.com>: > Hi, > > Thank you for the new proposal. > > On 06/20/2017 06:18 PM, Zhongze Liu wrote: >> >> In the example above. A memory area ID1 will be shared between vm1 and >> vm2. >>

[Xen-devel] [PATCH v3] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-22 Thread Zhongze Liu
is to use XENMEM_add_to_physmap_batch in xl to map foregin pages from one DomU to another so that the page could be shared. But currently there is no wrapper for XENMEM_add_to_physmap_batch in libxc, so we just add a wrapper for it. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Changed Since v2: *

Re: [Xen-devel] [PATCH v2] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-22 Thread Zhongze Liu
Hi Wei, 2017-06-21 23:44 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Wed, Jun 21, 2017 at 01:29:26AM +0800, Zhongze Liu wrote: >> This is a preparation for the proposal "allow setting up shared memory areas >> between VMs from xl config file". See: >> V2: ht

[Xen-devel] [PATCH v2] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-20 Thread Zhongze Liu
is to use XENMEM_add_to_physmap_batch in xl to map foregin pages from one DomU to another so that the page could be shared. But currently there is no wrapper for XENMEM_add_to_physmap_batch in libxc, so we just add a wrapper for it. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Changed Since v1:

[Xen-devel] [RFC v2]Proposal to allow setting up shared memory areas between VMs from xl config file

2017-06-20 Thread Zhongze Liu
n memory attributes like cacheability and shareability. Indications of where in the host physical memory should we get the backing memory from. Set up a notification channel between domains who are communicating through shared memory regions, this allows one vm to signal her friends when data is a

Re: [Xen-devel] [PATCH] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-16 Thread Zhongze Liu
2017-06-16 17:44 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > 2017-06-16 17:36 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: >> Hi Jan, >> >> >> 2017-06-16 16:45 GMT+08:00 Jan Beulich <jbeul...@suse.com>: >>>>>> On

Re: [Xen-devel] questions on mem_sharing_op*'s and tools/tests/mem-sharing/memshrtool

2017-06-16 Thread Zhongze Liu
Hi Ian, 2017-06-16 17:36 GMT+08:00 Ian Jackson <ian.jack...@eu.citrix.com>: > Zhongze Liu writes ("Re: questions on mem_sharing_op*'s and > tools/tests/mem-sharing/memshrtool"): >> 2017-06-16 11:50 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: >> &

Re: [Xen-devel] questions on mem_sharing_op*'s and tools/tests/mem-sharing/memshrtool

2017-06-16 Thread Zhongze Liu
Hi Ian, 2017-06-16 17:36 GMT+08:00 Ian Jackson <ian.jack...@eu.citrix.com>: > Zhongze Liu writes ("Re: questions on mem_sharing_op*'s and > tools/tests/mem-sharing/memshrtool"): >> 2017-06-16 11:50 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: >> &

Re: [Xen-devel] [PATCH] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-16 Thread Zhongze Liu
2017-06-16 17:36 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi Jan, > > > 2017-06-16 16:45 GMT+08:00 Jan Beulich <jbeul...@suse.com>: >>>>> On 16.06.17 at 06:55, <blacksk...@gmail.com> wrote: >>> currently there is no wrapper for XENMEM_

Re: [Xen-devel] [PATCH] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-16 Thread Zhongze Liu
both @space and @size are uint16_t, so I think I should have made @space uint16_t, too. I'll fix this. Or do you have any good reasons to make both of them unsigned int? > >> + xen_ulong_t *idxs, >> +

[Xen-devel] [PATCH] libxc: add xc_domain_add_to_physmap_batch to wrap XENMEM_add_to_physmap_batch

2017-06-15 Thread Zhongze Liu
currently there is no wrapper for XENMEM_add_to_physmap_batch in libxc. add a wrapper to do that. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- Cc: Ian Jackson <ian.jack...@eu.citrix.com>, Cc: Wei Liu <wei.l...@citrix.com>, Cc: Stefano Stabellini <sstabell...@kernel.

Re: [Xen-devel] questions on mem_sharing_op*'s and tools/tests/mem-sharing/memshrtool

2017-06-15 Thread Zhongze Liu
2017-06-16 11:50 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > Hi there, > > I was experimenting with the mem_sharing_op and I found a handy tool: > tools/tests/mem-sharing/memshrtool > I set up two bare metal x86_64 VMS running some simple code in 16-bit > real m

[Xen-devel] questions on mem_sharing_op*'s and tools/tests/mem-sharing/memshrtool

2017-06-15 Thread Zhongze Liu
c_dom " "./memshrtool enable dst_dom" "./memshrtool nominate src_dom 0" And it failed with an "error executing xc_memshr_nominate_gfn(xch, domid, gfn, ): Argument list too long " But when I changed the gfn from 0 to 1000, it succeeds. Is there any restrition on the gf

Re: [Xen-devel] About the parameter list of tools/libxc/xc_domain.c:xc_domain_add_to_physmap()

2017-06-14 Thread Zhongze Liu
I didn't saw your mail. Sorry. 2017-06-14 23:13 GMT+08:00 Zhongze Liu <blacksk...@gmail.com>: > 2017-06-14 22:42 GMT+08:00 Wei Liu <wei.l...@citrix.com>: >> On Wed, Jun 14, 2017 at 09:19:23PM +0800, Zhongze Liu wrote: >>> Hi Xen deve

Re: [Xen-devel] About the parameter list of tools/libxc/xc_domain.c:xc_domain_add_to_physmap()

2017-06-14 Thread Zhongze Liu
2017-06-14 22:42 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Wed, Jun 14, 2017 at 09:19:23PM +0800, Zhongze Liu wrote: >> Hi Xen developers, >> >> In tools/libxc/xc_domain.c:xc_domain_add_to_physmap() the .size field >> of the xen_add_to_physmap >> s

Re: [Xen-devel] About the parameter list of tools/libxc/xc_domain.c:xc_domain_add_to_physmap()

2017-06-14 Thread Zhongze Liu
Hi Wei, 2017-06-14 22:42 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Wed, Jun 14, 2017 at 09:19:23PM +0800, Zhongze Liu wrote: >> Hi Xen developers, >> >> In tools/libxc/xc_domain.c:xc_domain_add_to_physmap() the .size field >> of the xen_add_to_phys

[Xen-devel] About the parameter list of tools/libxc/xc_domain.c:xc_domain_add_to_physmap()

2017-06-14 Thread Zhongze Liu
an XENMEMSPACE_gmfn_range- call. Is it a mistake or is it intentionally done so? Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH v3] tools: fix several "format-truncation" warnings with GCC 7

2017-06-13 Thread Zhongze Liu
;%d: %s: %s", error->code, ^~ xenctrl_stubs.c:64:4: note: ‘snprintf’ output 5 or more bytes (assuming 1028) into a destination of size 256 Enlarge the size of these buffers as suggested by the complier (and slightly rounded) to fix the warnings. No functional changes. Signed-off-by: Zhongze Liu <

Re: [Xen-devel] [PATCH v2] tools: fix several "format-truncation" warnings with GCC 7

2017-06-13 Thread Zhongze Liu
Hi Wei & Ian, 2017-06-13 18:52 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Tue, Jun 13, 2017 at 11:19:58AM +0100, Ian Jackson wrote: >> Zhongze Liu writes ("[PATCH v2] tools: fix several "format-truncation" >> warnings with GCC 7"): >>

Re: [Xen-devel] [PATCH] tools: fix several "format-truncation" errors with GCC 7

2017-06-12 Thread Zhongze Liu
Hi Ian, Thanks for pointing out the problems. I've consulted several maintainers about this and have drafted a new patch for it (in a new [patch v2] thread). Please have a look at it. Thanks. Cheers, Zhongze Liu. 2017-06-12 20:31 GMT+08:00 Ian Jackson <ian.jack...@eu.citrix.com>: > Zh

[Xen-devel] [PATCH v2] tools: fix several "format-truncation" warnings with GCC 7

2017-06-12 Thread Zhongze Liu
GCC 7.1.1 complains that several buffers passed to snprintf() in xenpmd and tools/ocmal/xc are too small to hold the largest possible resulting string. enlarge the size of these buffers to fix the warnings. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- CC: David Scott <d...@r

[Xen-devel] [PATCH] tools: fix several "format-truncation" errors with GCC 7

2017-06-12 Thread Zhongze Liu
replace several snprintf with asprintf in xenpmd and tools/ocmal/xc to fix the "format-truncation" errors caused by incorrect size of buffers. Signed-off-by: Zhongze Liu <blacksk...@gmail.com> --- CC: David Scott <d...@recoil.org> CC: Ian Jackson <ian.jack...@eu.citri

Re: [Xen-devel] [BUB REPORT] compiler warnings when building tools/firmware/etherboot/ipxe

2017-06-12 Thread Zhongze Liu
Hi Wei Liu, 2017-06-12 19:21 GMT+08:00 Wei Liu <wei.l...@citrix.com>: > On Mon, Jun 12, 2017 at 12:19:42PM +0100, Wei Liu wrote: >> On Mon, Jun 12, 2017 at 06:40:33PM +0800, Zhongze Liu wrote: >> > Hi Xen developers, >> > >> > Several -Wimplicit-fallth

[Xen-devel] [BUB REPORT] compiler warnings when building tools/firmware/etherboot/ipxe

2017-06-12 Thread Zhongze Liu
Hi Xen developers, Several -Wimplicit-fallthrough were found under tools/firmware/etherboot/ipxe with GCCv7.1.1. I'm not sure whether this is the right place to report this since it's not part of the xen source tree, But I think I'd better let you know. Cheers, Zhongze Liu

Re: [Xen-devel] Proposal to allow setting up shared memory areas between VMs from xl config file

2017-05-30 Thread Zhongze Liu
Hi Wei Liu, Thanks for your review and approval. Then I'll revise my proposal according to these conclusions. Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] Proposal to allow setting up shared memory areas between VMs from xl config file

2017-05-23 Thread Zhongze Liu
grants api as the final implementation choice. This list might be incomplete. Please tell me if I missed or misunderstand any important information. Cheers, Zhongze Liu ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

  1   2   >