diff options
author | Weidong Han <weidong.han@intel.com> | 2009-05-22 12:41:15 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-23 17:09:17 -0400 |
commit | f007e99c8e2e322b8331aba72414715119a2920d (patch) | |
tree | 616bfcdda74341dc8b5d9ea1013bb7506407a961 /include/linux/dmar.h | |
parent | c4658b4e777bebf69884f4884a9bfb2f84dd71d9 (diff) |
Intel-IOMMU, intr-remap: source-id checking
To support domain-isolation usages, the platform hardware must be
capable of uniquely identifying the requestor (source-id) for each
interrupt message. Without source-id checking for interrupt remapping
, a rouge guest/VM with assigned devices can launch interrupt attacks
to bring down anothe guest/VM or the VMM itself.
This patch adds source-id checking for interrupt remapping, and then
really isolates interrupts for guests/VMs with assigned devices.
Because PCI subsystem is not initialized yet when set up IOAPIC
entries, use read_pci_config_byte to access PCI config space directly.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r-- | include/linux/dmar.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 1731fb5fd775..4a2b162c256a 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -126,6 +126,8 @@ extern int free_irte(int irq); | |||
126 | extern int irq_remapped(int irq); | 126 | extern int irq_remapped(int irq); |
127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
129 | extern int set_ioapic_sid(struct irte *irte, int apic); | ||
130 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); | ||
129 | #else | 131 | #else |
130 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | 132 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) |
131 | { | 133 | { |
@@ -156,6 +158,15 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic) | |||
156 | { | 158 | { |
157 | return NULL; | 159 | return NULL; |
158 | } | 160 | } |
161 | static inline int set_ioapic_sid(struct irte *irte, int apic) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | ||
166 | { | ||
167 | return 0; | ||
168 | } | ||
169 | |||
159 | #define irq_remapped(irq) (0) | 170 | #define irq_remapped(irq) (0) |
160 | #define enable_intr_remapping(mode) (-1) | 171 | #define enable_intr_remapping(mode) (-1) |
161 | #define disable_intr_remapping() (0) | 172 | #define disable_intr_remapping() (0) |