used, or GUEST_VPL011_SPI+1 if vpl011 is enabled, whichever is
greater.
+- direct-map
+
+ Optional. An array of integer pairs specifying addresses and sizes.
+ direct_map requests the memory of the domain to be 1:1 mapped with
+ the memory ranges specified as argument. Only sizes that are a
+ power of two number of pages are allowed.
+
+- #direct-map-addr-cells and #direct-map-size-cells
+
+ The number of cells to use for the addresses and for the sizes in
+ direct-map. Default and maximum are 2 cells for both addresses and
+ sizes.
+
- #address-cells and #size-cells
Both #address-cells and #size-cells need to be specified because
--- /dev/null
+Request Device Assignment without IOMMU support
+===============================================
+
+Add xen,force-assign-without-iommu; to the device tree snippet
+
+ ethernet: ethernet@ff0e0000 {
+ compatible = "cdns,zynqmp-gem";
+ xen,path = "/amba/ethernet@ff0e0000";
+ xen,reg = <0x0 0xff0e0000 0x1000 0x0 0xff0e0000>;
+ xen,force-assign-without-iommu;
+
+Optionally, if none of the domains require an IOMMU, then it could be
+disabled (not recommended). For instance by adding status = "disabled";
+under the smmu node:
+
+ smmu@fd800000 {
+ compatible = "arm,mmu-500";
+ status = "disabled";
+
+
+Request 1:1 memory mapping for the dom0-less domain
+===================================================
+
+Add a direct-map property under the appropriate /chosen/domU node with
+the memory ranges you want to assign to your domain. If you are using
+imagebuilder, you can add to boot.source something like the following:
+
+ fdt set /chosen/domU0 direct-map <0x0 0x10000000 0x0 0x10000000 0x0 0x60000000 0x0 0x10000000>
+
+Which will assign the ranges:
+
+ 0x10000000 - 0x20000000
+ 0x60000000 - 0x70000000
+
+to the first dom0less domU.
/* type must be set before allocate memory */
d->arch.type = kinfo.type;
#endif
- allocate_memory(d, &kinfo);
+
+ if ( !is_domain_direct_mapped(d) )
+ allocate_memory(d, &kinfo);
+ else
+ {
+ struct membank banks[NR_MEM_BANKS];
+ const struct dt_property *prop;
+ u32 direct_map_len, direct_map_addr_len = 2, direct_map_size_len = 2;
+ unsigned int i;
+ __be32 *p;
+
+ prop = dt_find_property(node, "direct-map", &direct_map_len);
+ BUG_ON(!prop);
+
+ dt_property_read_u32(node,
+ "#direct-map-addr-cells",
+ &direct_map_addr_len);
+ dt_property_read_u32(node,
+ "#direct-map-size-cells",
+ &direct_map_size_len);
+ BUG_ON(direct_map_size_len > 2 || direct_map_addr_len > 2);
+
+ for ( i = 0, p = prop->value;
+ i < direct_map_len /
+ (4 * (direct_map_addr_len + direct_map_size_len));
+ i++)
+ {
+ int j;
+
+ banks[i].start = 0;
+ for ( j = 0; j < direct_map_addr_len; j++, p++ )
+ banks[i].start |= __be32_to_cpu(*p) << (32*j);
+
+ banks[i].size = 0;
+ for ( j = 0; j < direct_map_size_len; j++, p++ )
+ banks[i].size |= __be32_to_cpu(*p) << (32*j);
+
+ printk(XENLOG_DEBUG
+ "direct_map start=%#"PRIpaddr" size=%#"PRIpaddr"\n",
+ banks[i].start, banks[i].size);
+ }
+
+ /* reserve_memory_11(d, &kinfo, &banks[0], i); */
+ BUG();
+ }
rc = prepare_dtb_domU(d, &kinfo);
if ( rc < 0 )
{
struct dt_device_node *node;
const struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
+ u32 direct_map = 0;
BUG_ON(chosen == NULL);
dt_for_each_child_node(chosen, node)
panic("Missing property 'cpus' for domain %s\n",
dt_node_name(node));
- if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") )
+ dt_find_property(node, "direct-map", &direct_map);
+ if ( dt_find_compatible_node(node, NULL, "multiboot,device-tree") &&
+ !direct_map )
d_cfg.flags |= XEN_DOMCTL_CDF_iommu;
+ flags.arch.is_direct_map = direct_map != 0;
if ( !dt_property_read_u32(node, "nr_spis", &d_cfg.arch.nr_spis) )
{