From: Tamas K Lengyel <tamas.lengyel@zentific.com>
To: Julien Grall <julien.grall@arm.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v7] x86/mem-sharing: mem-sharing a range of memory
Date: Tue, 19 Jul 2016 10:29:42 -0600 [thread overview]
Message-ID: <CAErYnsjneJi5YfH_nz1fgF55HWXRpqonevxSgXHK3B9_LSPfgQ@mail.gmail.com> (raw)
In-Reply-To: <596ff4aa-e2db-b85d-a09b-e98422ee8baf@arm.com>
On Tue, Jul 19, 2016 at 1:54 AM, Julien Grall <julien.grall@arm.com> wrote:
> 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.
Sounds good to me.
>
>> +
>> /* 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
Thanks!
Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-07-19 16:29 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
2016-07-19 16:29 ` Tamas K Lengyel [this message]
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=CAErYnsjneJi5YfH_nz1fgF55HWXRpqonevxSgXHK3B9_LSPfgQ@mail.gmail.com \
--to=tamas.lengyel@zentific.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.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 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).