mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Thus far mem_access and mem_sharing memops had been able to signal to Xen to start pulling responses off the corresponding rings. In this patch we retire these memops and add them to the option to the vm_event_op domctl. The vm_event_op domctl suboptions are the same for each ring thus we consolidate them into XEN_VM_EVENT_ENABLE/DISABLE/RESUME. As part of this patch in libxc we also rename the mem_access_enable/disable functions to monitor_enable/disable and move them into xc_monitor.c. Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
98 lines
2.6 KiB
C
98 lines
2.6 KiB
C
/******************************************************************************
|
|
*
|
|
* tools/libxc/xc_mem_access.c
|
|
*
|
|
* Interface to low-level memory access mode functionality
|
|
*
|
|
* Copyright (c) 2011 Virtuata, Inc.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "xc_private.h"
|
|
#include <xen/memory.h>
|
|
|
|
int xc_set_mem_access(xc_interface *xch,
|
|
domid_t domain_id,
|
|
xenmem_access_t access,
|
|
uint64_t first_pfn,
|
|
uint32_t nr)
|
|
{
|
|
xen_mem_access_op_t mao =
|
|
{
|
|
.op = XENMEM_access_op_set_access,
|
|
.domid = domain_id,
|
|
.access = access,
|
|
.pfn = first_pfn,
|
|
.nr = nr
|
|
};
|
|
|
|
return do_memory_op(xch, XENMEM_access_op, &mao, sizeof(mao));
|
|
}
|
|
|
|
int xc_get_mem_access(xc_interface *xch,
|
|
domid_t domain_id,
|
|
uint64_t pfn,
|
|
xenmem_access_t *access)
|
|
{
|
|
int rc;
|
|
xen_mem_access_op_t mao =
|
|
{
|
|
.op = XENMEM_access_op_get_access,
|
|
.domid = domain_id,
|
|
.pfn = pfn
|
|
};
|
|
|
|
rc = do_memory_op(xch, XENMEM_access_op, &mao, sizeof(mao));
|
|
|
|
if ( rc == 0 )
|
|
*access = mao.access;
|
|
|
|
return rc;
|
|
}
|
|
|
|
int xc_mem_access_enable_emulate(xc_interface *xch,
|
|
domid_t domain_id)
|
|
{
|
|
xen_mem_access_op_t mao =
|
|
{
|
|
.op = XENMEM_access_op_enable_emulate,
|
|
.domid = domain_id,
|
|
};
|
|
|
|
return do_memory_op(xch, XENMEM_access_op, &mao, sizeof(mao));
|
|
}
|
|
|
|
int xc_mem_access_disable_emulate(xc_interface *xch,
|
|
domid_t domain_id)
|
|
{
|
|
xen_mem_access_op_t mao =
|
|
{
|
|
.op = XENMEM_access_op_disable_emulate,
|
|
.domid = domain_id,
|
|
};
|
|
|
|
return do_memory_op(xch, XENMEM_access_op, &mao, sizeof(mao));
|
|
}
|
|
|
|
/*
|
|
* Local variables:
|
|
* mode: C
|
|
* c-file-style: "BSD"
|
|
* c-basic-offset: 4
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*/
|