From: Dushyant Behl <myselfdushyantbehl@gmail.com>
To: "Aravindh Puthiyaparambil (aravindp)" <aravindp@cisco.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Andres Lagar Cavilla <andres.lagarcavilla@gmail.com>,
David Scott <dave.scott@eu.citrix.com>
Subject: Re: [PATCH v2 2/3] mem_event: Added new helper API to teardown mem event setup and unmap ring_page.
Date: Fri, 5 Sep 2014 04:12:55 +0530 [thread overview]
Message-ID: <CAHF350Kjtu2F-p5fZG7GPcDfxv_E3C2dO+JCQymWYGFoK-9vBg@mail.gmail.com> (raw)
In-Reply-To: <97A500D504438F4ABC02EBA81613CC63318E13F3@xmb-aln-x02.cisco.com>
[-- Attachment #1.1: Type: text/plain, Size: 3641 bytes --]
On Tue, Aug 26, 2014 at 4:23 AM, Aravindh Puthiyaparambil (aravindp) <
aravindp@cisco.com> wrote:
> >tools/libxc/xc_mem_event.c: Added new generic API to teardown mem
> >event setup,
> >the API supports hvm params PAGING, ACCESS and SHARING and also
> >completes the
> >obvious job of unmapping ring_page.
> >
> >tools/libxc/xc_mem_access.c: Modified mem_event_disable to use the new
> >teardown API.
> >
> >tools/tests/xen-access/: Updated code to use the new API's.
> >
> >Signed-off-by: Dushyant Behl <myselfdushyantbehl@gmail.com>
> >---
> > tools/libxc/xc_mem_access.c | 9 +++----
> > tools/libxc/xc_mem_event.c | 53
> >+++++++++++++++++++++++++++++++++++++
> > tools/libxc/xc_private.h | 8 ++++++
> > tools/libxc/xenctrl.h | 5 ++--
> > tools/tests/xen-access/xen-access.c | 6 ++---
> > 5 files changed, 69 insertions(+), 12 deletions(-)
> >
> >diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
> >index 89050be..29835c3 100644
> >--- a/tools/libxc/xc_mem_access.c
> >+++ b/tools/libxc/xc_mem_access.c
> >@@ -33,12 +33,11 @@ int xc_mem_access_enable(xc_interface *xch,
> >domid_t domain_id,
> > port, ring_page, back_ring);
> > }
> >
> >-int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
> >+int xc_mem_access_disable(xc_interface *xch, domid_t domain_id, void
> >*ring_page)
> > {
> >- return xc_mem_event_control(xch, domain_id,
> >- XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE,
> >- XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
> >- NULL);
> >+ return xc_mem_event_disable(xch, domain_id,
> >+ HVM_PARAM_ACCESS_RING_PFN,
> >+ ring_page);
> > }
> >
> > int xc_mem_access_resume(xc_interface *xch, domid_t domain_id)
> >diff --git a/tools/libxc/xc_mem_event.c b/tools/libxc/xc_mem_event.c
> >index cdbeca8..b6ae7d0 100644
> >--- a/tools/libxc/xc_mem_event.c
> >+++ b/tools/libxc/xc_mem_event.c
> >@@ -200,3 +200,56 @@ int xc_mem_event_enable(xc_interface *xch,
> >domid_t domain_id, int param,
> >
> > return rc1;
> > }
> >+
> >+/*
> >+ * Disable mem_event.
> >+ * Returns 0 on success, if failure returns -1 with errno properly set.
> >+ * param can be HVM_PARAM_PAGING/ACCESS/SHARING_RING_PFN
> >+ */
> >+int xc_mem_event_disable(xc_interface *xch, domid_t domain_id,
> >+ int param, void *ring_page)
> >+{
> >+ int rc;
> >+ unsigned int op, mode;
> >+
> >+ switch ( param )
> >+ {
> >+ case HVM_PARAM_PAGING_RING_PFN:
> >+ op = XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE;
> >+ mode = XEN_DOMCTL_MEM_EVENT_OP_PAGING;
> >+ break;
> >+
> >+ case HVM_PARAM_ACCESS_RING_PFN:
> >+ op = XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE;
> >+ mode = XEN_DOMCTL_MEM_EVENT_OP_ACCESS;
> >+ break;
> >+
> >+ case HVM_PARAM_SHARING_RING_PFN:
> >+ op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE;
> >+ mode = XEN_DOMCTL_MEM_EVENT_OP_SHARING;
> >+ break;
> >+
> >+ /*
> >+ * This is for the outside chance that the HVM_PARAM is valid
> but is
> >invalid
> >+ * as far as mem_event goes.
> >+ */
> >+ default:
> >+ errno = EINVAL;
> >+ rc = -1;
> >+ goto out;
> >+ }
>
> Sorry, I should have caught this in my previous review. I think the Xen
> coding style places the case statement with the same indent as the switch.
>
No problem, I'll update the patch.
Thanks,
Dushyant
[-- Attachment #1.2: Type: text/html, Size: 4905 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-09-04 22:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 0:26 [PATCH v2 1/3] mem_access: modifications to mem_event enable API Dushyant Behl
2014-08-25 0:26 ` [PATCH v2 2/3] mem_event: Added new helper API to teardown mem event setup and unmap ring_page Dushyant Behl
2014-08-25 15:47 ` Andres Lagar Cavilla
2014-08-25 22:53 ` Aravindh Puthiyaparambil (aravindp)
2014-09-04 22:42 ` Dushyant Behl [this message]
2014-08-25 0:26 ` [PATCH v2 3/3] xenpaging: updated code to use safer mem_event API's for setup and teardown Dushyant Behl
2014-08-25 15:49 ` Andres Lagar Cavilla
2014-08-25 15:45 ` [PATCH v2 1/3] mem_access: modifications to mem_event enable API Andres Lagar Cavilla
2014-08-25 22:38 ` Aravindh Puthiyaparambil (aravindp)
2014-09-04 22:40 ` Dushyant Behl
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=CAHF350Kjtu2F-p5fZG7GPcDfxv_E3C2dO+JCQymWYGFoK-9vBg@mail.gmail.com \
--to=myselfdushyantbehl@gmail.com \
--cc=andres.lagarcavilla@gmail.com \
--cc=aravindp@cisco.com \
--cc=dave.scott@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.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).