From: Ian Campbell Subject: [PATCH 13 of 25] libxc: convert mca interface over to hypercall buffers Date: Fri, 22 Oct 2010 15:15:55 +0100 Message-ID: <441891ba02392f7ac7ca.1287756955@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1287756891 -3600 # Node ID 441891ba02392f7ac7ca215569eab45023b8c9cc # Parent 36df3e4c37de798250bd45b24f4d13197b627aac libxc: convert mca interface over to hypercall buffers Signed-off-by: Ian Campbell diff -r 36df3e4c37de -r 441891ba0239 tools/libxc/xc_misc.c --- a/tools/libxc/xc_misc.c Fri Oct 22 15:14:51 2010 +0100 +++ b/tools/libxc/xc_misc.c Fri Oct 22 15:14:51 2010 +0100 @@ -167,18 +167,19 @@ int xc_mca_op(xc_interface *xch, struct { int ret = 0; DECLARE_HYPERCALL; + DECLARE_HYPERCALL_BOUNCE(mc, sizeof(*mc), XC_HYPERCALL_BUFFER_BOUNCE_BOTH); + if ( xc_hypercall_bounce_pre(xch, mc) ) + { + PERROR("Could not bounce xen_mc memory buffer"); + return -1; + } mc->interface_version = XEN_MCA_INTERFACE_VERSION; - if ( lock_pages(xch, mc, sizeof(*mc)) ) - { - PERROR("Could not lock xen_mc memory"); - return -EINVAL; - } hypercall.op = __HYPERVISOR_mca; - hypercall.arg[0] = (unsigned long)mc; + hypercall.arg[0] = HYPERCALL_BUFFER_AS_ARG(mc); ret = do_xen_hypercall(xch, &hypercall); - unlock_pages(xch, mc, sizeof(*mc)); + xc_hypercall_bounce_post(xch, mc); return ret; } #endif