|
L4Re Operating System Framework
Interface and Usage Documentation
|
If the vBus contains DMA capable devices, uvmm maps the guest RAM into a DMA address space so that those devices can access it. The shape of that DMA address space depends on whether the platform provides an IO-MMU:
If the vBus has no DMA capable devices, no DMA mapping is performed and RAM is placed at the guest-physical address requested by the configuration.
Other components in the system may reserve DMA address ranges. RAM placement within the configured range therefore searches for free DMA addresses and may shift inside the configured range or be split into multiple chunks.
Per memory region, uvmm chooses one of two placement modes:
uvmm uses the dataspace bound to the ram capability with congruent placement. The base address defaults to 0x0 or the value of the -b command-line option. If a DMA address space is in use, the actual base address may be shifted upwards to the first free DMA address at or above the requested base. On a system without IO-MMU this is the host-physical address of the backing dataspace.
If a device tree is loaded, uvmm adds a synthesized memory@<addr> node with the resulting reg value. No dma-ranges property is added.
The memory node needs at least the properties device_type, l4vmm,dscap and reg:
memory@0 {
device_type = "memory";
l4vmm,dscap = "ram";
reg = < ... >;
}
A memory node without a reg property is invalid and uvmm refuses to boot. The given l4vmm,dscap name must be accessible in the capability namespace of the uvmm. If the capability is invalid, the memory node is disabled.
The reg property describes the allowable guest-physical placement range(s) for the dataspace. It is mandatory for explicit memory nodes. uvmm fills the listed reg ranges in order with chunks of the dataspace, potentially using multiple chunks per reg entry if DMA address space reservations require it. A reg entry with size == 0 means "use the remaining dataspace size". After setup, uvmm rewrites the reg property to reflect the actual placement(s) used.
If the listed reg ranges cannot accommodate the full dataspace, uvmm emits a warning and stops mapping; the guest sees only the portion that fitted.
The optional dma-ranges property, if present, switches the memory node to incongruent placement (see above). uvmm fills it with the resulting DMA mappings.
If memory nodes are given, but none provides valid RAM, the configuration is invalid and uvmm refuses to boot.