From: Julien Grall <julien.grall@arm.com>
To: Tamas K Lengyel <tamas.lengyel@zentific.com>,
xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v7] x86/mem-sharing: mem-sharing a range of memory
Date: Tue, 19 Jul 2016 08:54:03 +0100 [thread overview]
Message-ID: <596ff4aa-e2db-b85d-a09b-e98422ee8baf@arm.com> (raw)
In-Reply-To: <1468876480-27373-1-git-send-email-tamas.lengyel@zentific.com>
Hello Tamas,
On 18/07/2016 22:14, Tamas K Lengyel wrote:
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index e904bd5..0ca94cd 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2334,6 +2334,21 @@ int xc_memshr_add_to_physmap(xc_interface *xch,
> domid_t client_domain,
> unsigned long client_gfn);
>
> +/* Allows to deduplicate a range of memory of a client domain. Using
> + * this function is equivalent of calling xc_memshr_nominate_gfn for each gfn
> + * in the two domains followed by xc_memshr_share_gfns.
> + *
> + * May fail with -EINVAL if the source and client domain have different
> + * memory size or if memory sharing is not enabled on either of the domains.
> + * May also fail with -ENOMEM if there isn't enough memory available to store
> + * the sharing metadata before deduplication can happen.
> + */
> +int xc_memshr_range_share(xc_interface *xch,
> + domid_t source_domain,
> + domid_t client_domain,
> + unsigned long start,
> + unsigned long end);
I know the rest of memshr interface in libxc is using "unsigned long".
However, this should really be "uint64_t" to match the interface and
avoid issue with 32-bit toolstack on 64-bit hypervisor.
> +
> /* Debug calls: return the number of pages referencing the shared frame backing
> * the input argument. Should be one or greater.
> *
[...]
> diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
> index a522423..6d00228 100644
> --- a/xen/arch/x86/mm/mem_sharing.c
> +++ b/xen/arch/x86/mm/mem_sharing.c
[...]
> @@ -1468,6 +1520,94 @@ int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg)
> }
> break;
>
> + case XENMEM_sharing_op_range_share:
> + {
> + unsigned long max_sgfn, max_cgfn;
> + struct domain *cd;
> +
> + rc = -EINVAL;
> + if( mso.u.range._pad[0] || mso.u.range._pad[1] ||
NIT: missing space after the "if".
> + mso.u.range._pad[2] )
> + goto out;
> +
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-19 7:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 21:14 [PATCH v7] x86/mem-sharing: mem-sharing a range of memory Tamas K Lengyel
2016-07-18 21:47 ` Andrew Cooper
2016-07-19 16:27 ` Tamas K Lengyel
2016-07-19 16:49 ` Andrew Cooper
2016-07-19 16:54 ` Tamas K Lengyel
2016-07-19 16:55 ` Andrew Cooper
2016-07-19 16:58 ` Tamas K Lengyel
2016-07-19 7:54 ` Julien Grall [this message]
2016-07-19 16:29 ` Tamas K Lengyel
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=596ff4aa-e2db-b85d-a09b-e98422ee8baf@arm.com \
--to=julien.grall@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=tamas.lengyel@zentific.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.