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

Re: [Xen-devel] [PATCH v11 6/6] introduce a 'passthrough' configuration option to xl.cfg...



On Fri, Sep 13, 2019 at 11:58:26AM +0100, Paul Durrant wrote:
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 12545130df..e4b9c539b6 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -415,6 +415,15 @@
>   */
>  #define LIBXL_HAVE_BUILDINFO_IOMMU_MEMKB 1
>  
> +/*
> + * LIBXL_HAVE_CREATEINFO_PASSTHROUGH indicates that
> + * libxl_domain_create_info has a passthrough field (which is a
> + * libxl_passthrough enumeration) that indicates whether device pass-
> + * through is enabled for the domain and, if so, whether the IOMMU and
> + * HAP page tables may be shared or not.
> + */
> +#define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
> +
>  /*
>   * libxl ABI compatibility
>   *
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 59dbcb50a0..6b7702db17 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -578,6 +578,15 @@ int libxl__domain_make(libxl__gc *gc, 
> libxl_domain_config *d_config,
>                  libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
>          }
>  
> +        LOG(DETAIL, "passthrough: %s",
> +            libxl_passthrough_to_string(info->passthrough));
> +
> +        if (info->passthrough != LIBXL_PASSTHROUGH_DISABLED)
> +            create.flags |= XEN_DOMCTL_CDF_iommu;
> +
> +        if (info->passthrough == LIBXL_PASSTHROUGH_SYNC_PT)
> +            create.iommu_opts |= XEN_DOMCTL_IOMMU_no_sharept;
> +
>          /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
>          libxl_uuid_copy(ctx, (libxl_uuid *)&create.handle, &info->uuid);
>  
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index d52c63b6b0..22f05711e3 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -263,6 +263,12 @@ libxl_vkb_backend = Enumeration("vkb_backend", [
>      (2, "LINUX")
>      ])
>  
> +libxl_passthrough = Enumeration("passthrough", [
> +    (0, "disabled"),
> +    (1, "sync_pt"),
> +    (2, "share_pt"),
> +    ])
> +
>  #
>  # Complex libxl types
>  #

So, with this changes, when libvirt is rebuilt against a newer libxl,
guest with pass-through devices won't work anymore?
(That is, without modification of libvirt.)

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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