diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-10 07:26:17 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-10 07:26:17 -0500 |
| commit | c20c809f925910737bdb932fe86cfa261a12e559 (patch) | |
| tree | 9bcc454155d4efc894a6e7168bf5fe9222f4ddd7 /include/linux | |
| parent | c4aa8b2a8b63a269d63acafc0358a7b9f5d9e563 (diff) | |
| parent | dcc3c9e37fbd70e728d08cce0e50121605390fa0 (diff) | |
Merge tag 'thunderbolt-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into char-misc-next
Mika writes:
thunderbolt: Changes for v4.21 merge window
* tag 'thunderbolt-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
thunderbolt: Export IOMMU based DMA protection support to userspace
iommu/vt-d: Do not enable ATS for untrusted devices
iommu/vt-d: Force IOMMU on for platform opt in hint
PCI / ACPI: Identify untrusted PCI devices
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dmar.h | 8 | ||||
| -rw-r--r-- | include/linux/pci.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 843a41ba7e28..f8af1d770520 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
| @@ -39,6 +39,7 @@ struct acpi_dmar_header; | |||
| 39 | /* DMAR Flags */ | 39 | /* DMAR Flags */ |
| 40 | #define DMAR_INTR_REMAP 0x1 | 40 | #define DMAR_INTR_REMAP 0x1 |
| 41 | #define DMAR_X2APIC_OPT_OUT 0x2 | 41 | #define DMAR_X2APIC_OPT_OUT 0x2 |
| 42 | #define DMAR_PLATFORM_OPT_IN 0x4 | ||
| 42 | 43 | ||
| 43 | struct intel_iommu; | 44 | struct intel_iommu; |
| 44 | 45 | ||
| @@ -170,6 +171,8 @@ static inline int dmar_ir_hotplug(struct dmar_drhd_unit *dmaru, bool insert) | |||
| 170 | { return 0; } | 171 | { return 0; } |
| 171 | #endif /* CONFIG_IRQ_REMAP */ | 172 | #endif /* CONFIG_IRQ_REMAP */ |
| 172 | 173 | ||
| 174 | extern bool dmar_platform_optin(void); | ||
| 175 | |||
| 173 | #else /* CONFIG_DMAR_TABLE */ | 176 | #else /* CONFIG_DMAR_TABLE */ |
| 174 | 177 | ||
| 175 | static inline int dmar_device_add(void *handle) | 178 | static inline int dmar_device_add(void *handle) |
| @@ -182,6 +185,11 @@ static inline int dmar_device_remove(void *handle) | |||
| 182 | return 0; | 185 | return 0; |
| 183 | } | 186 | } |
| 184 | 187 | ||
| 188 | static inline bool dmar_platform_optin(void) | ||
| 189 | { | ||
| 190 | return false; | ||
| 191 | } | ||
| 192 | |||
| 185 | #endif /* CONFIG_DMAR_TABLE */ | 193 | #endif /* CONFIG_DMAR_TABLE */ |
| 186 | 194 | ||
| 187 | struct irte { | 195 | struct irte { |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 11c71c4ecf75..c786a2f27bee 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -396,6 +396,14 @@ struct pci_dev { | |||
| 396 | unsigned int is_hotplug_bridge:1; | 396 | unsigned int is_hotplug_bridge:1; |
| 397 | unsigned int shpc_managed:1; /* SHPC owned by shpchp */ | 397 | unsigned int shpc_managed:1; /* SHPC owned by shpchp */ |
| 398 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ | 398 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ |
| 399 | /* | ||
| 400 | * Devices marked being untrusted are the ones that can potentially | ||
| 401 | * execute DMA attacks and similar. They are typically connected | ||
| 402 | * through external ports such as Thunderbolt but not limited to | ||
| 403 | * that. When an IOMMU is enabled they should be getting full | ||
| 404 | * mappings to make sure they cannot access arbitrary memory. | ||
| 405 | */ | ||
| 406 | unsigned int untrusted:1; | ||
| 399 | unsigned int __aer_firmware_first_valid:1; | 407 | unsigned int __aer_firmware_first_valid:1; |
| 400 | unsigned int __aer_firmware_first:1; | 408 | unsigned int __aer_firmware_first:1; |
| 401 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ | 409 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ |
