|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V2 5/25] tools/libxc: Add viommu operations in libxc
On Wed, Aug 09, 2017 at 04:34:06PM -0400, Lan Tianyu wrote:
> From: Chao Gao <chao.gao@xxxxxxxxx>
>
> This patch adds XEN_DOMCTL_viommu_op hypercall. This hypercall
> comprises three sub-command:
> - query capabilities of one specific type vIOMMU emulated by Xen
> - create vIOMMU in Xen hypervisor, given viommu type, register-set location
> and capabilities
> - destroy vIOMMU specified by viommu_id
>
> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
This needs to get rebased in accordance with the proposed name changes
in the struct.
> +
> +#include "xc_private.h"
> +
> +int xc_viommu_query_cap(xc_interface *xch, domid_t dom,
> + uint64_t type, uint64_t *cap)
> +{
> + int rc;
> + DECLARE_DOMCTL;
> +
> + domctl.cmd = XEN_DOMCTL_viommu_op;
> + domctl.domain = (domid_t)dom;
Pointless cast here and below.
> + domctl.u.viommu_op.cmd = XEN_DOMCTL_query_viommu_caps;
> + domctl.u.viommu_op.u.query_caps.viommu_type = type;
> +
> + rc = do_domctl(xch, &domctl);
> + if ( !rc )
> + *cap = domctl.u.viommu_op.u.query_caps.capabilities;
Blank line here please.
> + return rc;
> +}
> +
> +int xc_viommu_create(xc_interface *xch, domid_t dom, uint64_t type,
> + uint64_t base_addr, uint64_t length, uint64_t cap,
> + uint32_t *viommu_id)
> +{
> + int rc;
> + DECLARE_DOMCTL;
> +
> + domctl.cmd = XEN_DOMCTL_viommu_op;
> + domctl.domain = (domid_t)dom;
> + domctl.u.viommu_op.cmd = XEN_DOMCTL_create_viommu;
> + domctl.u.viommu_op.u.create_viommu.viommu_type = type;
> + domctl.u.viommu_op.u.create_viommu.base_address = base_addr;
> + domctl.u.viommu_op.u.create_viommu.length = length;
> + domctl.u.viommu_op.u.create_viommu.capabilities = cap;
> +
> + rc = do_domctl(xch, &domctl);
> + if ( !rc )
> + *viommu_id = domctl.u.viommu_op.u.create_viommu.viommu_id;
Ditto.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |