Driver Domain

From Xen
Revision as of 19:07, 13 November 2011 by (talk) (Created page with "<!-- MoinMoin name: DriverDomain --> <!-- Comment: --> <!-- WikiMedia name: DriverDomain --> <!-- Page revision: 00000007 --> <!-- Original date: Tue Jun 1 08:52:42 2…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Icon todo.png Needs Refactor

This document contains glossary and howto elements, which would better be separated out (but linked to)

Xen Driver Domain

A driver domain is unprivileged Xen domain that has been given responsibility for a particular piece of hardware. It runs a minimal kernel with only that hardware driver and the backend driver for that device class. Thus, if the hardware driver fails, the other domains (including Dom0) will survive and, when the driver domain is restarted, will be able to use the hardware again.


  • Performance: eliminate the dom0 bottleneck. All device backend in dom0 will result dom0 to have bad response latency.
  • Enhanced security: Hardware drivers are the most failure-prone part of an operating system. It would be good for safety if you could isolate a driver from the rest of the system so that, when it failed, it could just be restarted without affecting the rest of the machine.


Software requirements of the driver domain:

  • The passthroughed hardware driver.
  • The backend driver.
  • The hotplug scripts.

However, PCI passthrough is optional. For example, you can setup a driver domain just doing the network package filtering, but pass the packages to dom0 for transfer.

To passthrough a device to a domain, see:

To start using the driver domain as block device backend:

# xm block-attach <Domain> file:/disks/disk1.img xvdc w <DriverDomain>

The xenstore entries looks like:



Due to architectural limitations of most PC hardware, driver domains with direct hardware access cannot be done securely. In effect, any domain that has direct hardware access has to be considered “trusted”.

The reason why is that all IO is done in physical addresses.

Consider the following case:

  • domain A is mapped in 0-2GB of physical memory
  • domain B is mapped in 2-4GB of physical memory
  • domain A has direct access to a PCI NIC
  • domain A programs the NIC to DMA in the 2-4GB physical memory range, overwriting domain B’s memory. Ooops!

The solution is a hardware unit known as an “IOMMU” (IO Memory Management Unit)