drivers/iommu/s390-iommu.c
Source file repositories/reference/linux-study-clean/drivers/iommu/s390-iommu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iommu/s390-iommu.c- Extension
.c- Size
- 28889 bytes
- Lines
- 1198
- Domain
- Driver Families
- Bucket
- drivers/iommu
- 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.
- 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/pci.hlinux/iommu.hlinux/iommu-helper.hlinux/sizes.hlinux/rculist.hlinux/rcupdate.hasm/pci_dma.hdma-iommu.h
Detected Declarations
struct s390_domainfunction calc_rfxfunction calc_rsxfunction calc_rtxfunction calc_sxfunction calc_pxfunction set_pt_pfaafunction set_rf_rsofunction set_rs_rtofunction set_rt_stofunction set_st_ptofunction validate_rf_entryfunction validate_rs_entryfunction validate_rt_entryfunction validate_st_entryfunction invalidate_pt_entryfunction validate_pt_entryfunction entry_set_protectedfunction entry_clr_protectedfunction reg_entry_isvalidfunction pt_entry_isvalidfunction dma_alloc_cpu_table_cachesfunction dma_free_cpu_tablefunction dma_free_page_tablefunction dma_free_seg_tablefunction dma_free_rt_tablefunction dma_free_rs_tablefunction dma_cleanup_tablesfunction dma_update_cpu_transfunction s390_iommu_capablefunction max_tbl_sizefunction s390_iommu_rcu_free_domainfunction s390_domain_freefunction zdev_s390_domain_updatefunction get_iota_region_flagfunction reg_ioat_propagate_errorfunction s390_iommu_domain_reg_ioatfunction zpci_iommu_register_ioatfunction blocking_domain_attach_devicefunction s390_iommu_attach_devicefunction s390_iommu_get_resv_regionsfunction zpci_refresh_allfunction s390_iommu_flush_iotlb_allfunction s390_iommu_iotlb_syncfunction s390_iommu_iotlb_sync_mapfunction s390_iommu_validate_transfunction s390_iommu_invalidate_transfunction s390_iommu_map_pages
Annotated Snippet
subsys_initcall(s390_iommu_init);
static int s390_attach_dev_identity(struct iommu_domain *domain,
struct device *dev,
struct iommu_domain *old)
{
struct zpci_dev *zdev = to_zpci_dev(dev);
u8 status;
int cc;
blocking_domain_attach_device(&blocking_domain, dev, old);
/* If we fail now DMA remains blocked via blocking domain */
cc = s390_iommu_domain_reg_ioat(zdev, domain, &status);
if (reg_ioat_propagate_error(cc, status))
return -EIO;
zdev_s390_domain_update(zdev, domain);
return 0;
}
static const struct iommu_domain_ops s390_identity_ops = {
.attach_dev = s390_attach_dev_identity,
};
static struct iommu_domain s390_identity_domain = {
.type = IOMMU_DOMAIN_IDENTITY,
.ops = &s390_identity_ops,
};
static struct iommu_domain blocking_domain = {
.type = IOMMU_DOMAIN_BLOCKED,
.ops = &(const struct iommu_domain_ops) {
.attach_dev = blocking_domain_attach_device,
}
};
#define S390_IOMMU_COMMON_OPS() \
.blocked_domain = &blocking_domain, \
.release_domain = &blocking_domain, \
.capable = s390_iommu_capable, \
.domain_alloc_paging = s390_domain_alloc_paging, \
.probe_device = s390_iommu_probe_device, \
.device_group = generic_device_group, \
.get_resv_regions = s390_iommu_get_resv_regions, \
.default_domain_ops = &(const struct iommu_domain_ops) { \
.attach_dev = s390_iommu_attach_device, \
.map_pages = s390_iommu_map_pages, \
.unmap_pages = s390_iommu_unmap_pages, \
.flush_iotlb_all = s390_iommu_flush_iotlb_all, \
.iotlb_sync = s390_iommu_iotlb_sync, \
.iotlb_sync_map = s390_iommu_iotlb_sync_map, \
.iova_to_phys = s390_iommu_iova_to_phys, \
.free = s390_domain_free, \
}
static const struct iommu_ops s390_iommu_ops = {
S390_IOMMU_COMMON_OPS()
};
static const struct iommu_ops s390_iommu_rtr_ops = {
.identity_domain = &s390_identity_domain,
S390_IOMMU_COMMON_OPS()
};
Annotation
- Immediate include surface: `linux/pci.h`, `linux/iommu.h`, `linux/iommu-helper.h`, `linux/sizes.h`, `linux/rculist.h`, `linux/rcupdate.h`, `asm/pci_dma.h`, `dma-iommu.h`.
- Detected declarations: `struct s390_domain`, `function calc_rfx`, `function calc_rsx`, `function calc_rtx`, `function calc_sx`, `function calc_px`, `function set_pt_pfaa`, `function set_rf_rso`, `function set_rs_rto`, `function set_rt_sto`.
- Atlas domain: Driver Families / drivers/iommu.
- Implementation status: integration implementation candidate.
- 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.