VT-d: cleanup iommu_flush_iotlb_psi and flush_unmaps
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / dma_remapping.h
CommitLineData
e61d98d8
SS
1#ifndef _DMA_REMAPPING_H
2#define _DMA_REMAPPING_H
3
4/*
5b6985ce 5 * VT-d hardware uses 4KiB page size regardless of host page size.
e61d98d8 6 */
5b6985ce
FY
7#define VTD_PAGE_SHIFT (12)
8#define VTD_PAGE_SIZE (1UL << VTD_PAGE_SHIFT)
9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
e61d98d8 11
e61d98d8
SS
12#define DMA_PTE_READ (1)
13#define DMA_PTE_WRITE (2)
9cf06697 14#define DMA_PTE_SNP (1 << 11)
e61d98d8 15
4ed0d3e6
FY
16#define CONTEXT_TT_MULTI_LEVEL 0
17#define CONTEXT_TT_PASS_THROUGH 2
18
e61d98d8 19struct intel_iommu;
99126f7c
MM
20struct dmar_domain;
21struct root_entry;
e61d98d8 22
e61d98d8 23extern void free_dmar_iommu(struct intel_iommu *iommu);
c66b9906
IM
24
25#ifdef CONFIG_DMAR
1b573683 26extern int iommu_calculate_agaw(struct intel_iommu *iommu);
4ed0d3e6 27extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
c66b9906
IM
28#else
29static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
30{
31 return 0;
32}
4ed0d3e6
FY
33static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
34{
35 return 0;
36}
c66b9906 37#endif
e61d98d8 38
2ae21010
SS
39extern int dmar_disabled;
40
e61d98d8 41#endif