Blame view

include/linux/dma_remapping.h 1.38 KB
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
1
2
3
4
  #ifndef _DMA_REMAPPING_H
  #define _DMA_REMAPPING_H
  
  /*
5b6985ce8   Fenghua Yu   intel-iommu: IA64...
5
   * VT-d hardware uses 4KiB page size regardless of host page size.
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
6
   */
5b6985ce8   Fenghua Yu   intel-iommu: IA64...
7
8
9
10
  #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)
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
11

6dd9a7c73   Youquan Song   intel-iommu: Enab...
12
13
  #define VTD_STRIDE_SHIFT        (9)
  #define VTD_STRIDE_MASK         (((u64)-1) << VTD_STRIDE_SHIFT)
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
14
15
  #define DMA_PTE_READ (1)
  #define DMA_PTE_WRITE (2)
6dd9a7c73   Youquan Song   intel-iommu: Enab...
16
  #define DMA_PTE_LARGE_PAGE (1 << 7)
9cf066974   Sheng Yang   intel-iommu: VT-d...
17
  #define DMA_PTE_SNP (1 << 11)
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
18

4ed0d3e6c   Fenghua Yu   Intel IOMMU Pass ...
19
  #define CONTEXT_TT_MULTI_LEVEL	0
93a23a727   Yu Zhao   VT-d: support the...
20
  #define CONTEXT_TT_DEV_IOTLB	1
4ed0d3e6c   Fenghua Yu   Intel IOMMU Pass ...
21
  #define CONTEXT_TT_PASS_THROUGH 2
2f26e0a9c   David Woodhouse   iommu/vt-d: Add b...
22
23
24
25
  /* Extended context entry types */
  #define CONTEXT_TT_PT_PASID	4
  #define CONTEXT_TT_PT_PASID_DEV_IOTLB 5
  #define CONTEXT_TT_MASK (7ULL << 2)
907fea349   David Woodhouse   iommu/vt-d: Imple...
26
  #define CONTEXT_DINVE		(1ULL << 8)
2f26e0a9c   David Woodhouse   iommu/vt-d: Add b...
27
28
  #define CONTEXT_PRS		(1ULL << 9)
  #define CONTEXT_PASIDE		(1ULL << 11)
4ed0d3e6c   Fenghua Yu   Intel IOMMU Pass ...
29

e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
30
  struct intel_iommu;
99126f7ce   Mark McLoughlin   intel-iommu: move...
31
32
  struct dmar_domain;
  struct root_entry;
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
33

c66b9906f   Ingo Molnar   intel-iommu: fix ...
34

d3f138106   Suresh Siddha   iommu: Rename the...
35
  #ifdef CONFIG_INTEL_IOMMU
1b5736839   Weidong Han   calculate agaw fo...
36
  extern int iommu_calculate_agaw(struct intel_iommu *iommu);
4ed0d3e6c   Fenghua Yu   Intel IOMMU Pass ...
37
  extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
f5d1b97bc   Suresh Siddha   iommu: Cleanup if...
38
  extern int dmar_disabled;
8bc1f85c0   Eugeni Dodonov   iommu: Export int...
39
  extern int intel_iommu_enabled;
c66b9906f   Ingo Molnar   intel-iommu: fix ...
40
41
42
43
44
  #else
  static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
  {
  	return 0;
  }
4ed0d3e6c   Fenghua Yu   Intel IOMMU Pass ...
45
46
47
48
  static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
  {
  	return 0;
  }
f5d1b97bc   Suresh Siddha   iommu: Cleanup if...
49
  #define dmar_disabled	(1)
8bc1f85c0   Eugeni Dodonov   iommu: Export int...
50
  #define intel_iommu_enabled (0)
c66b9906f   Ingo Molnar   intel-iommu: fix ...
51
  #endif
e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
52

2ae210106   Suresh Siddha   x64, x2apic/intr-...
53

e61d98d8d   Suresh Siddha   x64, x2apic/intr-...
54
  #endif