|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v10] x86/altp2m: support for setting restrictions for an array of pages
On Wed, Dec 13, 2017 at 04:22:20PM +0200, Petre Pircalabu wrote:
> /**
> * Mem paging operations.
> diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c
> index 07fcd18..0f792b5 100644
> --- a/tools/libxc/xc_altp2m.c
> +++ b/tools/libxc/xc_altp2m.c
> @@ -213,3 +213,44 @@ int xc_altp2m_change_gfn(xc_interface *handle, uint32_t
> domid,
> return rc;
> }
>
> +int xc_altp2m_set_mem_access_multi(xc_interface *xch, uint32_t domid,
> + uint16_t view_id, uint8_t *access,
> + uint64_t *pages, uint32_t nr)
> +{
> + int rc;
> +
> + DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg);
> + DECLARE_HYPERCALL_BOUNCE(access, nr * sizeof(*access),
> + XC_HYPERCALL_BUFFER_BOUNCE_IN);
> + DECLARE_HYPERCALL_BOUNCE(pages, nr * sizeof(*pages),
> + XC_HYPERCALL_BUFFER_BOUNCE_IN);
> +
> + arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
> + if ( arg == NULL )
> + return -1;
> +
> + arg->version = HVMOP_ALTP2M_INTERFACE_VERSION;
> + arg->cmd = HVMOP_altp2m_set_mem_access_multi;
> + arg->domain = domid;
> + arg->u.set_mem_access_multi.view = view_id;
> + arg->u.set_mem_access_multi.nr = nr;
> +
> + if ( xc_hypercall_bounce_pre(xch, pages) ||
> + xc_hypercall_bounce_pre(xch, access) )
> + {
> + PERROR("Could not bounce memory for
> HVMOP_altp2m_set_mem_access_multi");
> + return -1;
> + }
> +
> + set_xen_guest_handle(arg->u.set_mem_access_multi.pfn_list, pages);
> + set_xen_guest_handle(arg->u.set_mem_access_multi.access_list, access);
> +
> + rc = xencall2(xch->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m,
> + HYPERCALL_BUFFER_AS_ARG(arg));
Tabs here.
With this fixed, libxc bits:
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |