From a52a7fdfa7512c9d095f2d5797c3c423dec43dbc Mon Sep 17 00:00:00 2001 From: Le Tan Date: Sat, 16 Aug 2014 13:55:40 +0800 Subject: 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- vl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index b796c67e9d..cca012a7de 100644 --- a/vl.c +++ b/vl.c @@ -388,6 +388,10 @@ static QemuOptsList qemu_machine_opts = { .name = PC_MACHINE_MAX_RAM_BELOW_4G, .type = QEMU_OPT_SIZE, .help = "maximum ram below the 4G boundary (32bit boundary)", + },{ + .name = "iommu", + .type = QEMU_OPT_BOOL, + .help = "Set on/off to enable/disable Intel IOMMU (VT-d)", }, { /* End of list */ } }, -- cgit v1.2.1