]> xenbits.xensource.com Git - xen.git/commit
IOMMU/x86: maintain a per-device pseudo domain ID
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:19:10 +0000 (14:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:19:10 +0000 (14:19 +0200)
commit97af062b89d52c0ecf7af254b53345c97d438e33
tree5102dabf12ea9382da89da27f6825d0bc09b2b86
parent7131163c4806e3c7de24873164d1a003d2a27dee
IOMMU/x86: maintain a per-device pseudo domain ID

In order to subsequently enable per-device quarantine page tables, we'll
need domain-ID-like identifiers to be inserted in the respective device
(AMD) or context (Intel) table entries alongside the per-device page
table root addresses.

Make use of "real" domain IDs occupying only half of the value range
coverable by domid_t.

Note that in VT-d's iommu_alloc() I didn't want to introduce new memory
leaks in case of error, but existing ones don't get plugged - that'll be
the subject of a later change.

The VT-d changes are slightly asymmetric, but this way we can avoid
assigning pseudo domain IDs to devices which would never be mapped while
still avoiding to add a new parameter to domain_context_unmap().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/include/asm/iommu.h
xen/arch/x86/include/asm/pci.h
xen/drivers/passthrough/amd/iommu.h
xen/drivers/passthrough/amd/iommu_detect.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/iommu.h
xen/drivers/passthrough/x86/iommu.c