qemu-patch-raspberry4/include/hw/i386
Peter Xu 558e0024a4 intel_iommu: allow dynamic switch of IOMMU region
This is preparation work to finally enabled dynamic switching ON/OFF for
VT-d protection. The old VT-d codes is using static IOMMU address space,
and that won't satisfy vfio-pci device listeners.

Let me explain.

vfio-pci devices depend on the memory region listener and IOMMU replay
mechanism to make sure the device mapping is coherent with the guest
even if there are domain switches. And there are two kinds of domain
switches:

  (1) switch from domain A -> B
  (2) switch from domain A -> no domain (e.g., turn DMAR off)

Case (1) is handled by the context entry invalidation handling by the
VT-d replay logic. What the replay function should do here is to replay
the existing page mappings in domain B.

However for case (2), we don't want to replay any domain mappings - we
just need the default GPA->HPA mappings (the address_space_memory
mapping). And this patch helps on case (2) to build up the mapping
automatically by leveraging the vfio-pci memory listeners.

Another important thing that this patch does is to seperate
IR (Interrupt Remapping) from DMAR (DMA Remapping). IR region should not
depend on the DMAR region (like before this patch). It should be a
standalone region, and it should be able to be activated without
DMAR (which is a common behavior of Linux kernel - by default it enables
IR while disabled DMAR).

Reviewed-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: \"Michael S. Tsirkin\" <mst@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <1491562755-23867-9-git-send-email-peterx@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-04-20 15:22:41 -03:00
..
apic-msidef.h q35: ioapic: add support for emulated IOAPIC IR 2016-07-21 20:43:49 +03:00
apic.h apic: move target-dependent definitions to cpu.h 2016-05-19 16:42:28 +02:00
apic_internal.h Revert "apic: save apic_delivered flag" 2017-03-27 14:41:01 +02:00
ich9.h tco: do not generate an NMI 2017-04-05 17:23:52 +02:00
intel_iommu.h intel_iommu: allow dynamic switch of IOMMU region 2017-04-20 15:22:41 -03:00
ioapic.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
ioapic_internal.h x86: ioapic: add support for explicit EOI 2016-08-03 18:44:57 +02:00
pc.h i386: Change stepping of Haswell to non-blacklisted value 2017-03-10 15:01:09 -03:00
topology.h pc: Add x86_topo_ids_from_apicid() 2016-07-20 11:58:44 -03:00
x86-iommu.h intel_iommu: support device iotlb descriptor 2017-01-10 05:56:58 +02:00