drivers/vfio/vfio_iommu_type1.c
Source file repositories/reference/linux-study-clean/drivers/vfio/vfio_iommu_type1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/vfio/vfio_iommu_type1.c- Extension
.c- Size
- 81252 bytes
- Lines
- 3285
- Domain
- Driver Families
- Bucket
- drivers/vfio
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compat.hlinux/device.hlinux/fs.hlinux/highmem.hlinux/iommu.hlinux/module.hlinux/mm.hlinux/kthread.hlinux/rbtree.hlinux/sched/signal.hlinux/sched/mm.hlinux/slab.hlinux/uaccess.hlinux/vfio.hlinux/workqueue.hlinux/mm_inline.hlinux/overflow.hvfio.h
Detected Declarations
struct vfio_iommustruct vfio_domainstruct vfio_dmastruct vfio_batchstruct vfio_iommu_groupstruct vfio_iovastruct vfio_pfnstruct vfio_regionsfunction vfio_link_dmafunction vfio_unlink_dmafunction vfio_dma_bitmap_allocfunction vfio_dma_bitmap_freefunction vfio_dma_populate_bitmapfunction vfio_iommu_populate_bitmap_fullfunction vfio_dma_bitmap_alloc_allfunction vfio_dma_bitmap_free_allfunction vfio_link_pfnfunction vfio_unlink_pfnfunction vfio_add_to_pfn_listfunction vfio_remove_from_pfn_listfunction vfio_iova_put_vfio_pfnfunction mm_lock_acctfunction vfio_lock_acctfunction is_invalid_reserved_pfnfunction put_pfnfunction __vfio_batch_initfunction vfio_batch_initfunction vfio_batch_init_singlefunction vfio_batch_unpinfunction vfio_batch_finifunction follow_fault_pfnfunction vaddr_get_pfnsfunction vpfn_pagesfunction vfio_pin_pages_remotefunction vaddr_get_pfnsfunction put_valid_unreserved_pfnsfunction vfio_unpin_pages_remotefunction vfio_pin_page_externalfunction vfio_unpin_page_externalfunction vfio_iommu_type1_pin_pagesfunction vfio_iommu_type1_unpin_pagesfunction vfio_sync_unpinfunction list_for_each_entry_safefunction regionsfunction unmap_unpin_slowfunction vfio_unmap_unpinfunction list_for_each_entry_continuefunction vfio_remove_dma
Annotated Snippet
module_init(vfio_iommu_type1_init);
module_exit(vfio_iommu_type1_cleanup);
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
Annotation
- Immediate include surface: `linux/compat.h`, `linux/device.h`, `linux/fs.h`, `linux/highmem.h`, `linux/iommu.h`, `linux/module.h`, `linux/mm.h`, `linux/kthread.h`.
- Detected declarations: `struct vfio_iommu`, `struct vfio_domain`, `struct vfio_dma`, `struct vfio_batch`, `struct vfio_iommu_group`, `struct vfio_iova`, `struct vfio_pfn`, `struct vfio_regions`, `function vfio_link_dma`, `function vfio_unlink_dma`.
- Atlas domain: Driver Families / drivers/vfio.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.