diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/dmar.h | 52 | ||||
| -rw-r--r-- | include/linux/intel-iommu.h | 5 | ||||
| -rw-r--r-- | include/linux/mm.h | 3 |
3 files changed, 47 insertions, 13 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index f28440784cf0..2f3427468956 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
| @@ -24,10 +24,10 @@ | |||
| 24 | #include <linux/acpi.h> | 24 | #include <linux/acpi.h> |
| 25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| 26 | #include <linux/msi.h> | 26 | #include <linux/msi.h> |
| 27 | #include <linux/irqreturn.h> | ||
| 27 | 28 | ||
| 28 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | ||
| 29 | struct intel_iommu; | 29 | struct intel_iommu; |
| 30 | 30 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | |
| 31 | struct dmar_drhd_unit { | 31 | struct dmar_drhd_unit { |
| 32 | struct list_head list; /* list of drhd units */ | 32 | struct list_head list; /* list of drhd units */ |
| 33 | struct acpi_dmar_header *hdr; /* ACPI header */ | 33 | struct acpi_dmar_header *hdr; /* ACPI header */ |
| @@ -49,7 +49,7 @@ extern int dmar_dev_scope_init(void); | |||
| 49 | 49 | ||
| 50 | /* Intel IOMMU detection */ | 50 | /* Intel IOMMU detection */ |
| 51 | extern void detect_intel_iommu(void); | 51 | extern void detect_intel_iommu(void); |
| 52 | 52 | extern int enable_drhd_fault_handling(void); | |
| 53 | 53 | ||
| 54 | extern int parse_ioapics_under_ir(void); | 54 | extern int parse_ioapics_under_ir(void); |
| 55 | extern int alloc_iommu(struct dmar_drhd_unit *); | 55 | extern int alloc_iommu(struct dmar_drhd_unit *); |
| @@ -63,12 +63,12 @@ static inline int dmar_table_init(void) | |||
| 63 | { | 63 | { |
| 64 | return -ENODEV; | 64 | return -ENODEV; |
| 65 | } | 65 | } |
| 66 | static inline int enable_drhd_fault_handling(void) | ||
| 67 | { | ||
| 68 | return -1; | ||
| 69 | } | ||
| 66 | #endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ | 70 | #endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ |
| 67 | 71 | ||
| 68 | #ifdef CONFIG_INTR_REMAP | ||
| 69 | extern int intr_remapping_enabled; | ||
| 70 | extern int enable_intr_remapping(int); | ||
| 71 | |||
| 72 | struct irte { | 72 | struct irte { |
| 73 | union { | 73 | union { |
| 74 | struct { | 74 | struct { |
| @@ -97,6 +97,10 @@ struct irte { | |||
| 97 | __u64 high; | 97 | __u64 high; |
| 98 | }; | 98 | }; |
| 99 | }; | 99 | }; |
| 100 | #ifdef CONFIG_INTR_REMAP | ||
| 101 | extern int intr_remapping_enabled; | ||
| 102 | extern int enable_intr_remapping(int); | ||
| 103 | |||
| 100 | extern int get_irte(int irq, struct irte *entry); | 104 | extern int get_irte(int irq, struct irte *entry); |
| 101 | extern int modify_irte(int irq, struct irte *irte_modified); | 105 | extern int modify_irte(int irq, struct irte *irte_modified); |
| 102 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); | 106 | extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); |
| @@ -111,14 +115,40 @@ extern int irq_remapped(int irq); | |||
| 111 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 115 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
| 112 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 116 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
| 113 | #else | 117 | #else |
| 118 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | ||
| 119 | { | ||
| 120 | return -1; | ||
| 121 | } | ||
| 122 | static inline int modify_irte(int irq, struct irte *irte_modified) | ||
| 123 | { | ||
| 124 | return -1; | ||
| 125 | } | ||
| 126 | static inline int free_irte(int irq) | ||
| 127 | { | ||
| 128 | return -1; | ||
| 129 | } | ||
| 130 | static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle) | ||
| 131 | { | ||
| 132 | return -1; | ||
| 133 | } | ||
| 134 | static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, | ||
| 135 | u16 sub_handle) | ||
| 136 | { | ||
| 137 | return -1; | ||
| 138 | } | ||
| 139 | static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) | ||
| 140 | { | ||
| 141 | return NULL; | ||
| 142 | } | ||
| 143 | static inline struct intel_iommu *map_ioapic_to_ir(int apic) | ||
| 144 | { | ||
| 145 | return NULL; | ||
| 146 | } | ||
| 114 | #define irq_remapped(irq) (0) | 147 | #define irq_remapped(irq) (0) |
| 115 | #define enable_intr_remapping(mode) (-1) | 148 | #define enable_intr_remapping(mode) (-1) |
| 116 | #define intr_remapping_enabled (0) | 149 | #define intr_remapping_enabled (0) |
| 117 | #endif | 150 | #endif |
| 118 | 151 | ||
| 119 | #ifdef CONFIG_DMAR | ||
| 120 | extern const char *dmar_get_fault_reason(u8 fault_reason); | ||
| 121 | |||
| 122 | /* Can't use the common MSI interrupt functions | 152 | /* Can't use the common MSI interrupt functions |
| 123 | * since DMAR is not a pci device | 153 | * since DMAR is not a pci device |
| 124 | */ | 154 | */ |
| @@ -127,8 +157,10 @@ extern void dmar_msi_mask(unsigned int irq); | |||
| 127 | extern void dmar_msi_read(int irq, struct msi_msg *msg); | 157 | extern void dmar_msi_read(int irq, struct msi_msg *msg); |
| 128 | extern void dmar_msi_write(int irq, struct msi_msg *msg); | 158 | extern void dmar_msi_write(int irq, struct msi_msg *msg); |
| 129 | extern int dmar_set_interrupt(struct intel_iommu *iommu); | 159 | extern int dmar_set_interrupt(struct intel_iommu *iommu); |
| 160 | extern irqreturn_t dmar_fault(int irq, void *dev_id); | ||
| 130 | extern int arch_setup_dmar_msi(unsigned int irq); | 161 | extern int arch_setup_dmar_msi(unsigned int irq); |
| 131 | 162 | ||
| 163 | #ifdef CONFIG_DMAR | ||
| 132 | extern int iommu_detected, no_iommu; | 164 | extern int iommu_detected, no_iommu; |
| 133 | extern struct list_head dmar_rmrr_units; | 165 | extern struct list_head dmar_rmrr_units; |
| 134 | struct dmar_rmrr_unit { | 166 | struct dmar_rmrr_unit { |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index d2e3cbfba14f..78c1262e8704 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
| @@ -292,6 +292,8 @@ struct intel_iommu { | |||
| 292 | spinlock_t register_lock; /* protect register handling */ | 292 | spinlock_t register_lock; /* protect register handling */ |
| 293 | int seq_id; /* sequence id of the iommu */ | 293 | int seq_id; /* sequence id of the iommu */ |
| 294 | int agaw; /* agaw of this iommu */ | 294 | int agaw; /* agaw of this iommu */ |
| 295 | unsigned int irq; | ||
| 296 | unsigned char name[13]; /* Device Name */ | ||
| 295 | 297 | ||
| 296 | #ifdef CONFIG_DMAR | 298 | #ifdef CONFIG_DMAR |
| 297 | unsigned long *domain_ids; /* bitmap of domains */ | 299 | unsigned long *domain_ids; /* bitmap of domains */ |
| @@ -299,8 +301,6 @@ struct intel_iommu { | |||
| 299 | spinlock_t lock; /* protect context, domain ids */ | 301 | spinlock_t lock; /* protect context, domain ids */ |
| 300 | struct root_entry *root_entry; /* virtual address */ | 302 | struct root_entry *root_entry; /* virtual address */ |
| 301 | 303 | ||
| 302 | unsigned int irq; | ||
| 303 | unsigned char name[7]; /* Device Name */ | ||
| 304 | struct iommu_flush flush; | 304 | struct iommu_flush flush; |
| 305 | #endif | 305 | #endif |
| 306 | struct q_inval *qi; /* Queued invalidation info */ | 306 | struct q_inval *qi; /* Queued invalidation info */ |
| @@ -321,6 +321,7 @@ extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); | |||
| 321 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); | 321 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); |
| 322 | extern void free_iommu(struct intel_iommu *iommu); | 322 | extern void free_iommu(struct intel_iommu *iommu); |
| 323 | extern int dmar_enable_qi(struct intel_iommu *iommu); | 323 | extern int dmar_enable_qi(struct intel_iommu *iommu); |
| 324 | extern void dmar_disable_qi(struct intel_iommu *iommu); | ||
| 324 | extern void qi_global_iec(struct intel_iommu *iommu); | 325 | extern void qi_global_iec(struct intel_iommu *iommu); |
| 325 | 326 | ||
| 326 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, | 327 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 065cdf8c09fb..b1ea37fc7a24 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -104,6 +104,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 104 | #define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */ | 104 | #define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */ |
| 105 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ | 105 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ |
| 106 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ | 106 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ |
| 107 | #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ | ||
| 107 | 108 | ||
| 108 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ | 109 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ |
| 109 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS | 110 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS |
| @@ -145,7 +146,7 @@ extern pgprot_t protection_map[16]; | |||
| 145 | */ | 146 | */ |
| 146 | static inline int is_linear_pfn_mapping(struct vm_area_struct *vma) | 147 | static inline int is_linear_pfn_mapping(struct vm_area_struct *vma) |
| 147 | { | 148 | { |
| 148 | return ((vma->vm_flags & VM_PFNMAP) && vma->vm_pgoff); | 149 | return (vma->vm_flags & VM_PFN_AT_MMAP); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | static inline int is_pfn_mapping(struct vm_area_struct *vma) | 152 | static inline int is_pfn_mapping(struct vm_area_struct *vma) |
