diff options
author | Yu Zhao <yu.zhao@intel.com> | 2009-05-18 01:51:35 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-05-18 09:45:13 -0400 |
commit | 6ba6c3a4cacfd68bf970e3e04e2ff0d66fa0f695 (patch) | |
tree | 02afc5c010ec841f7e6ad9fc68e8a76f7f18909a /include/linux | |
parent | aa5d2b515b6fca5f8a56eac84f7fa0a68c1ce9b7 (diff) |
VT-d: add device IOTLB invalidation support
Support device IOTLB invalidation to flush the translation cached
in the Endpoint.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/intel-iommu.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 0a1939f200fc..40561b224a17 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ | 53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ |
54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ | 54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ |
55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ | 55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ |
56 | #define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */ | ||
56 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ | 57 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ |
57 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ | 58 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ |
58 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ | 59 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ |
@@ -198,6 +199,8 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) | |||
198 | #define DMA_FSTS_PPF ((u32)2) | 199 | #define DMA_FSTS_PPF ((u32)2) |
199 | #define DMA_FSTS_PFO ((u32)1) | 200 | #define DMA_FSTS_PFO ((u32)1) |
200 | #define DMA_FSTS_IQE (1 << 4) | 201 | #define DMA_FSTS_IQE (1 << 4) |
202 | #define DMA_FSTS_ICE (1 << 5) | ||
203 | #define DMA_FSTS_ITE (1 << 6) | ||
201 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) | 204 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) |
202 | 205 | ||
203 | /* FRCD_REG, 32 bits access */ | 206 | /* FRCD_REG, 32 bits access */ |
@@ -226,7 +229,8 @@ do { \ | |||
226 | enum { | 229 | enum { |
227 | QI_FREE, | 230 | QI_FREE, |
228 | QI_IN_USE, | 231 | QI_IN_USE, |
229 | QI_DONE | 232 | QI_DONE, |
233 | QI_ABORT | ||
230 | }; | 234 | }; |
231 | 235 | ||
232 | #define QI_CC_TYPE 0x1 | 236 | #define QI_CC_TYPE 0x1 |
@@ -255,6 +259,12 @@ enum { | |||
255 | #define QI_CC_DID(did) (((u64)did) << 16) | 259 | #define QI_CC_DID(did) (((u64)did) << 16) |
256 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) | 260 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) |
257 | 261 | ||
262 | #define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32) | ||
263 | #define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16) | ||
264 | #define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK) | ||
265 | #define QI_DEV_IOTLB_SIZE 1 | ||
266 | #define QI_DEV_IOTLB_MAX_INVS 32 | ||
267 | |||
258 | struct qi_desc { | 268 | struct qi_desc { |
259 | u64 low, high; | 269 | u64 low, high; |
260 | }; | 270 | }; |
@@ -344,6 +354,8 @@ extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, | |||
344 | u8 fm, u64 type); | 354 | u8 fm, u64 type); |
345 | extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, | 355 | extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, |
346 | unsigned int size_order, u64 type); | 356 | unsigned int size_order, u64 type); |
357 | extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | ||
358 | u64 addr, unsigned mask); | ||
347 | 359 | ||
348 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 360 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
349 | 361 | ||