Direct memory access (DMA)

DMA is a way to do bulk memory operations without undue burden on the CPU. The DMA in Sonata is a simple linear source to destination design. You define a source address, a destination address and number of bytes. The DMA cannot preserve capability tags across the boundary, so any tags will be lost in this process. One thing that is important to consider is that a process without a capability to a piece of memory must not be able to use the DMA as a way to gain access to it. The driver in the operating system must thus enforce that any memory being copied by the DMA is requested by a process that has access to that piece of memory. If a user cannot find a suitable way to perform this security check in software, they can build an image without the DMA engine present.

To make a capability aware DMA is a bit more complicated and beyond the scope of Sonata. There is a position paper available where a number of different approaches are laid out.

OffsetRegister
0x00Source address
0x04Destination address
0x08Byte count
0x0CStatus
0x10Control

Source address

A 32 bit source address.

Destination address

A 32 bit destination address.

Byte count

How many bytes to copy from source to destination, only the lowest 20 bits are used.

Status

Bit offsetDescription
5Write error
4Read error
1Bus error
0Ready

Control

Bit offsetDescription
5Stop
4Disable write
3Disable read
2Write inc
1Read inc
0Request