> -----Original Message----- > From: Anthony PERARD <[email protected]> > Sent: 13 September 2019 17:29 > To: Paul Durrant <[email protected]> > Cc: [email protected]; Jan Beulich <[email protected]>; > Christian Lindig > <[email protected]>; Ian Jackson <[email protected]>; Wei Liu > <[email protected]>; Andrew > Cooper <[email protected]>; George Dunlap <[email protected]>; > Julien Grall > <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; > Stefano Stabellini > <[email protected]>; Tim (Xen.org) <[email protected]>; David Scott > <[email protected]>; Volodymyr > Babchuk <[email protected]>; Roger Pau Monne <[email protected]> > Subject: Re: [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.)
Yes, that's a good point. I'll add an extra hunk to default passthrough to enabled unless it is otherwise set by the toolstack. Paul > > -- > Anthony PERARD _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
