From: Aravindh Puthiyaparambil <aravindp@cisco.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v3 3/5] tools/xen-access: Use the new mem_access APIs
Date: Tue, 15 Apr 2014 17:25:24 -0700 [thread overview]
Message-ID: <1397607926-15298-4-git-send-email-aravindp@cisco.com> (raw)
In-Reply-To: <1397607926-15298-1-git-send-email-aravindp@cisco.com>
Modify the xen-access test program to use the new mem_access APIs.
Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
No changes from version 2 of the patch.
Changes from version 1 of the patch:
Remove extra "gfn" parameter from xc_mem_access_resume() call.
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index f6522a1..0a84bd5 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -410,8 +410,7 @@ static int xenaccess_resume_page(xenaccess_t *paging, mem_event_response_t *rsp)
goto out;
/* Tell Xen page is ready */
- ret = xc_mem_access_resume(paging->xc_handle, paging->mem_event.domain_id,
- rsp->gfn);
+ ret = xc_mem_access_resume(paging->xc_handle, paging->mem_event.domain_id);
ret = xc_evtchn_notify(paging->mem_event.xce_handle,
paging->mem_event.port);
@@ -440,8 +439,8 @@ int main(int argc, char *argv[])
int rc = -1;
int rc1;
xc_interface *xch;
- hvmmem_access_t default_access = HVMMEM_access_rwx;
- hvmmem_access_t after_first_access = HVMMEM_access_rwx;
+ xenmem_access_t default_access = XENMEM_access_rwx;
+ xenmem_access_t after_first_access = XENMEM_access_rwx;
int required = 0;
int int3 = 0;
int shutting_down = 0;
@@ -475,13 +474,13 @@ int main(int argc, char *argv[])
if ( !strcmp(argv[0], "write") )
{
- default_access = HVMMEM_access_rx;
- after_first_access = HVMMEM_access_rwx;
+ default_access = XENMEM_access_rx;
+ after_first_access = XENMEM_access_rwx;
}
else if ( !strcmp(argv[0], "exec") )
{
- default_access = HVMMEM_access_rw;
- after_first_access = HVMMEM_access_rwx;
+ default_access = XENMEM_access_rw;
+ after_first_access = XENMEM_access_rwx;
}
else if ( !strcmp(argv[0], "int3") )
{
@@ -520,15 +519,15 @@ int main(int argc, char *argv[])
}
/* Set the default access type and convert all pages to it */
- rc = xc_hvm_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
+ rc = xc_set_mem_access(xch, domain_id, default_access, ~0ull, 0);
if ( rc < 0 )
{
ERROR("Error %d setting default mem access type\n", rc);
goto exit;
}
- rc = xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
- xenaccess->domain_info->max_pages);
+ rc = xc_set_mem_access(xch, domain_id, default_access, 0,
+ xenaccess->domain_info->max_pages);
if ( rc < 0 )
{
ERROR("Error %d setting all memory to access type %d\n", rc,
@@ -554,8 +553,9 @@ int main(int argc, char *argv[])
DPRINTF("xenaccess shutting down on signal %d\n", interrupted);
/* Unregister for every event */
- rc = xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, ~0ull, 0);
- rc = xc_hvm_set_mem_access(xch, domain_id, HVMMEM_access_rwx, 0, xenaccess->domain_info->max_pages);
+ rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, ~0ull, 0);
+ rc = xc_set_mem_access(xch, domain_id, XENMEM_access_rwx, 0,
+ xenaccess->domain_info->max_pages);
rc = xc_set_hvm_param(xch, domain_id, HVM_PARAM_MEMORY_EVENT_INT3, HVMPME_mode_disabled);
shutting_down = 1;
@@ -575,7 +575,7 @@ int main(int argc, char *argv[])
while ( RING_HAS_UNCONSUMED_REQUESTS(&xenaccess->mem_event.back_ring) )
{
- hvmmem_access_t access;
+ xenmem_access_t access;
rc = get_request(&xenaccess->mem_event, &req);
if ( rc != 0 )
@@ -591,7 +591,7 @@ int main(int argc, char *argv[])
switch (req.reason) {
case MEM_EVENT_REASON_VIOLATION:
- rc = xc_hvm_get_mem_access(xch, domain_id, req.gfn, &access);
+ rc = xc_get_mem_access(xch, domain_id, req.gfn, &access);
if (rc < 0)
{
ERROR("Error %d getting mem_access event\n", rc);
@@ -611,8 +611,8 @@ int main(int argc, char *argv[])
if ( default_access != after_first_access )
{
- rc = xc_hvm_set_mem_access(xch, domain_id,
- after_first_access, req.gfn, 1);
+ rc = xc_set_mem_access(xch, domain_id, after_first_access,
+ req.gfn, 1);
if (rc < 0)
{
ERROR("Error %d setting gfn to access_type %d\n", rc,
--
1.8.3.2
next prev parent reply other threads:[~2014-04-16 0:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 0:25 [PATCH v3 0/5] Make mem_access APIs and hypercalls generic Aravindh Puthiyaparambil
2014-04-16 0:25 ` [PATCH v3 1/5] x86/mem_access: Make the mem_access ops generic Aravindh Puthiyaparambil
2014-04-16 9:24 ` Jan Beulich
2014-04-16 0:25 ` [PATCH v3 2/5] tools/libxc: Make the mem_access APIs generic Aravindh Puthiyaparambil
2014-04-16 15:58 ` Ian Campbell
2014-04-17 9:46 ` Tamas Lengyel
2014-04-17 15:52 ` Aravindh Puthiyaparambil (aravindp)
2014-04-17 20:50 ` Tamas Lengyel
2014-04-16 0:25 ` Aravindh Puthiyaparambil [this message]
2014-04-16 15:58 ` [PATCH v3 3/5] tools/xen-access: Use the new mem_access APIs Ian Campbell
2014-04-16 0:25 ` [PATCH v3 4/5] tools/libxc: Remove xc_hvm_[sg]et_mem_access() APIs Aravindh Puthiyaparambil
2014-04-16 15:59 ` Ian Campbell
2014-04-16 0:25 ` [PATCH v3 5/5] x86/mem_access: Deprecate the HVM mem_access ops Aravindh Puthiyaparambil
2014-04-16 9:28 ` Jan Beulich
2014-04-16 15:18 ` Aravindh Puthiyaparambil (aravindp)
2014-04-16 16:11 ` Jan Beulich
2014-04-24 11:13 ` [PATCH v3 0/5] Make mem_access APIs and hypercalls generic Tim Deegan
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=1397607926-15298-4-git-send-email-aravindp@cisco.com \
--to=aravindp@cisco.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.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).