introduce a 'passthrough' configuration option to xl.cfg...
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 25 Sep 2019 14:14:55 +0000 (16:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Sep 2019 14:14:55 +0000 (16:14 +0200)
commitbabde47a3feda6dd4ba318e1e57bd2ee9f2c1116
tree9b041d9f02c1ccfaf8f57d81eceaa1c626ead758
parent8d8db5a4ad267bca663bc1e41dccb53e072d73d2
introduce a 'passthrough' configuration option to xl.cfg...

...and hence the ability to disable IOMMU mappings, and control EPT
sharing.

This patch introduces a new 'libxl_passthrough' enumeration into
libxl_domain_create_info. The value will be set by xl either when it parses
a new 'passthrough' option in xl.cfg, or implicitly if there is passthrough
hardware specified for the domain.

If the value of the passthrough configuration option is 'disabled' then
the XEN_DOMCTL_CDF_iommu flag will be clear in the xen_domctl_createdomain
flags, thus allowing the toolstack to control whether the domain gets
IOMMU mappings or not (where previously they were globally set).

If the value of the passthrough configuration option is 'sync_pt' then
a new 'iommu_opts' field in xen_domctl_createdomain will be set with the
value XEN_DOMCTL_IOMMU_no_sharept. This will override the global default
set in iommu_hap_pt_share, thus allowing the toolstack to control whether
EPT sharing is used for the domain.

If the value of passthrough is 'enabled' then xl will choose an appropriate
default according to the type of domain and hardware support.

NOTE: The 'iommu_memkb' overhead in libxl_domain_build_info will now only
      be set if passthrough is 'sync_pt' (or xl has chosen this mode as
      a default).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
15 files changed:
docs/man/xl.cfg.5.pod.in
tools/libxl/libxl.h
tools/libxl/libxl_create.c
tools/libxl/libxl_types.idl
tools/ocaml/libs/xc/xenctrl.ml
tools/ocaml/libs/xc/xenctrl.mli
tools/ocaml/libs/xc/xenctrl_stubs.c
tools/xl/xl_parse.c
xen/arch/arm/domain.c
xen/arch/x86/domain.c
xen/common/domain.c
xen/common/domctl.c
xen/drivers/passthrough/iommu.c
xen/include/public/domctl.h
xen/include/xen/iommu.h