2008-07-10 18:16:35 +00:00
|
|
|
#ifndef _DMA_REMAPPING_H
|
|
|
|
#define _DMA_REMAPPING_H
|
|
|
|
|
|
|
|
/*
|
2008-10-17 01:02:32 +00:00
|
|
|
* VT-d hardware uses 4KiB page size regardless of host page size.
|
2008-07-10 18:16:35 +00:00
|
|
|
*/
|
2008-10-17 01:02:32 +00:00
|
|
|
#define VTD_PAGE_SHIFT (12)
|
|
|
|
#define VTD_PAGE_SIZE (1UL << VTD_PAGE_SHIFT)
|
|
|
|
#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
|
|
|
|
#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
|
2008-07-10 18:16:35 +00:00
|
|
|
|
|
|
|
#define DMA_PTE_READ (1)
|
|
|
|
#define DMA_PTE_WRITE (2)
|
2009-03-18 07:33:07 +00:00
|
|
|
#define DMA_PTE_SNP (1 << 11)
|
2008-07-10 18:16:35 +00:00
|
|
|
|
2009-04-25 00:30:20 +00:00
|
|
|
#define CONTEXT_TT_MULTI_LEVEL 0
|
2009-05-18 05:51:37 +00:00
|
|
|
#define CONTEXT_TT_DEV_IOTLB 1
|
2009-04-25 00:30:20 +00:00
|
|
|
#define CONTEXT_TT_PASS_THROUGH 2
|
|
|
|
|
2008-07-10 18:16:35 +00:00
|
|
|
struct intel_iommu;
|
2008-11-20 15:49:47 +00:00
|
|
|
struct dmar_domain;
|
|
|
|
struct root_entry;
|
2008-07-10 18:16:35 +00:00
|
|
|
|
|
|
|
extern void free_dmar_iommu(struct intel_iommu *iommu);
|
2009-01-04 09:55:02 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_DMAR
|
2008-12-08 07:34:06 +00:00
|
|
|
extern int iommu_calculate_agaw(struct intel_iommu *iommu);
|
2009-04-25 00:30:20 +00:00
|
|
|
extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
|
2009-01-04 09:55:02 +00:00
|
|
|
#else
|
|
|
|
static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2009-04-25 00:30:20 +00:00
|
|
|
static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2009-01-04 09:55:02 +00:00
|
|
|
#endif
|
2008-07-10 18:16:35 +00:00
|
|
|
|
2008-07-10 18:16:43 +00:00
|
|
|
extern int dmar_disabled;
|
|
|
|
|
2008-07-10 18:16:35 +00:00
|
|
|
#endif
|