diff options
author | Fenghua Yu <fenghua.yu@intel.com> | 2009-03-27 17:22:42 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-04-03 16:45:54 -0400 |
commit | f59c7b69bcba31cd355ababe067202b9895d6102 (patch) | |
tree | 4f06ceb6ab9a135acd9b316c806aaa99c097b373 /include | |
parent | 8f912ba4d7cdaf7d31cf39fe5a9b7732308a256d (diff) |
Intel IOMMU Suspend/Resume Support - DMAR
This patch implements the suspend and resume feature for Intel IOMMU
DMAR. It hooks to kernel suspend and resume interface. When suspend happens, it
saves necessary hardware registers. When resume happens, it restores the
registers and restarts IOMMU by enabling translation, setting up root entry, and
re-enabling queued invalidation.
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/intel-iommu.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 77214ead1a36..3771cd1f876e 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -284,6 +284,14 @@ struct iommu_flush { | |||
284 | unsigned int size_order, u64 type, int non_present_entry_flush); | 284 | unsigned int size_order, u64 type, int non_present_entry_flush); |
285 | }; | 285 | }; |
286 | 286 | ||
287 | enum { | ||
288 | SR_DMAR_FECTL_REG, | ||
289 | SR_DMAR_FEDATA_REG, | ||
290 | SR_DMAR_FEADDR_REG, | ||
291 | SR_DMAR_FEUADDR_REG, | ||
292 | MAX_SR_DMAR_REGS | ||
293 | }; | ||
294 | |||
287 | struct intel_iommu { | 295 | struct intel_iommu { |
288 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ | 296 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ |
289 | u64 cap; | 297 | u64 cap; |
@@ -304,6 +312,8 @@ struct intel_iommu { | |||
304 | struct iommu_flush flush; | 312 | struct iommu_flush flush; |
305 | #endif | 313 | #endif |
306 | struct q_inval *qi; /* Queued invalidation info */ | 314 | struct q_inval *qi; /* Queued invalidation info */ |
315 | u32 *iommu_state; /* Store iommu states between suspend and resume.*/ | ||
316 | |||
307 | #ifdef CONFIG_INTR_REMAP | 317 | #ifdef CONFIG_INTR_REMAP |
308 | struct ir_table *ir_table; /* Interrupt remapping info */ | 318 | struct ir_table *ir_table; /* Interrupt remapping info */ |
309 | #endif | 319 | #endif |
@@ -322,6 +332,7 @@ extern int alloc_iommu(struct dmar_drhd_unit *drhd); | |||
322 | extern void free_iommu(struct intel_iommu *iommu); | 332 | extern void free_iommu(struct intel_iommu *iommu); |
323 | extern int dmar_enable_qi(struct intel_iommu *iommu); | 333 | extern int dmar_enable_qi(struct intel_iommu *iommu); |
324 | extern void dmar_disable_qi(struct intel_iommu *iommu); | 334 | extern void dmar_disable_qi(struct intel_iommu *iommu); |
335 | extern int dmar_reenable_qi(struct intel_iommu *iommu); | ||
325 | extern void qi_global_iec(struct intel_iommu *iommu); | 336 | extern void qi_global_iec(struct intel_iommu *iommu); |
326 | 337 | ||
327 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, | 338 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, |