From: Tamas K Lengyel <tamas@tklengyel.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: "wei.liu2@citrix.com" <wei.liu2@citrix.com>,
George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH RFC] tools/libxc, xen/x86: Added xc_set_mem_access_sparse()
Date: Fri, 26 Aug 2016 14:33:25 -0600 [thread overview]
Message-ID: <CABfawhmXg9kECc2at_VFN2Uh2N+CUTmEFvxtPs1mLnaXRcu-QQ@mail.gmail.com> (raw)
In-Reply-To: <1472191902-13344-1-git-send-email-rcojocaru@bitdefender.com>
On Fri, Aug 26, 2016 at 12:11 AM, Razvan Cojocaru
<rcojocaru@bitdefender.com> 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.
I think this is a useful addition.
>
> 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);
> +
I guess adding a comment here would be nice for people just looking at
the header to be able to tell that pages = array, nr = array size.
Also, wouldn't it make sense to make "access" an array as well, so you
could one-set multiple pages to different permissions?
Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-26 20:33 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
2016-08-26 20:33 ` Tamas K Lengyel [this message]
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=CABfawhmXg9kECc2at_VFN2Uh2N+CUTmEFvxtPs1mLnaXRcu-QQ@mail.gmail.com \
--to=tamas@tklengyel.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=wei.liu2@citrix.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).