aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2019-06-03 08:53:35 +0200
committerJoerg Roedel <jroedel@suse.de>2019-06-12 10:32:59 +0200
commitadfd373820906d376c8b643f1a279ac809605b6b (patch)
treeecaadb04a63c42c12eabba2e4b54ba4e6e4320d8 /include/linux/iommu.h
parentiommu/vt-d: Handle PCI bridge RMRR device scopes in intel_iommu_get_resv_regions (diff)
downloadwireguard-linux-adfd373820906d376c8b643f1a279ac809605b6b.tar.xz
wireguard-linux-adfd373820906d376c8b643f1a279ac809605b6b.zip
iommu: Introduce IOMMU_RESV_DIRECT_RELAXABLE reserved memory regions
Introduce a new type for reserved region. This corresponds to directly mapped regions which are known to be relaxable in some specific conditions, such as device assignment use case. Well known examples are those used by USB controllers providing PS/2 keyboard emulation for pre-boot BIOS and early BOOT or RMRRs associated to IGD working in legacy mode. Since commit c875d2c1b808 ("iommu/vt-d: Exclude devices using RMRRs from IOMMU API domains") and commit 18436afdc11a ("iommu/vt-d: Allow RMRR on graphics devices too"), those regions are currently considered "safe" with respect to device assignment use case which requires a non direct mapping at IOMMU physical level (RAM GPA -> HPA mapping). Those RMRRs currently exist and sometimes the device is attempting to access it but this has not been considered an issue until now. However at the moment, iommu_get_group_resv_regions() is not able to make any difference between directly mapped regions: those which must be absolutely enforced and those like above ones which are known as relaxable. This is a blocker for reporting severe conflicts between non relaxable RMRRs (like MSI doorbells) and guest GPA space. With this new reserved region type we will be able to use iommu_get_group_resv_regions() to enumerate the IOVA space that is usable through the IOMMU API without introducing regressions with respect to existing device assignment use cases (USB and IGD). Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 91af22a344e2..ab7a1c85af75 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -135,6 +135,12 @@ enum iommu_attr {
enum iommu_resv_type {
/* Memory regions which must be mapped 1:1 at all times */
IOMMU_RESV_DIRECT,
+ /*
+ * Memory regions which are advertised to be 1:1 but are
+ * commonly considered relaxable in some conditions,
+ * for instance in device assignment use case (USB, Graphics)
+ */
+ IOMMU_RESV_DIRECT_RELAXABLE,
/* Arbitrary "never map this or give it to a device" address ranges */
IOMMU_RESV_RESERVED,
/* Hardware MSI region (untranslated) */