From: Wei Liu <wei.liu2@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: tamas@tklengyel.com, wei.liu2@citrix.com,
george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
jbeulich@suse.com
Subject: Re: [PATCH RFC] tools/libxc, xen/x86: Added xc_set_mem_access_sparse()
Date: Fri, 26 Aug 2016 09:45:34 +0100 [thread overview]
Message-ID: <20160826084534.GU20641@citrix.com> (raw)
In-Reply-To: <1472191902-13344-1-git-send-email-rcojocaru@bitdefender.com>
On Fri, Aug 26, 2016 at 09:11:42AM +0300, Razvan Cojocaru wrote:
> Currently it is only possible to set mem_access restrictions only for
> a contiguous range of GFNs (or, as a particular case, for a single GFN).
> This patch introduces a new libxc function taking an array of GFNs.
> The alternative would be to set each page in turn, using a userspace-HV
> roundtrip for each call, and triggering a TLB flush per page set.
>
> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> ---
> tools/libxc/include/xenctrl.h | 4 +++
> tools/libxc/xc_mem_access.c | 32 +++++++++++++++++++++++
> xen/arch/x86/hvm/hvm.c | 2 +-
> xen/arch/x86/mm/p2m.c | 59 ++++++++++++++++++++++++++++++-------------
> xen/common/compat/memory.c | 1 -
> xen/common/mem_access.c | 13 +++++++++-
> xen/include/public/memory.h | 6 +++++
> xen/include/xen/p2m-common.h | 6 ++---
> 8 files changed, 100 insertions(+), 23 deletions(-)
>
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 560ce7b..ac84908 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2125,6 +2125,10 @@ int xc_set_mem_access(xc_interface *xch, domid_t domain_id,
> xenmem_access_t access, uint64_t first_pfn,
> uint32_t nr);
>
> +int xc_set_mem_access_sparse(xc_interface *xch, domid_t domain_id,
> + xenmem_access_t access, xen_pfn_t *pages,
> + uint32_t nr);
> +
> /*
> * Gets the mem access for the given page (returned in access on success)
> */
> diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
> index eee088c..73b1caa 100644
> --- a/tools/libxc/xc_mem_access.c
> +++ b/tools/libxc/xc_mem_access.c
> @@ -41,6 +41,38 @@ int xc_set_mem_access(xc_interface *xch,
> return do_memory_op(xch, XENMEM_access_op, &mao, sizeof(mao));
> }
>
> +int xc_set_mem_access_sparse(xc_interface *xch,
> + domid_t domain_id,
> + xenmem_access_t access,
> + xen_pfn_t *pages,
> + uint32_t nr)
> +{
> + DECLARE_HYPERCALL_BOUNCE(pages, nr * sizeof(xen_pfn_t), XC_HYPERCALL_BUFFER_BOUNCE_IN);
Line too long.
There isn't much else to say because it looks like to be a rather
straightforward hypercall wrapper.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-26 8:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 6:11 [PATCH RFC] tools/libxc, xen/x86: Added xc_set_mem_access_sparse() Razvan Cojocaru
2016-08-26 7:18 ` Jan Beulich
2016-08-26 7:40 ` Razvan Cojocaru
2016-08-26 8:14 ` Jan Beulich
2016-08-29 15:29 ` Razvan Cojocaru
2016-08-29 15:42 ` Jan Beulich
2016-08-29 16:02 ` Razvan Cojocaru
2016-08-29 16:20 ` Jan Beulich
2016-08-29 16:42 ` Razvan Cojocaru
2016-08-30 6:39 ` Jan Beulich
2016-08-30 8:34 ` Razvan Cojocaru
2016-08-30 9:06 ` Jan Beulich
2016-08-29 12:11 ` Razvan Cojocaru
2016-08-29 12:14 ` Razvan Cojocaru
2016-08-26 8:45 ` Wei Liu [this message]
2016-08-26 20:33 ` Tamas K Lengyel
2016-08-26 22:19 ` Razvan Cojocaru
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=20160826084534.GU20641@citrix.com \
--to=wei.liu2@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=rcojocaru@bitdefender.com \
--cc=tamas@tklengyel.com \
--cc=xen-devel@lists.xen.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).