drivers/iommu/intel/iommu.h
Source file repositories/reference/linux-study-clean/drivers/iommu/intel/iommu.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/iommu/intel/iommu.h- Extension
.h- Size
- 43929 bytes
- Lines
- 1400
- Domain
- Driver Families
- Bucket
- drivers/iommu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/iova.hlinux/io.hlinux/idr.hlinux/mmu_notifier.hlinux/list.hlinux/iommu.hlinux/io-64-nonatomic-lo-hi.hlinux/dmar.hlinux/bitfield.hlinux/xarray.hlinux/perf_event.hlinux/pci.hlinux/generic_pt/iommu.hasm/iommu.huapi/linux/iommufd.h
Detected Declarations
struct qi_descstruct q_invalstruct dmar_pci_notify_infostruct irq_domainstruct ir_tablestruct iommu_flushstruct pasid_entrystruct pasid_state_entrystruct page_req_dscstruct root_entrystruct context_entrystruct iommu_domain_infostruct qi_batchstruct dmar_domainstruct iommu_pmustruct intel_iommustruct device_domain_infostruct dev_pasid_infostruct dma_ptestruct cache_tagenum cache_tag_typefunction intel_irq_remap_add_devicefunction __iommu_flush_cachefunction domain_id_iommufunction iommu_domain_didfunction dev_is_real_dma_subdevicefunction dma_pte_addrfunction dma_pte_presentfunction dma_pte_superpagefunction context_presentfunction agaw_to_levelfunction width_to_agawfunction level_to_offset_bitsfunction pfn_level_offsetfunction context_set_presentfunction Presentfunction context_set_fault_enablefunction context_set_translation_typefunction context_set_address_rootfunction context_set_address_widthfunction context_set_domain_idfunction context_set_pasidfunction context_domain_idfunction context_clear_entryfunction context_copiedfunction set_context_copiedfunction clear_context_copiedfunction context_set_sm_rid2pasid
Annotated Snippet
struct qi_desc {
u64 qw0;
u64 qw1;
u64 qw2;
u64 qw3;
};
struct q_inval {
raw_spinlock_t q_lock;
void *desc; /* invalidation queue */
int *desc_status; /* desc status */
int free_head; /* first free entry */
int free_tail; /* last free entry */
int free_cnt;
};
/* Page Request Queue depth */
#define PRQ_ORDER 4
#define PRQ_SIZE (SZ_4K << PRQ_ORDER)
#define PRQ_RING_MASK (PRQ_SIZE - 0x20)
#define PRQ_DEPTH (PRQ_SIZE >> 5)
struct dmar_pci_notify_info;
#ifdef CONFIG_IRQ_REMAP
#define INTR_REMAP_TABLE_REG_SIZE 0xf
#define INTR_REMAP_TABLE_REG_SIZE_MASK 0xf
#define INTR_REMAP_TABLE_ENTRIES 65536
struct irq_domain;
struct ir_table {
struct irte *base;
unsigned long *bitmap;
};
void intel_irq_remap_add_device(struct dmar_pci_notify_info *info);
#else
static inline void
intel_irq_remap_add_device(struct dmar_pci_notify_info *info) { }
#endif
struct iommu_flush {
void (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid,
u8 fm, u64 type);
void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
unsigned int size_order, u64 type);
};
enum {
SR_DMAR_FECTL_REG,
SR_DMAR_FEDATA_REG,
SR_DMAR_FEADDR_REG,
SR_DMAR_FEUADDR_REG,
MAX_SR_DMAR_REGS
};
#define VTD_FLAG_TRANS_PRE_ENABLED (1 << 0)
#define VTD_FLAG_IRQ_REMAP_PRE_ENABLED (1 << 1)
#define VTD_FLAG_SVM_CAPABLE (1 << 2)
#define sm_supported(iommu) (intel_iommu_sm && ecap_smts((iommu)->ecap))
#define pasid_supported(iommu) (sm_supported(iommu) && \
ecap_pasid((iommu)->ecap))
#define ssads_supported(iommu) (sm_supported(iommu) && \
ecap_slads((iommu)->ecap) && \
ecap_smpwc(iommu->ecap))
#define nested_supported(iommu) (sm_supported(iommu) && \
ecap_nest((iommu)->ecap))
struct pasid_entry;
struct pasid_state_entry;
struct page_req_dsc;
/*
* 0: Present
* 1-11: Reserved
* 12-63: Context Ptr (12 - (haw-1))
* 64-127: Reserved
*/
struct root_entry {
u64 lo;
u64 hi;
};
/*
* low 64 bits:
* 0: present
* 1: fault processing disable
Annotation
- Immediate include surface: `linux/types.h`, `linux/iova.h`, `linux/io.h`, `linux/idr.h`, `linux/mmu_notifier.h`, `linux/list.h`, `linux/iommu.h`, `linux/io-64-nonatomic-lo-hi.h`.
- Detected declarations: `struct qi_desc`, `struct q_inval`, `struct dmar_pci_notify_info`, `struct irq_domain`, `struct ir_table`, `struct iommu_flush`, `struct pasid_entry`, `struct pasid_state_entry`, `struct page_req_dsc`, `struct root_entry`.
- Atlas domain: Driver Families / drivers/iommu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.