[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH V2 2/26] DOMCTL: Introduce new DOMCTL commands for vIOMMU support



On Thu, May 18, 2017 at 01:34:32AM -0400, Lan Tianyu wrote:
> This patch is to introduce create, destroy and query capabilities
> command for vIOMMU. vIOMMU layer will deal with requests and call
> arch vIOMMU ops.
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@xxxxxxxxx>
> ---
>  xen/common/domctl.c         |  3 +++
>  xen/common/viommu.c         | 35 +++++++++++++++++++++++++++++++++++
>  xen/include/public/domctl.h | 40 ++++++++++++++++++++++++++++++++++++++++
>  xen/include/xen/viommu.h    |  8 +++++++-
>  4 files changed, 85 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index 951a5dc..a178544 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -1141,6 +1141,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>          if ( !ret )
>              copyback = 1;
>          break;
> +    case XEN_DOMCTL_viommu_op:
> +        ret = viommu_domctl(d, &op->u.viommu_op, &copyback);
> +        break;
>  
>      default:
>          ret = arch_do_domctl(op, d, u_domctl);
> diff --git a/xen/common/viommu.c b/xen/common/viommu.c
> index eadcecb..74afbf5 100644
> --- a/xen/common/viommu.c
> +++ b/xen/common/viommu.c
> @@ -30,6 +30,41 @@ struct viommu_type {
>      struct list_head node;
>  };
>  
> +int viommu_domctl(struct domain *d, struct xen_domctl_viommu_op *op,
> +                  bool_t *need_copy)

s/bool_t/bool/g

> +{
> +    int rc = -EINVAL;
> +
> +    switch ( op->cmd )
> +    {
> +    case XEN_DOMCTL_create_viommu:
> +             rc = viommu_create(d, op->u.create_viommu.viommu_type,
> +                           op->u.create_viommu.base_address,
> +                           op->u.create_viommu.length,
> +                           op->u.create_viommu.capabilities);

Indentation.

> +        if (rc >= 0) {

Style.

> +            op->u.create_viommu.viommu_id = rc;
> +            *need_copy = true;
> +        }
> +        break;
> +
> +    case XEN_DOMCTL_destroy_viommu:
> +        rc = viommu_destroy(d, op->u.destroy_viommu.viommu_id);
> +        break;
> +
> +    case XEN_DOMCTL_query_viommu_caps:
> +        op->u.query_caps.caps
> +                = viommu_query_caps(d, op->u.query_caps.viommu_type);
> +        *need_copy = true;
> +        break;
> +
> +    default:
> +        break;
> +    }
> +
> +    return rc;
> +}
> +
[...]
>  static inline int viommu_init_domain(struct domain *d) { return 0 };
> @@ -62,8 +64,12 @@ static inline int viommu_register_type(u64 type, struct 
> viommu_ops * ops)
>  { return 0; };
>  static inline void viommu_unregister_type(u64 type) { };
>  static inline u64 viommu_query_caps(struct domain *d, u64 viommu_type)
> -                { return -ENODEV };
> +{ return -ENODEV };

Spurious change.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.