intel-iommu: add Intel IOMMU emulation to q35 and add a machine option "iommu" as...
commita52a7fdfa7512c9d095f2d5797c3c423dec43dbc
authorLe Tan <tamlokveer@gmail.com>
Sat, 16 Aug 2014 05:55:40 +0000 (16 13:55 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Aug 2014 21:10:22 +0000 (28 23:10 +0200)
tree3cbf148321f74ed3e8146dffa60111b06f543c22
parentd4eb911935640139eef7f1dd5cf9db7141578554
intel-iommu: add Intel IOMMU emulation to q35 and add a machine option "iommu" as a switch

Add Intel IOMMU emulation to q35 chipset and expose it to the guest.
1. Add a machine option. Users can use "-machine iommu=on|off" in the command
line to enable/disable Intel IOMMU. The default is off.
2. Accroding to the machine option, q35 will initialize the Intel IOMMU and
use pci_setup_iommu() to setup q35_host_dma_iommu() as the IOMMU function for
the pci bus.
3. q35_host_dma_iommu() will return different address space according to the
bus_num and devfn of the device.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/core/machine.c
hw/pci-host/q35.c
include/hw/boards.h
include/hw/pci-host/q35.h
qemu-options.hx
vl.c