@@ -260,6 +260,22 @@ with the following properties:
value specified by Xen command line parameter gnttab_max_maptrack_frames
(or its default value if unspecified, i.e. 1024) is used.
+- passthrough
+
+ A string property specifying whether IOMMU mappings are enabled for the
+ domain and hence whether it will be enabled for passthrough hardware.
+ Possible property values are:
+
+ - "enabled"
+ IOMMU mappings are enabled for the domain. Note that this option is the
+ default if the user provides the device partial passthrough device tree
+ for the domain.
+
+ - "disabled"
+ IOMMU mappings are disabled for the domain and so hardware may not be
+ passed through. This option is the default if this property is missing
+ and the user does not provide the device partial device tree for the domain.
+
Under the "xen,domain" compatible node, one or more sub-nodes are present
for the DomU kernel and ramdisk.
@@ -848,6 +848,8 @@ static int __init construct_domU(struct domain *d,
void __init create_domUs(void)
{
struct dt_device_node *node;
+ const char *dom0less_iommu;
+ bool iommu = false;
const struct dt_device_node *cpupool_node,
*chosen = dt_find_node_by_path("/chosen");
@@ -895,8 +897,13 @@ void __init create_domUs(void)
panic("Missing property 'cpus' for domain %s\n",
dt_node_name(node));
- if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") &&
- iommu_enabled )
+ if ( !dt_property_read_string(node, "passthrough", &dom0less_iommu) &&
+ !strcmp(dom0less_iommu, "enabled") )
+ iommu = true;
+
+ if ( iommu_enabled &&
+ (iommu || dt_find_compatible_node(node, NULL,
+ "multiboot,device-tree")) )
d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )