/Linux-v6.1/drivers/iommu/amd/ |
D | init.c | 236 bool translation_pre_enabled(struct amd_iommu *iommu) in translation_pre_enabled() argument 238 return (iommu->flags & AMD_IOMMU_FLAG_TRANS_PRE_ENABLED); in translation_pre_enabled() 241 static void clear_translation_pre_enabled(struct amd_iommu *iommu) in clear_translation_pre_enabled() argument 243 iommu->flags &= ~AMD_IOMMU_FLAG_TRANS_PRE_ENABLED; in clear_translation_pre_enabled() 246 static void init_translation_status(struct amd_iommu *iommu) in init_translation_status() argument 250 ctrl = readq(iommu->mmio_base + MMIO_CONTROL_OFFSET); in init_translation_status() 252 iommu->flags |= AMD_IOMMU_FLAG_TRANS_PRE_ENABLED; in init_translation_status() 274 struct amd_iommu *iommu; in get_global_efr() local 276 for_each_iommu(iommu) { in get_global_efr() 277 u64 tmp = iommu->features; in get_global_efr() [all …]
|
D | iommu.c | 122 struct dev_table_entry *get_dev_table(struct amd_iommu *iommu) in get_dev_table() argument 125 struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; in get_dev_table() 152 void amd_iommu_set_rlookup_table(struct amd_iommu *iommu, u16 devid) in amd_iommu_set_rlookup_table() argument 154 struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; in amd_iommu_set_rlookup_table() 156 pci_seg->rlookup_table[devid] = iommu; in amd_iommu_set_rlookup_table() 185 static struct iommu_dev_data *alloc_dev_data(struct amd_iommu *iommu, u16 devid) in alloc_dev_data() argument 188 struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; in alloc_dev_data() 202 static struct iommu_dev_data *search_dev_data(struct amd_iommu *iommu, u16 devid) in search_dev_data() argument 206 struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; in search_dev_data() 222 struct amd_iommu *iommu; in clone_alias() local [all …]
|
/Linux-v6.1/drivers/iommu/ |
D | sun50i-iommu.c | 96 struct iommu_device iommu; member 121 struct sun50i_iommu *iommu; member 134 static u32 iommu_read(struct sun50i_iommu *iommu, u32 offset) in iommu_read() argument 136 return readl(iommu->base + offset); in iommu_read() 139 static void iommu_write(struct sun50i_iommu *iommu, u32 offset, u32 value) in iommu_write() argument 141 writel(value, iommu->base + offset); in iommu_write() 290 struct sun50i_iommu *iommu = sun50i_domain->iommu; in sun50i_table_flush() local 294 dma_sync_single_for_device(iommu->dev, dma, size, DMA_TO_DEVICE); in sun50i_table_flush() 297 static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu) in sun50i_iommu_flush_all_tlb() argument 302 assert_spin_locked(&iommu->iommu_lock); in sun50i_iommu_flush_all_tlb() [all …]
|
D | msm_iommu.c | 54 static int __enable_clocks(struct msm_iommu_dev *iommu) in __enable_clocks() argument 58 ret = clk_enable(iommu->pclk); in __enable_clocks() 62 if (iommu->clk) { in __enable_clocks() 63 ret = clk_enable(iommu->clk); in __enable_clocks() 65 clk_disable(iommu->pclk); in __enable_clocks() 71 static void __disable_clocks(struct msm_iommu_dev *iommu) in __disable_clocks() argument 73 if (iommu->clk) in __disable_clocks() 74 clk_disable(iommu->clk); in __disable_clocks() 75 clk_disable(iommu->pclk); in __disable_clocks() 120 struct msm_iommu_dev *iommu = NULL; in __flush_iotlb() local [all …]
|
D | rockchip-iommu.c | 114 struct iommu_device iommu; member 122 struct rk_iommu *iommu; member 347 static void rk_iommu_command(struct rk_iommu *iommu, u32 command) in rk_iommu_command() argument 351 for (i = 0; i < iommu->num_mmu; i++) in rk_iommu_command() 352 writel(command, iommu->bases[i] + RK_MMU_COMMAND); in rk_iommu_command() 359 static void rk_iommu_zap_lines(struct rk_iommu *iommu, dma_addr_t iova_start, in rk_iommu_zap_lines() argument 368 for (i = 0; i < iommu->num_mmu; i++) { in rk_iommu_zap_lines() 372 rk_iommu_write(iommu->bases[i], RK_MMU_ZAP_ONE_LINE, iova); in rk_iommu_zap_lines() 376 static bool rk_iommu_is_stall_active(struct rk_iommu *iommu) in rk_iommu_is_stall_active() argument 381 for (i = 0; i < iommu->num_mmu; i++) in rk_iommu_is_stall_active() [all …]
|
D | iommu-sysfs.c | 54 int iommu_device_sysfs_add(struct iommu_device *iommu, in iommu_device_sysfs_add() argument 62 iommu->dev = kzalloc(sizeof(*iommu->dev), GFP_KERNEL); in iommu_device_sysfs_add() 63 if (!iommu->dev) in iommu_device_sysfs_add() 66 device_initialize(iommu->dev); in iommu_device_sysfs_add() 68 iommu->dev->class = &iommu_class; in iommu_device_sysfs_add() 69 iommu->dev->parent = parent; in iommu_device_sysfs_add() 70 iommu->dev->groups = groups; in iommu_device_sysfs_add() 73 ret = kobject_set_name_vargs(&iommu->dev->kobj, fmt, vargs); in iommu_device_sysfs_add() 78 ret = device_add(iommu->dev); in iommu_device_sysfs_add() 82 dev_set_drvdata(iommu->dev, iommu); in iommu_device_sysfs_add() [all …]
|
D | Makefile | 3 obj-$(CONFIG_IOMMU_API) += iommu.o 4 obj-$(CONFIG_IOMMU_API) += iommu-traces.o 5 obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o 6 obj-$(CONFIG_IOMMU_DEBUGFS) += iommu-debugfs.o 7 obj-$(CONFIG_IOMMU_DMA) += dma-iommu.o 20 obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o 21 obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o 22 obj-$(CONFIG_ROCKCHIP_IOMMU) += rockchip-iommu.o 23 obj-$(CONFIG_SUN50I_IOMMU) += sun50i-iommu.o 26 obj-$(CONFIG_EXYNOS_IOMMU) += exynos-iommu.o [all …]
|
/Linux-v6.1/arch/sparc/kernel/ |
D | iommu.c | 52 struct iommu *iommu = container_of(iommu_map_table, struct iommu, tbl); in iommu_flushall() local 53 if (iommu->iommu_flushinv) { in iommu_flushall() 54 iommu_write(iommu->iommu_flushinv, ~(u64)0); in iommu_flushall() 59 tag = iommu->iommu_tags; in iommu_flushall() 66 (void) iommu_read(iommu->write_complete_reg); in iommu_flushall() 80 #define IOPTE_IS_DUMMY(iommu, iopte) \ argument 81 ((iopte_val(*iopte) & IOPTE_PAGE) == (iommu)->dummy_page_pa) 83 static inline void iopte_make_dummy(struct iommu *iommu, iopte_t *iopte) in iopte_make_dummy() argument 88 val |= iommu->dummy_page_pa; in iopte_make_dummy() 93 int iommu_table_init(struct iommu *iommu, int tsbsize, in iommu_table_init() argument [all …]
|
D | iommu-common.c | 19 static inline bool need_flush(struct iommu_map_table *iommu) in need_flush() argument 21 return ((iommu->flags & IOMMU_NEED_FLUSH) != 0); in need_flush() 24 static inline void set_flush(struct iommu_map_table *iommu) in set_flush() argument 26 iommu->flags |= IOMMU_NEED_FLUSH; in set_flush() 29 static inline void clear_flush(struct iommu_map_table *iommu) in clear_flush() argument 31 iommu->flags &= ~IOMMU_NEED_FLUSH; in clear_flush() 52 void iommu_tbl_pool_init(struct iommu_map_table *iommu, in iommu_tbl_pool_init() argument 60 struct iommu_pool *p = &(iommu->large_pool); in iommu_tbl_pool_init() 64 iommu->nr_pools = IOMMU_NR_POOLS; in iommu_tbl_pool_init() 66 iommu->nr_pools = npools; in iommu_tbl_pool_init() [all …]
|
D | sbus.c | 62 struct iommu *iommu = dev->archdata.iommu; in sbus_set_sbus64() local 77 cfg_reg = iommu->write_complete_reg; in sbus_set_sbus64() 212 struct iommu *iommu = op->dev.archdata.iommu; in sbus_build_irq() local 213 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sbus_build_irq() 274 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ue_handler() local 275 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ue_handler() 348 struct iommu *iommu = op->dev.archdata.iommu; in sysio_ce_handler() local 349 unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_ce_handler() 427 struct iommu *iommu = op->dev.archdata.iommu; in sysio_sbus_error_handler() local 432 reg_base = iommu->write_complete_reg - 0x2000UL; in sysio_sbus_error_handler() [all …]
|
/Linux-v6.1/drivers/iommu/intel/ |
D | irq_remapping.c | 33 struct intel_iommu *iommu; member 40 struct intel_iommu *iommu; member 47 struct intel_iommu *iommu; member 83 static void iommu_disable_irq_remapping(struct intel_iommu *iommu); 86 static bool ir_pre_enabled(struct intel_iommu *iommu) in ir_pre_enabled() argument 88 return (iommu->flags & VTD_FLAG_IRQ_REMAP_PRE_ENABLED); in ir_pre_enabled() 91 static void clear_ir_pre_enabled(struct intel_iommu *iommu) in clear_ir_pre_enabled() argument 93 iommu->flags &= ~VTD_FLAG_IRQ_REMAP_PRE_ENABLED; in clear_ir_pre_enabled() 96 static void init_ir_status(struct intel_iommu *iommu) in init_ir_status() argument 100 gsts = readl(iommu->reg + DMAR_GSTS_REG); in init_ir_status() [all …]
|
D | iommu.c | 218 static inline bool context_copied(struct intel_iommu *iommu, u8 bus, u8 devfn) in context_copied() argument 220 if (!iommu->copied_tables) in context_copied() 223 return test_bit(((long)bus << 8) | devfn, iommu->copied_tables); in context_copied() 227 set_context_copied(struct intel_iommu *iommu, u8 bus, u8 devfn) in set_context_copied() argument 229 set_bit(((long)bus << 8) | devfn, iommu->copied_tables); in set_context_copied() 233 clear_context_copied(struct intel_iommu *iommu, u8 bus, u8 devfn) in clear_context_copied() argument 235 clear_bit(((long)bus << 8) | devfn, iommu->copied_tables); in clear_context_copied() 268 struct intel_iommu *iommu; /* the corresponding iommu */ member 298 static bool translation_pre_enabled(struct intel_iommu *iommu) in translation_pre_enabled() argument 300 return (iommu->flags & VTD_FLAG_TRANS_PRE_ENABLED); in translation_pre_enabled() [all …]
|
D | dmar.c | 66 static void free_iommu(struct intel_iommu *iommu); 459 if (dmaru->iommu) in dmar_free_drhd() 460 free_iommu(dmaru->iommu); in dmar_free_drhd() 499 drhd->iommu->node = node; in dmar_parse_one_rhsa() 937 x86_init.iommu.iommu_init = intel_iommu_init; in detect_intel_iommu() 950 static void unmap_iommu(struct intel_iommu *iommu) in unmap_iommu() argument 952 iounmap(iommu->reg); in unmap_iommu() 953 release_mem_region(iommu->reg_phys, iommu->reg_size); in unmap_iommu() 964 static int map_iommu(struct intel_iommu *iommu, u64 phys_addr) in map_iommu() argument 968 iommu->reg_phys = phys_addr; in map_iommu() [all …]
|
D | cap_audit.c | 75 static int cap_audit_hotplug(struct intel_iommu *iommu, enum cap_audit_type type) in cap_audit_hotplug() argument 82 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, pi_support, CAP_PI_MASK); in cap_audit_hotplug() 83 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, ecap, eim_support, ECAP_EIM_MASK); in cap_audit_hotplug() 87 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, fl5lp_support, CAP_FL5LP_MASK); in cap_audit_hotplug() 88 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, fl1gp_support, CAP_FL1GP_MASK); in cap_audit_hotplug() 89 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, read_drain, CAP_RD_MASK); in cap_audit_hotplug() 90 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, write_drain, CAP_WD_MASK); in cap_audit_hotplug() 91 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, pgsel_inv, CAP_PSI_MASK); in cap_audit_hotplug() 92 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, zlr, CAP_ZLR_MASK); in cap_audit_hotplug() 93 CHECK_FEATURE_MISMATCH_HOTPLUG(iommu, cap, caching_mode, CAP_CM_MASK); in cap_audit_hotplug() [all …]
|
D | pasid.c | 29 int vcmd_alloc_pasid(struct intel_iommu *iommu, u32 *pasid) in vcmd_alloc_pasid() argument 36 raw_spin_lock_irqsave(&iommu->register_lock, flags); in vcmd_alloc_pasid() 37 dmar_writeq(iommu->reg + DMAR_VCMD_REG, VCMD_CMD_ALLOC); in vcmd_alloc_pasid() 38 IOMMU_WAIT_OP(iommu, DMAR_VCRSP_REG, dmar_readq, in vcmd_alloc_pasid() 40 raw_spin_unlock_irqrestore(&iommu->register_lock, flags); in vcmd_alloc_pasid() 48 pr_info("IOMMU: %s: No PASID available\n", iommu->name); in vcmd_alloc_pasid() 54 iommu->name, status_code); in vcmd_alloc_pasid() 60 void vcmd_free_pasid(struct intel_iommu *iommu, u32 pasid) in vcmd_free_pasid() argument 66 raw_spin_lock_irqsave(&iommu->register_lock, flags); in vcmd_free_pasid() 67 dmar_writeq(iommu->reg + DMAR_VCMD_REG, in vcmd_free_pasid() [all …]
|
D | svm.c | 68 int intel_svm_enable_prq(struct intel_iommu *iommu) in intel_svm_enable_prq() argument 77 iommu->name); in intel_svm_enable_prq() 80 iommu->prq = page_address(pages); in intel_svm_enable_prq() 82 irq = dmar_alloc_hwirq(DMAR_UNITS_SUPPORTED + iommu->seq_id, iommu->node, iommu); in intel_svm_enable_prq() 85 iommu->name); in intel_svm_enable_prq() 89 iommu->pr_irq = irq; in intel_svm_enable_prq() 91 snprintf(iommu->iopfq_name, sizeof(iommu->iopfq_name), in intel_svm_enable_prq() 92 "dmar%d-iopfq", iommu->seq_id); in intel_svm_enable_prq() 93 iopfq = iopf_queue_alloc(iommu->iopfq_name); in intel_svm_enable_prq() 95 pr_err("IOMMU: %s: Failed to allocate iopf queue\n", iommu->name); in intel_svm_enable_prq() [all …]
|
D | debugfs.c | 117 struct intel_iommu *iommu; in iommu_regset_show() local 123 for_each_active_iommu(iommu, drhd) { in iommu_regset_show() 131 iommu->name, drhd->reg_base_addr); in iommu_regset_show() 137 raw_spin_lock_irqsave(&iommu->register_lock, flag); in iommu_regset_show() 139 value = dmar_readl(iommu->reg + iommu_regs_32[i].offset); in iommu_regset_show() 145 value = dmar_readq(iommu->reg + iommu_regs_64[i].offset); in iommu_regset_show() 150 raw_spin_unlock_irqrestore(&iommu->register_lock, flag); in iommu_regset_show() 218 static void ctx_tbl_walk(struct seq_file *m, struct intel_iommu *iommu, u16 bus) in ctx_tbl_walk() argument 240 context = iommu_context_addr(iommu, bus, devfn, 0); in ctx_tbl_walk() 249 tbl_wlk.rt_entry = &iommu->root_entry[bus]; in ctx_tbl_walk() [all …]
|
D | trace.h | 22 TP_PROTO(struct intel_iommu *iommu, u64 qw0, u64 qw1, u64 qw2, u64 qw3), 24 TP_ARGS(iommu, qw0, qw1, qw2, qw3), 31 __string(iommu, iommu->name) 35 __assign_str(iommu, iommu->name); 53 __get_str(iommu), 59 TP_PROTO(struct intel_iommu *iommu, struct device *dev, 63 TP_ARGS(iommu, dev, dw0, dw1, dw2, dw3, seq), 71 __string(iommu, iommu->name) 82 __assign_str(iommu, iommu->name); 87 __get_str(iommu), __get_str(dev), __entry->seq, [all …]
|
/Linux-v6.1/drivers/vfio/ |
D | vfio_iommu_type1.c | 160 vfio_iommu_find_iommu_group(struct vfio_iommu *iommu, 168 static struct vfio_dma *vfio_find_dma(struct vfio_iommu *iommu, in vfio_find_dma() argument 171 struct rb_node *node = iommu->dma_list.rb_node; in vfio_find_dma() 187 static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu, in vfio_find_dma_first_node() argument 191 struct rb_node *node = iommu->dma_list.rb_node; in vfio_find_dma_first_node() 212 static void vfio_link_dma(struct vfio_iommu *iommu, struct vfio_dma *new) in vfio_link_dma() argument 214 struct rb_node **link = &iommu->dma_list.rb_node, *parent = NULL; in vfio_link_dma() 228 rb_insert_color(&new->node, &iommu->dma_list); in vfio_link_dma() 231 static void vfio_unlink_dma(struct vfio_iommu *iommu, struct vfio_dma *old) in vfio_unlink_dma() argument 233 rb_erase(&old->node, &iommu->dma_list); in vfio_unlink_dma() [all …]
|
/Linux-v6.1/arch/powerpc/platforms/cell/ |
D | iommu.c | 104 struct cbe_iommu *iommu; member 131 static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte, in invalidate_tce_cache() argument 138 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd; in invalidate_tce_cache() 195 invalidate_tce_cache(window->iommu, io_pte, npages); in tce_build_cell() 218 __pa(window->iommu->pad_page) | in tce_free_cell() 229 invalidate_tce_cache(window->iommu, io_pte, npages); in tce_free_cell() 235 struct cbe_iommu *iommu = data; in ioc_interrupt() local 237 stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat); in ioc_interrupt() 253 out_be64(iommu->xlate_regs + IOC_IO_ExcpStat, stat); in ioc_interrupt() 298 static void __init cell_iommu_setup_stab(struct cbe_iommu *iommu, in cell_iommu_setup_stab() argument [all …]
|
/Linux-v6.1/Documentation/devicetree/bindings/pci/ |
D | pci-iommu.txt | 26 Documentation/devicetree/bindings/iommu/iommu.txt. 35 - iommu-map: Maps a Requester ID to an IOMMU and associated IOMMU specifier 39 (rid-base,iommu,iommu-base,length). 42 the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base). 44 - iommu-map-mask: A mask to be applied to each Requester ID prior to being 45 mapped to an IOMMU specifier per the iommu-map property. 55 iommu: iommu@a { 57 compatible = "vendor,some-iommu"; 58 #iommu-cells = <1>; 70 iommu-map = <0x0 &iommu 0x0 0x10000>; [all …]
|
/Linux-v6.1/Documentation/devicetree/bindings/iommu/ |
D | qcom,iommu.txt | 12 "qcom,msm8916-iommu" 14 Followed by "qcom,msm-iommu-v1". 27 - #iommu-cells : Must be 1. Index identifies the context-bank #. 29 - ranges : Base address and size of the iommu context banks. 31 - qcom,iommu-secure-id : secure-id. 37 - "qcom,msm-iommu-v1-ns" : non-secure context bank 38 - "qcom,msm-iommu-v1-sec" : secure context bank 39 - reg : Base address and size of context bank within the iommu 45 be only specified if the iommu requires configuration 47 secure lines. (Ie. if the iommu contains secure [all …]
|
/Linux-v6.1/arch/sparc/mm/ |
D | iommu.c | 59 struct iommu_struct *iommu; in sbus_iommu_init() local 66 iommu = kmalloc(sizeof(struct iommu_struct), GFP_KERNEL); in sbus_iommu_init() 67 if (!iommu) { in sbus_iommu_init() 72 iommu->regs = of_ioremap(&op->resource[0], 0, PAGE_SIZE * 3, in sbus_iommu_init() 74 if (!iommu->regs) { in sbus_iommu_init() 79 control = sbus_readl(&iommu->regs->control); in sbus_iommu_init() 84 sbus_writel(control, &iommu->regs->control); in sbus_iommu_init() 86 iommu_invalidate(iommu->regs); in sbus_iommu_init() 87 iommu->start = IOMMU_START; in sbus_iommu_init() 88 iommu->end = 0xffffffff; in sbus_iommu_init() [all …]
|
/Linux-v6.1/drivers/gpu/drm/msm/ |
D | msm_iommu.c | 155 struct msm_iommu *iommu = to_msm_iommu(pagetable->parent); in msm_iommu_pagetable_destroy() local 163 if (atomic_dec_return(&iommu->pagetables) == 0) in msm_iommu_pagetable_destroy() 221 struct msm_iommu *iommu = to_msm_iommu(parent); in msm_iommu_pagetable_create() local 238 iommu_set_fault_handler(iommu->domain, msm_fault_handler, iommu); in msm_iommu_pagetable_create() 255 &ttbr0_cfg, iommu->domain); in msm_iommu_pagetable_create() 266 if (atomic_inc_return(&iommu->pagetables) == 1) { in msm_iommu_pagetable_create() 297 struct msm_iommu *iommu = arg; in msm_fault_handler() local 298 struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(iommu->base.dev); in msm_fault_handler() 306 if (iommu->base.handler) in msm_fault_handler() 307 return iommu->base.handler(iommu->base.arg, iova, flags, ptr); in msm_fault_handler() [all …]
|
/Linux-v6.1/Documentation/ABI/testing/ |
D | sysfs-class-iommu-intel-iommu | 1 What: /sys/class/iommu/<iommu>/intel-iommu/address 8 intel-iommu with a DMAR DRHD table entry. 10 What: /sys/class/iommu/<iommu>/intel-iommu/cap 18 What: /sys/class/iommu/<iommu>/intel-iommu/ecap 26 What: /sys/class/iommu/<iommu>/intel-iommu/version
|