mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
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>
This commit is contained in:
parent
d4eb911935
commit
a52a7fdfa7
6 changed files with 74 additions and 1 deletions
|
@ -123,6 +123,7 @@ struct MachineState {
|
|||
bool mem_merge;
|
||||
bool usb;
|
||||
char *firmware;
|
||||
bool iommu;
|
||||
|
||||
ram_addr_t ram_size;
|
||||
ram_addr_t maxram_size;
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "hw/acpi/acpi.h"
|
||||
#include "hw/acpi/ich9.h"
|
||||
#include "hw/pci-host/pam.h"
|
||||
#include "hw/i386/intel_iommu.h"
|
||||
|
||||
#define TYPE_Q35_HOST_DEVICE "q35-pcihost"
|
||||
#define Q35_HOST_DEVICE(obj) \
|
||||
|
@ -60,6 +61,7 @@ typedef struct MCHPCIState {
|
|||
uint64_t pci_hole64_size;
|
||||
PcGuestInfo *guest_info;
|
||||
uint32_t short_root_bus;
|
||||
IntelIOMMUState *iommu;
|
||||
} MCHPCIState;
|
||||
|
||||
typedef struct Q35PCIHost {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue